From c39211ea5fd95c21798823cde1adb1434f828335 Mon Sep 17 00:00:00 2001 From: Aryslan Yakshibaev Date: Wed, 13 Sep 2023 16:31:49 +0300 Subject: [PATCH 1/3] Change API version to 6.1 --- autorust/codegen/autorust.toml | 40 +- autorust/codegen/src/bin/gen_ado.rs | 266 +- .../examples/artifact_provenance.rs | 90 +- .../examples/artifacts_list.rs | 80 +- azure_devops_rust_api/examples/build_get.rs | 56 +- azure_devops_rust_api/examples/build_list.rs | 68 +- .../examples/build_list_continuation_token.rs | 124 +- .../examples/build_list_sync.rs | 84 +- .../examples/client_pipeline_policy.rs | 74 +- .../examples/core_org_projects.rs | 34 +- .../examples/core_project_teams.rs | 62 +- .../examples/distributed_task.rs | 82 +- .../examples/extension_management_list.rs | 72 +- .../examples/git_commit_changes.rs | 52 +- ...ff_files_between_base_and_target_branch.rs | 78 +- .../examples/git_items_get.rs | 80 +- .../examples/git_items_list.rs | 60 +- .../examples/git_policy_config_list.rs | 70 +- .../examples/git_pr_commits.rs | 64 +- .../examples/git_pr_create.rs | 94 +- .../examples/git_pr_files_changed.rs | 120 +- .../examples/git_pr_work_items.rs | 62 +- .../examples/git_repo_get.rs | 98 +- .../examples/git_repo_get_raw_rsp.rs | 60 +- .../examples/git_repo_list.rs | 40 +- azure_devops_rust_api/examples/graph_query.rs | 66 +- azure_devops_rust_api/examples/hooks_list.rs | 78 +- azure_devops_rust_api/examples/ims_query.rs | 66 +- .../examples/member_entitlement_management.rs | 34 +- .../examples/permissions_report.rs | 34 +- .../examples/pipeline_preview.rs | 92 +- azure_devops_rust_api/examples/pipelines.rs | 120 +- azure_devops_rust_api/examples/policy.rs | 94 +- azure_devops_rust_api/examples/release.rs | 86 +- .../examples/release_get_release.rs | 76 +- .../examples/release_logs.rs | 94 +- azure_devops_rust_api/examples/search_code.rs | 90 +- .../examples/search_package.rs | 90 +- .../examples/search_repositories.rs | 42 +- .../examples/search_work_item.rs | 94 +- .../examples/service_endpoint.rs | 72 +- azure_devops_rust_api/examples/status.rs | 76 +- azure_devops_rust_api/examples/test_plan.rs | 92 +- .../examples/test_runs_list.rs | 42 +- azure_devops_rust_api/examples/utils/mod.rs | 54 +- .../examples/wiki_pages_create_or_update.rs | 203 +- .../examples/wit_work_item_create.rs | 56 +- .../examples/wit_work_item_get.rs | 219 +- .../examples/wit_work_item_queries.rs | 32 +- azure_devops_rust_api/src/accounts/mod.rs | 486 +- azure_devops_rust_api/src/accounts/models.rs | 408 +- .../src/approvals_and_checks/mod.rs | 3934 +- .../src/approvals_and_checks/models.rs | 2112 +- azure_devops_rust_api/src/artifacts/mod.rs | 10628 ++--- azure_devops_rust_api/src/artifacts/models.rs | 2583 +- .../src/artifacts_package_types/mod.rs | 15332 +++---- .../src/artifacts_package_types/models.rs | 1707 +- azure_devops_rust_api/src/audit/mod.rs | 2515 +- azure_devops_rust_api/src/audit/models.rs | 778 +- azure_devops_rust_api/src/auth.rs | 88 +- azure_devops_rust_api/src/build/mod.rs | 25870 ++++++------ azure_devops_rust_api/src/build/models.rs | 10528 +++-- azure_devops_rust_api/src/core/mod.rs | 4975 ++- azure_devops_rust_api/src/core/models.rs | 1994 +- azure_devops_rust_api/src/dashboard/mod.rs | 4500 +-- azure_devops_rust_api/src/dashboard/models.rs | 1215 +- azure_devops_rust_api/src/date_time.rs | 332 +- .../src/distributed_task/mod.rs | 16975 ++++---- .../src/distributed_task/models.rs | 12787 +++--- .../src/extension_management/mod.rs | 1552 +- .../src/extension_management/models.rs | 3477 +- azure_devops_rust_api/src/favorite/mod.rs | 2784 +- azure_devops_rust_api/src/favorite/models.rs | 584 +- azure_devops_rust_api/src/git/mod.rs | 33674 ++++++++-------- azure_devops_rust_api/src/git/models.rs | 12551 +++--- azure_devops_rust_api/src/graph/mod.rs | 6932 ++-- azure_devops_rust_api/src/graph/models.rs | 1686 +- azure_devops_rust_api/src/hooks/mod.rs | 5738 +-- azure_devops_rust_api/src/hooks/models.rs | 2940 +- azure_devops_rust_api/src/ims/mod.rs | 577 +- azure_devops_rust_api/src/ims/models.rs | 1468 +- .../src/member_entitlement_management/mod.rs | 4778 +-- .../member_entitlement_management/models.rs | 2372 +- azure_devops_rust_api/src/operations/mod.rs | 471 +- .../src/operations/models.rs | 138 +- .../src/permissions_report/mod.rs | 1142 +- .../src/permissions_report/models.rs | 292 +- azure_devops_rust_api/src/pipelines/mod.rs | 3033 +- azure_devops_rust_api/src/pipelines/models.rs | 1026 +- azure_devops_rust_api/src/policy/mod.rs | 3431 +- azure_devops_rust_api/src/policy/models.rs | 586 +- azure_devops_rust_api/src/processadmin/mod.rs | 1494 +- .../src/processadmin/models.rs | 380 +- azure_devops_rust_api/src/processes/mod.rs | 14490 +++---- azure_devops_rust_api/src/processes/models.rs | 2779 +- azure_devops_rust_api/src/profile/mod.rs | 547 +- azure_devops_rust_api/src/profile/models.rs | 560 +- azure_devops_rust_api/src/release/mod.rs | 10130 ++--- azure_devops_rust_api/src/release/models.rs | 12092 +++--- azure_devops_rust_api/src/search/mod.rs | 1784 +- azure_devops_rust_api/src/search/models.rs | 1389 +- azure_devops_rust_api/src/security/mod.rs | 2683 +- azure_devops_rust_api/src/security/models.rs | 616 +- .../src/security_roles/mod.rs | 1841 +- .../src/security_roles/models.rs | 400 +- azure_devops_rust_api/src/serde.rs | 8 +- .../src/service_endpoint/mod.rs | 3813 +- .../src/service_endpoint/models.rs | 3235 +- azure_devops_rust_api/src/status/mod.rs | 465 +- azure_devops_rust_api/src/status/models.rs | 867 +- azure_devops_rust_api/src/symbol/mod.rs | 3371 +- azure_devops_rust_api/src/symbol/models.rs | 478 +- azure_devops_rust_api/src/test/mod.rs | 11732 +++--- azure_devops_rust_api/src/test/models.rs | 18994 +++++---- azure_devops_rust_api/src/test_plan/mod.rs | 10736 ++--- azure_devops_rust_api/src/test_plan/models.rs | 4070 +- azure_devops_rust_api/src/test_results/mod.rs | 4405 +- .../src/test_results/models.rs | 7618 ++-- azure_devops_rust_api/src/tfvc/mod.rs | 7320 ++-- azure_devops_rust_api/src/tfvc/models.rs | 2568 +- azure_devops_rust_api/src/token_admin/mod.rs | 919 +- .../src/token_admin/models.rs | 398 +- azure_devops_rust_api/src/tokens/mod.rs | 1469 +- azure_devops_rust_api/src/tokens/models.rs | 890 +- azure_devops_rust_api/src/wiki/mod.rs | 5191 +-- azure_devops_rust_api/src/wiki/models.rs | 1784 +- azure_devops_rust_api/src/wit/mod.rs | 23697 ++++++----- azure_devops_rust_api/src/wit/models.rs | 5700 ++- azure_devops_rust_api/src/work/mod.rs | 15341 +++---- azure_devops_rust_api/src/work/models.rs | 4384 +- 130 files changed, 200951 insertions(+), 204678 deletions(-) diff --git a/autorust/codegen/autorust.toml b/autorust/codegen/autorust.toml index 8e17c396..2927404d 100644 --- a/autorust/codegen/autorust.toml +++ b/autorust/codegen/autorust.toml @@ -1,102 +1,102 @@ [properties] boxed = [ [ - "../../vsts-rest-api-specs.patched/specification/build/7.1/build.json", + "../../vsts-rest-api-specs.patched/specification/build/6.1/build.json", "Build", "triggeredByBuild", ], [ - "../../vsts-rest-api-specs.patched/specification/distributedTask/7.1/taskAgent.json", + "../../vsts-rest-api-specs.patched/specification/distributedTask/6.1/taskAgent.json", "TaskOrchestrationContainer", "rollback", ], [ - "../../vsts-rest-api-specs.patched/specification/distributedTask/7.1/taskAgent.json", + "../../vsts-rest-api-specs.patched/specification/distributedTask/6.1/taskAgent.json", "JToken", "first", ], [ - "../../vsts-rest-api-specs.patched/specification/distributedTask/7.1/taskAgent.json", + "../../vsts-rest-api-specs.patched/specification/distributedTask/6.1/taskAgent.json", "JToken", "item", ], [ - "../../vsts-rest-api-specs.patched/specification/distributedTask/7.1/taskAgent.json", + "../../vsts-rest-api-specs.patched/specification/distributedTask/6.1/taskAgent.json", "JToken", "last", ], [ - "../../vsts-rest-api-specs.patched/specification/distributedTask/7.1/taskAgent.json", + "../../vsts-rest-api-specs.patched/specification/distributedTask/6.1/taskAgent.json", "JToken", "next", ], [ - "../../vsts-rest-api-specs.patched/specification/distributedTask/7.1/taskAgent.json", + "../../vsts-rest-api-specs.patched/specification/distributedTask/6.1/taskAgent.json", "JToken", "previous", ], [ - "../../vsts-rest-api-specs.patched/specification/distributedTask/7.1/taskAgent.json", + "../../vsts-rest-api-specs.patched/specification/distributedTask/6.1/taskAgent.json", "JToken", "root", ], [ - "../../vsts-rest-api-specs.patched/specification/graph/7.1/graph.json", + "../../vsts-rest-api-specs.patched/specification/graph/6.1/graph.json", "JToken", "first", ], [ - "../../vsts-rest-api-specs.patched/specification/graph/7.1/graph.json", + "../../vsts-rest-api-specs.patched/specification/graph/6.1/graph.json", "JToken", "item", ], [ - "../../vsts-rest-api-specs.patched/specification/graph/7.1/graph.json", + "../../vsts-rest-api-specs.patched/specification/graph/6.1/graph.json", "JToken", "last", ], [ - "../../vsts-rest-api-specs.patched/specification/graph/7.1/graph.json", + "../../vsts-rest-api-specs.patched/specification/graph/6.1/graph.json", "JToken", "next", ], [ - "../../vsts-rest-api-specs.patched/specification/graph/7.1/graph.json", + "../../vsts-rest-api-specs.patched/specification/graph/6.1/graph.json", "JToken", "previous", ], [ - "../../vsts-rest-api-specs.patched/specification/graph/7.1/graph.json", + "../../vsts-rest-api-specs.patched/specification/graph/6.1/graph.json", "JToken", "root", ], [ - "../../vsts-rest-api-specs.patched/specification/serviceEndpoint/7.1/serviceEndpoint.json", + "../../vsts-rest-api-specs.patched/specification/serviceEndpoint/6.1/serviceEndpoint.json", "JToken", "first", ], [ - "../../vsts-rest-api-specs.patched/specification/serviceEndpoint/7.1/serviceEndpoint.json", + "../../vsts-rest-api-specs.patched/specification/serviceEndpoint/6.1/serviceEndpoint.json", "JToken", "item", ], [ - "../../vsts-rest-api-specs.patched/specification/serviceEndpoint/7.1/serviceEndpoint.json", + "../../vsts-rest-api-specs.patched/specification/serviceEndpoint/6.1/serviceEndpoint.json", "JToken", "last", ], [ - "../../vsts-rest-api-specs.patched/specification/serviceEndpoint/7.1/serviceEndpoint.json", + "../../vsts-rest-api-specs.patched/specification/serviceEndpoint/6.1/serviceEndpoint.json", "JToken", "next", ], [ - "../../vsts-rest-api-specs.patched/specification/serviceEndpoint/7.1/serviceEndpoint.json", + "../../vsts-rest-api-specs.patched/specification/serviceEndpoint/6.1/serviceEndpoint.json", "JToken", "previous", ], [ - "../../vsts-rest-api-specs.patched/specification/serviceEndpoint/7.1/serviceEndpoint.json", + "../../vsts-rest-api-specs.patched/specification/serviceEndpoint/6.1/serviceEndpoint.json", "JToken", "root", ], diff --git a/autorust/codegen/src/bin/gen_ado.rs b/autorust/codegen/src/bin/gen_ado.rs index 66fb7737..c732c733 100644 --- a/autorust/codegen/src/bin/gen_ado.rs +++ b/autorust/codegen/src/bin/gen_ado.rs @@ -7,146 +7,146 @@ use autorust_codegen::autorust_toml; use autorust_codegen::{self, CrateConfig, Result, RunConfig}; use camino::Utf8PathBuf; -const API_VERSION: &str = "7.1"; +const API_VERSION: &str = "6.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 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", - ), - ( - 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}/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!["serviceEndpoint/{VERSION}/serviceEndpoint.json"], - "service_endpoint", - ), - ( - 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"), - ]; + 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", + ), + ( + 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}/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!["serviceEndpoint/{VERSION}/serviceEndpoint.json"], + "service_endpoint", + ), + ( + 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(); + 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(); + 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, - }; + 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)?; - } + // Generate module + println!("Generating module: {}", module_name); + let _cg = crate::autorust_codegen::run(&crate_config, &package_config)?; + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/artifact_provenance.rs b/azure_devops_rust_api/examples/artifact_provenance.rs index 28ddc1f3..c7ee98ac 100644 --- a/azure_devops_rust_api/examples/artifact_provenance.rs +++ b/azure_devops_rust_api/examples/artifact_provenance.rs @@ -13,63 +13,57 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); + // 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 an artifacts client - println!("Create artifacts client"); - let artifacts_client = artifacts::ClientBuilder::new(credential).build(); + // Create an artifacts client + println!("Create artifacts client"); + let artifacts_client = artifacts::ClientBuilder::new(credential).build(); - // Query all the artifact feeds - let feeds = artifacts_client - .feed_management_client() - .get_feeds(&organization, &project) + // Query all the artifact feeds + let feeds = artifacts_client + .feed_management_client() + .get_feeds(&organization, &project) + .await? + .value; + + if let Some(feed) = feeds.iter().next() { + if let Some(feed_id) = &feed.feed_core.id { + let packages = artifacts_client + .artifact_details_client() + .get_packages(&organization, feed_id, &project) .await? .value; - if let Some(feed) = feeds.iter().next() { - if let Some(feed_id) = &feed.feed_core.id { - let packages = artifacts_client - .artifact_details_client() - .get_packages(&organization, feed_id, &project) - .await? - .value; - - if let Some(package) = packages.iter().next() { - let name = package.name.as_deref().unwrap_or(""); - let id = package.id.as_deref().unwrap_or(""); - let version_id = package - .versions - .first() - .expect("No package version information available") - .id - .as_deref() - .unwrap_or(""); - println!("{:30}{:40}{:40}", name, id, version_id); + if let Some(package) = packages.iter().next() { + let name = package.name.as_deref().unwrap_or(""); + let id = package.id.as_deref().unwrap_or(""); + let version_id = package + .versions + .first() + .expect("No package version information available") + .id + .as_deref() + .unwrap_or(""); + println!("{:30}{:40}{:40}", name, id, version_id); - let provenance = artifacts_client - .artifact_details_client() - .get_package_version_provenance( - &organization, - feed_id, - id, - version_id, - &project, - ) - .await? - .provenance; + let provenance = artifacts_client + .artifact_details_client() + .get_package_version_provenance(&organization, feed_id, id, version_id, &project) + .await? + .provenance; - println!("{:#?}", provenance); - } - } + println!("{:#?}", provenance); + } } + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/artifacts_list.rs b/azure_devops_rust_api/examples/artifacts_list.rs index 6b87c713..b20956be 100644 --- a/azure_devops_rust_api/examples/artifacts_list.rs +++ b/azure_devops_rust_api/examples/artifacts_list.rs @@ -11,54 +11,54 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); + // 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 an artifacts client - println!("Create artifacts client"); - let artifacts_client = artifacts::ClientBuilder::new(credential).build(); + // Create an artifacts client + println!("Create artifacts client"); + let artifacts_client = artifacts::ClientBuilder::new(credential).build(); - // Query all the artifact feeds - let feeds = artifacts_client - .feed_management_client() - .get_feeds(&organization, &project) - .await? - .value; + // Query all the artifact feeds + let feeds = artifacts_client + .feed_management_client() + .get_feeds(&organization, &project) + .await? + .value; - println!("Found {} feeds", feeds.len()); - for feed in &feeds { - let id = feed.feed_core.id.as_deref().unwrap_or(""); - let name = feed.feed_core.name.as_deref().unwrap_or(""); - let url = feed.url.as_deref().unwrap_or(""); - println!("{:40}{:30}{}", id, name, url); - } + println!("Found {} feeds", feeds.len()); + for feed in &feeds { + let id = feed.feed_core.id.as_deref().unwrap_or(""); + let name = feed.feed_core.name.as_deref().unwrap_or(""); + let url = feed.url.as_deref().unwrap_or(""); + println!("{:40}{:30}{}", id, name, url); + } - if let Some(feed) = feeds.iter().next() { - println!("\nExample feed struct:\n{:#?}", feed); + if let Some(feed) = feeds.iter().next() { + println!("\nExample feed struct:\n{:#?}", feed); - if let Some(feed_id) = &feed.feed_core.id { - println!("\nFeed packages:"); - let packages = artifacts_client - .artifact_details_client() - .get_packages(&organization, feed_id, &project) - .await? - .value; + if let Some(feed_id) = &feed.feed_core.id { + println!("\nFeed packages:"); + let packages = artifacts_client + .artifact_details_client() + .get_packages(&organization, feed_id, &project) + .await? + .value; - for package in &packages { - let id = package.id.as_deref().unwrap_or(""); - let name = package.name.as_deref().unwrap_or(""); - let url = package.url.as_deref().unwrap_or(""); - println!("{:40}{:30}{}", id, name, url); - } - } + for package in &packages { + let id = package.id.as_deref().unwrap_or(""); + let name = package.name.as_deref().unwrap_or(""); + let url = package.url.as_deref().unwrap_or(""); + println!("{:40}{:30}{}", id, name, url); + } } + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/build_get.rs b/azure_devops_rust_api/examples/build_get.rs index f7159e90..959ca91e 100644 --- a/azure_devops_rust_api/examples/build_get.rs +++ b/azure_devops_rust_api/examples/build_get.rs @@ -11,32 +11,32 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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"); - let build_id: i32 = env::args() - .nth(1) - .expect("Usage: build_get ") - .parse()?; - - // Create a build client - println!("Create build client"); - let build_client = build::ClientBuilder::new(credential).build(); - - // Get specified build - println!("Get build {build_id}"); - let build = build_client - .builds_client() - .get(organization, project, build_id) - .await?; - - println!("Build:\n{:#?}", build); - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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"); + let build_id: i32 = env::args() + .nth(1) + .expect("Usage: build_get ") + .parse()?; + + // Create a build client + println!("Create build client"); + let build_client = build::ClientBuilder::new(credential).build(); + + // Get specified build + println!("Get build {build_id}"); + let build = build_client + .builds_client() + .get(organization, project, build_id) + .await?; + + println!("Build:\n{:#?}", build); + + Ok(()) } diff --git a/azure_devops_rust_api/examples/build_list.rs b/azure_devops_rust_api/examples/build_list.rs index f1052fc7..4256c0bd 100644 --- a/azure_devops_rust_api/examples/build_list.rs +++ b/azure_devops_rust_api/examples/build_list.rs @@ -12,38 +12,38 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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 build client - println!("Create build client"); - let build_client = build::ClientBuilder::new(credential).build(); - - // Query all the builds in the past hour - let end_time = OffsetDateTime::now_utc(); - let start_time = end_time - 1.hours(); - - // Get all builds in the specified organization/project in the past hour - println!("Get list"); - let builds = build_client - .builds_client() - .list(organization, project) - .min_time(start_time) - .max_time(end_time) - .await? - .value; - - println!("Found {} builds", builds.len()); - if let Some(build) = builds.iter().next() { - println!("Example build struct: {:#?}", build); - } - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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 build client + println!("Create build client"); + let build_client = build::ClientBuilder::new(credential).build(); + + // Query all the builds in the past hour + let end_time = OffsetDateTime::now_utc(); + let start_time = end_time - 1.hours(); + + // Get all builds in the specified organization/project in the past hour + println!("Get list"); + let builds = build_client + .builds_client() + .list(organization, project) + .min_time(start_time) + .max_time(end_time) + .await? + .value; + + println!("Found {} builds", builds.len()); + if let Some(build) = builds.iter().next() { + println!("Example build struct: {:#?}", build); + } + + Ok(()) } diff --git a/azure_devops_rust_api/examples/build_list_continuation_token.rs b/azure_devops_rust_api/examples/build_list_continuation_token.rs index 3c153d08..1319d23e 100644 --- a/azure_devops_rust_api/examples/build_list_continuation_token.rs +++ b/azure_devops_rust_api/examples/build_list_continuation_token.rs @@ -16,79 +16,79 @@ mod utils; const NUM_BUILD_BATCHES: usize = 5; async fn get_builds( - build_client: &build::Client, - organization: &str, - project: &str, - continuation_token: &Option, + build_client: &build::Client, + organization: &str, + project: &str, + continuation_token: &Option, ) -> Result<(Vec, Option)> { - let mut list_builder = build_client.builds_client().list(organization, project); - - if let Some(continuation_token) = continuation_token { - println!( - "Query builds with continuation_token: {}", - continuation_token - ); - list_builder = list_builder.continuation_token(continuation_token) - } else { - println!("Query builds with no continuation_token"); - } + let mut list_builder = build_client.builds_client().list(organization, project); - let (status, headers, body) = list_builder.send().await?.into_raw_response().deconstruct(); + if let Some(continuation_token) = continuation_token { + println!( + "Query builds with continuation_token: {}", + continuation_token + ); + list_builder = list_builder.continuation_token(continuation_token) + } else { + println!("Query builds with no continuation_token"); + } - if status != StatusCode::Ok { - println!("Request failed"); - return Err(anyhow!("Request failed")); - } + let (status, headers, body) = list_builder.send().await?.into_raw_response().deconstruct(); - let new_continuation_token = headers.get_optional_string( - &azure_core::headers::HeaderName::from_static("x-ms-continuationtoken"), - ); + if status != StatusCode::Ok { + println!("Request failed"); + return Err(anyhow!("Request failed")); + } - let body_data = body.collect_string().await?; - let build_list: BuildList = serde_json::from_str(&body_data) - .with_context(|| format!("Failed to parse BuildList: {}", &body_data))?; + let new_continuation_token = headers.get_optional_string( + &azure_core::headers::HeaderName::from_static("x-ms-continuationtoken"), + ); - println!("Received {} builds", build_list.count.unwrap_or(0)); + let body_data = body.collect_string().await?; + let build_list: BuildList = serde_json::from_str(&body_data) + .with_context(|| format!("Failed to parse BuildList: {}", &body_data))?; - Ok((build_list.value, new_continuation_token)) + println!("Received {} builds", build_list.count.unwrap_or(0)); + + Ok((build_list.value, new_continuation_token)) } #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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 build client - let build_client = build::ClientBuilder::new(credential).build(); - - let mut continuation_token = None; - - // Query several batches of builds. Each batch has 1000 builds (by default) - println!("Num build batches: {}", NUM_BUILD_BATCHES); - for batch in 0..NUM_BUILD_BATCHES { - let (builds, new_continuation_token) = - get_builds(&build_client, &organization, &project, &continuation_token).await?; - - if let Some(build) = builds.iter().next() { - println!( - "First build of batch {} start time: {}\n", - batch, - build.start_time.unwrap().format(&Rfc3339)? - ); - } - continuation_token = new_continuation_token; - - if continuation_token == None { - println!("continuation_token is None - exiting"); - } + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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 build client + let build_client = build::ClientBuilder::new(credential).build(); + + let mut continuation_token = None; + + // Query several batches of builds. Each batch has 1000 builds (by default) + println!("Num build batches: {}", NUM_BUILD_BATCHES); + for batch in 0..NUM_BUILD_BATCHES { + let (builds, new_continuation_token) = + get_builds(&build_client, &organization, &project, &continuation_token).await?; + + if let Some(build) = builds.iter().next() { + println!( + "First build of batch {} start time: {}\n", + batch, + build.start_time.unwrap().format(&Rfc3339)? + ); + } + continuation_token = new_continuation_token; + + if continuation_token == None { + println!("continuation_token is None - exiting"); } + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/build_list_sync.rs b/azure_devops_rust_api/examples/build_list_sync.rs index 86292269..1830429c 100644 --- a/azure_devops_rust_api/examples/build_list_sync.rs +++ b/azure_devops_rust_api/examples/build_list_sync.rs @@ -12,46 +12,46 @@ use time::{ext::NumericalDuration, OffsetDateTime}; mod utils; fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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 `current_thread` tokio runtime to use when invoking async functions - let rt = tokio::runtime::Builder::new_current_thread() - .enable_all() - .build()?; - - // Create a build client - println!("Create build client"); - let build_client = build::ClientBuilder::new(credential.clone()).build(); - - // Query all the builds in the past hour - let end_time = OffsetDateTime::now_utc(); - let start_time = end_time - 1.hours(); - - // Get all builds in the specified organization/project in the past hour - let builds = rt - .block_on(async { - println!("Get list"); - build_client - .builds_client() - .list(&organization, &project) - .min_time(start_time) - .max_time(end_time) - .await - })? - .value; - - println!("Found {} builds", builds.len()); - if let Some(build) = builds.iter().next() { - println!("Example build struct: {:#?}", build); - } - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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 `current_thread` tokio runtime to use when invoking async functions + let rt = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build()?; + + // Create a build client + println!("Create build client"); + let build_client = build::ClientBuilder::new(credential.clone()).build(); + + // Query all the builds in the past hour + let end_time = OffsetDateTime::now_utc(); + let start_time = end_time - 1.hours(); + + // Get all builds in the specified organization/project in the past hour + let builds = rt + .block_on(async { + println!("Get list"); + build_client + .builds_client() + .list(&organization, &project) + .min_time(start_time) + .max_time(end_time) + .await + })? + .value; + + println!("Found {} builds", builds.len()); + if let Some(build) = builds.iter().next() { + println!("Example build struct: {:#?}", build); + } + + Ok(()) } diff --git a/azure_devops_rust_api/examples/client_pipeline_policy.rs b/azure_devops_rust_api/examples/client_pipeline_policy.rs index e5bde0d7..2c7b9345 100644 --- a/azure_devops_rust_api/examples/client_pipeline_policy.rs +++ b/azure_devops_rust_api/examples/client_pipeline_policy.rs @@ -24,55 +24,55 @@ mod utils; pub struct RequestLogger {} impl RequestLogger { - fn new() -> Self { - Default::default() - } + fn new() -> Self { + Default::default() + } } #[async_trait] impl azure_core::Policy for RequestLogger { - async fn send( - &self, - ctx: &Context, - request: &mut Request, - next: &[Arc], - ) -> PolicyResult { - info!("> Request:\n{:#?}", request); - let now = time::Instant::now(); - // Call the next policy in the chain, and await the response - let rsp = next[0].send(ctx, request, &next[1..]).await; - let elapsed_time = now.elapsed(); - info!("Request took {} secs", elapsed_time.as_seconds_f32()); - info!("< Response:\n{:#?}", rsp); - rsp - } + async fn send( + &self, + ctx: &Context, + request: &mut Request, + next: &[Arc], + ) -> PolicyResult { + info!("> Request:\n{:#?}", request); + let now = time::Instant::now(); + // Call the next policy in the chain, and await the response + let rsp = next[0].send(ctx, request, &next[1..]).await; + let elapsed_time = now.elapsed(); + info!("Request took {} secs", elapsed_time.as_seconds_f32()); + info!("< Response:\n{:#?}", rsp); + rsp + } } #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - set default log level to info - env_logger::Builder::from_env(Env::default().default_filter_or("info")).init(); + // Initialize logging - set default log level to info + env_logger::Builder::from_env(Env::default().default_filter_or("info")).init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); + // 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"); - let request_logger_policy = Arc::new(RequestLogger::new()) as Arc; + let request_logger_policy = Arc::new(RequestLogger::new()) as Arc; - // Create a git client with our custom policy - let git_client = git::ClientBuilder::new(credential) - .per_call_policies(vec![request_logger_policy]) - .build(); + // Create a git client with our custom policy + let git_client = git::ClientBuilder::new(credential) + .per_call_policies(vec![request_logger_policy]) + .build(); - // Get all repositories in the specified organization/project - let _repos = git_client - .repositories_client() - .list(organization, project) - .await? - .value; + // Get all repositories in the specified organization/project + let _repos = git_client + .repositories_client() + .list(organization, project) + .await? + .value; - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/core_org_projects.rs b/azure_devops_rust_api/examples/core_org_projects.rs index 7853051d..0460641b 100644 --- a/azure_devops_rust_api/examples/core_org_projects.rs +++ b/azure_devops_rust_api/examples/core_org_projects.rs @@ -11,28 +11,28 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // Get ADO server configuration via environment variables - let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + // Get ADO server configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); - // Max number of projects to be fetched, default max is 100 - let top_projects: i32 = 500; + // Max number of projects to be fetched, default max is 100 + let top_projects: i32 = 500; - // Create core client - let core_client = core::ClientBuilder::new(credential).build(); + // Create core client + let core_client = core::ClientBuilder::new(credential).build(); - let org_projects = core_client - .projects_client() - .list(&organization) - .top(top_projects) - .await?; + let org_projects = core_client + .projects_client() + .list(&organization) + .top(top_projects) + .await?; - println!("{:#?}", org_projects); + println!("{:#?}", org_projects); - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/core_project_teams.rs b/azure_devops_rust_api/examples/core_project_teams.rs index 35f93cb9..d33030c6 100644 --- a/azure_devops_rust_api/examples/core_project_teams.rs +++ b/azure_devops_rust_api/examples/core_project_teams.rs @@ -11,37 +11,37 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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"); - - // Max number of teams to be fetched, default max is 100 - let top_teams: i32 = 500; - - // Create core client - let core_client = core::ClientBuilder::new(credential).build(); - - let project_teams = core_client - .teams_client() - .get_teams(&organization, &project) - .top(top_teams) - .await? - .value; - - // Display team names - println!("\nProject teams:"); - for team in project_teams.iter() { - match &team.web_api_team_ref.name { - Some(name) => println!("{}", name), - _ => {} - } + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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"); + + // Max number of teams to be fetched, default max is 100 + let top_teams: i32 = 500; + + // Create core client + let core_client = core::ClientBuilder::new(credential).build(); + + let project_teams = core_client + .teams_client() + .get_teams(&organization, &project) + .top(top_teams) + .await? + .value; + + // Display team names + println!("\nProject teams:"); + for team in project_teams.iter() { + match &team.web_api_team_ref.name { + Some(name) => println!("{}", name), + _ => {} } + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/distributed_task.rs b/azure_devops_rust_api/examples/distributed_task.rs index 15a25e49..7b1451c4 100644 --- a/azure_devops_rust_api/examples/distributed_task.rs +++ b/azure_devops_rust_api/examples/distributed_task.rs @@ -10,45 +10,45 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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 distributed task client - let distributed_task_client = distributed_task::ClientBuilder::new(credential).build(); - - // Get a list of agent pools for the org - println!("Agents pools for the org are:"); - let distributed_task_agents_pools = distributed_task_client - .pools_client() - .get_agent_pools(&organization) - .await? - .value; - println!("{:#?}", distributed_task_agents_pools); - - // Get a list of agent queues for the project - println!("Agents queues for the project are:"); - let distributed_task_agent_queues = distributed_task_client - .queues_client() - .get_agent_queues(&organization, &project) - .await? - .value; - println!("{:#?}", distributed_task_agent_queues); - - // Get all variable groups for the project - println!("Variable groups for the project are:"); - let distributed_task_variable_groups = distributed_task_client - .variablegroups_client() - .get_variable_groups(&organization, &project) - .await? - .value; - println!("{:#?}", distributed_task_variable_groups); - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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 distributed task client + let distributed_task_client = distributed_task::ClientBuilder::new(credential).build(); + + // Get a list of agent pools for the org + println!("Agents pools for the org are:"); + let distributed_task_agents_pools = distributed_task_client + .pools_client() + .get_agent_pools(&organization) + .await? + .value; + println!("{:#?}", distributed_task_agents_pools); + + // Get a list of agent queues for the project + println!("Agents queues for the project are:"); + let distributed_task_agent_queues = distributed_task_client + .queues_client() + .get_agent_queues(&organization, &project) + .await? + .value; + println!("{:#?}", distributed_task_agent_queues); + + // Get all variable groups for the project + println!("Variable groups for the project are:"); + let distributed_task_variable_groups = distributed_task_client + .variablegroups_client() + .get_variable_groups(&organization, &project) + .await? + .value; + println!("{:#?}", distributed_task_variable_groups); + + Ok(()) } diff --git a/azure_devops_rust_api/examples/extension_management_list.rs b/azure_devops_rust_api/examples/extension_management_list.rs index ddaec69e..e1ddd82c 100644 --- a/azure_devops_rust_api/examples/extension_management_list.rs +++ b/azure_devops_rust_api/examples/extension_management_list.rs @@ -12,42 +12,42 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // Get ADO server configuration via environment variables - let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); - - // Create a extension_management_client - let extension_management_client = extension_management::ClientBuilder::new(credential).build(); - - // Get all the installed extensions - let installed_extensions = extension_management_client - .installed_extensions_client() - .list(organization) - .await? - .value; - - println!("Installed extensions:"); - for extension in installed_extensions.iter() { - match extension { - InstalledExtension { - extension_name: Some(name), - publisher_name: Some(publisher), - version: Some(version), - .. - } => { - println!("{:65}{:24}{:40}", name, version, publisher); - } - _ => {} - } + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // Get ADO server configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + + // Create a extension_management_client + let extension_management_client = extension_management::ClientBuilder::new(credential).build(); + + // Get all the installed extensions + let installed_extensions = extension_management_client + .installed_extensions_client() + .list(organization) + .await? + .value; + + println!("Installed extensions:"); + for extension in installed_extensions.iter() { + match extension { + InstalledExtension { + extension_name: Some(name), + publisher_name: Some(publisher), + version: Some(version), + .. + } => { + println!("{:65}{:24}{:40}", name, version, publisher); + } + _ => {} } + } - if let Some(extension) = installed_extensions.iter().next() { - println!("\nExample extension:\n{:#?}", extension); - } - Ok(()) + if let Some(extension) = installed_extensions.iter().next() { + println!("\nExample extension:\n{:#?}", extension); + } + Ok(()) } diff --git a/azure_devops_rust_api/examples/git_commit_changes.rs b/azure_devops_rust_api/examples/git_commit_changes.rs index 1c01c333..ef342d26 100644 --- a/azure_devops_rust_api/examples/git_commit_changes.rs +++ b/azure_devops_rust_api/examples/git_commit_changes.rs @@ -11,30 +11,30 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // Get ADO server configuration via environment variables - let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); - let repository_name = env::args() - .nth(1) - .expect("Usage: git_commit_changes "); - let commit_id = env::args() - .nth(2) - .expect("Usage: git_commit_changes "); - let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT"); - - // Create a git client - let git_client = git::ClientBuilder::new(credential).build(); - - let commit_changes = git_client - .commits_client() - .get_changes(&organization, &commit_id, &repository_name, &project) - .await?; - println!("Commit changes:\n{:#?}", commit_changes); - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // Get ADO server configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + let repository_name = env::args() + .nth(1) + .expect("Usage: git_commit_changes "); + let commit_id = env::args() + .nth(2) + .expect("Usage: git_commit_changes "); + let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT"); + + // Create a git client + let git_client = git::ClientBuilder::new(credential).build(); + + let commit_changes = git_client + .commits_client() + .get_changes(&organization, &commit_id, &repository_name, &project) + .await?; + println!("Commit changes:\n{:#?}", commit_changes); + + Ok(()) } diff --git a/azure_devops_rust_api/examples/git_diff_files_between_base_and_target_branch.rs b/azure_devops_rust_api/examples/git_diff_files_between_base_and_target_branch.rs index f49a65b5..357fb0ac 100644 --- a/azure_devops_rust_api/examples/git_diff_files_between_base_and_target_branch.rs +++ b/azure_devops_rust_api/examples/git_diff_files_between_base_and_target_branch.rs @@ -12,62 +12,62 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); + // 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"); - // Getting repo, base and target branch name from command line - let repository_name = env::args() + // Getting repo, base and target branch name from command line + let repository_name = env::args() .nth(1) .expect("Usage: git_diff_files_between_base_and_target_branch "); - let base_branch_name = env::args() + let base_branch_name = env::args() .nth(2) .expect("Usage: git_diff_files_between_base_and_target_branch "); - let target_branch_name = env::args() + let target_branch_name = env::args() .nth(3) .expect("Usage: git_diff_files_between_base_and_target_branch "); - // Set the max number of commits to get, default is 100 - let top_commits: i32 = 500; + // Set the max number of commits to get, default is 100 + let top_commits: i32 = 500; - // Create a git client - let git_client = git::ClientBuilder::new(credential).build(); + // Create a git client + let git_client = git::ClientBuilder::new(credential).build(); - // Get diff client between branches - let diffs = git_client - .diffs_client() - .get(organization, repository_name, project) - .top(top_commits) - .base_version(base_branch_name) - .target_version(target_branch_name) - .await? - .changes; + // Get diff client between branches + let diffs = git_client + .diffs_client() + .get(organization, repository_name, project) + .top(top_commits) + .base_version(base_branch_name) + .target_version(target_branch_name) + .await? + .changes; - // Record unique filenames which are changed in the PR - let mut files_diff_between_branches = HashSet::::new(); + // Record unique filenames which are changed in the PR + let mut files_diff_between_branches = HashSet::::new(); - // Get files name which are present in the target branch - for diff in diffs.iter() { - let git_object_type = diff.change.item["gitObjectType"].as_str().unwrap(); - if git_object_type == "blob" { - let file_name = diff.change.item["path"].as_str().unwrap(); - files_diff_between_branches.insert(file_name.to_string()); - } + // Get files name which are present in the target branch + for diff in diffs.iter() { + let git_object_type = diff.change.item["gitObjectType"].as_str().unwrap(); + if git_object_type == "blob" { + let file_name = diff.change.item["path"].as_str().unwrap(); + files_diff_between_branches.insert(file_name.to_string()); } + } - // Unique files changed in the PR - println!("These files are modified in pr(target) branch:"); - for file_name in files_diff_between_branches.iter() { - println!("{}", file_name) - } + // Unique files changed in the PR + println!("These files are modified in pr(target) branch:"); + for file_name in files_diff_between_branches.iter() { + println!("{}", file_name) + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/git_items_get.rs b/azure_devops_rust_api/examples/git_items_get.rs index f821244c..bc6f4e9e 100644 --- a/azure_devops_rust_api/examples/git_items_get.rs +++ b/azure_devops_rust_api/examples/git_items_get.rs @@ -11,44 +11,44 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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"); - let repository_name = env::args() - .nth(1) - .expect("Usage: git_items_get "); - let file_path = env::args() - .nth(2) - .expect("Usage: git_items_get "); - - // Create a git client - let git_client = git::ClientBuilder::new(credential).build(); - - // To get the file metadata, it appears that you need to specify format as "json" - let item = git_client - .items_client() - .get(&organization, &repository_name, &file_path, &project) - .format("json") - .await?; - - println!("\n{file_path} metadata:\n{:#?}", item); - - // If no format is specified, the file contents are returned - let rsp = git_client - .items_client() - .get(&organization, &repository_name, &file_path, &project) - .send() - .await? - .into_raw_response(); - - let file_data = rsp.into_body().collect_string().await?; - println!("\n{file_path} contents:\n{}", file_data); - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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"); + let repository_name = env::args() + .nth(1) + .expect("Usage: git_items_get "); + let file_path = env::args() + .nth(2) + .expect("Usage: git_items_get "); + + // Create a git client + let git_client = git::ClientBuilder::new(credential).build(); + + // To get the file metadata, it appears that you need to specify format as "json" + let item = git_client + .items_client() + .get(&organization, &repository_name, &file_path, &project) + .format("json") + .await?; + + println!("\n{file_path} metadata:\n{:#?}", item); + + // If no format is specified, the file contents are returned + let rsp = git_client + .items_client() + .get(&organization, &repository_name, &file_path, &project) + .send() + .await? + .into_raw_response(); + + let file_data = rsp.into_body().collect_string().await?; + println!("\n{file_path} contents:\n{}", file_data); + + Ok(()) } diff --git a/azure_devops_rust_api/examples/git_items_list.rs b/azure_devops_rust_api/examples/git_items_list.rs index a62b2a0a..dbd876fc 100644 --- a/azure_devops_rust_api/examples/git_items_list.rs +++ b/azure_devops_rust_api/examples/git_items_list.rs @@ -11,36 +11,36 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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"); - let repository_name = env::args() - .nth(1) - .expect("Usage: git_items_list "); - - // Create a git client - let git_client = git::ClientBuilder::new(credential).build(); - - // Get all items (files and folders) in the specified repository - let items = git_client - .items_client() - .list(organization, repository_name, project) - .recursion_level("Full") - .await? - .value; - - for item in items.iter() { - if let Some(path) = &item.item_model.path { - println!("{path}"); - } + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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"); + let repository_name = env::args() + .nth(1) + .expect("Usage: git_items_list "); + + // Create a git client + let git_client = git::ClientBuilder::new(credential).build(); + + // Get all items (files and folders) in the specified repository + let items = git_client + .items_client() + .list(organization, repository_name, project) + .recursion_level("Full") + .await? + .value; + + for item in items.iter() { + if let Some(path) = &item.item_model.path { + println!("{path}"); } - println!("{} items found", items.len()); + } + println!("{} items found", items.len()); - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/git_policy_config_list.rs b/azure_devops_rust_api/examples/git_policy_config_list.rs index 2fe46746..d4910574 100644 --- a/azure_devops_rust_api/examples/git_policy_config_list.rs +++ b/azure_devops_rust_api/examples/git_policy_config_list.rs @@ -11,39 +11,39 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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"); - let repo_name = env::args() - .nth(1) - .expect("Usage: git_items_list "); - - // Create a git client - let git_client = git::ClientBuilder::new(credential).build(); - - // Get the specified repo by name, as we need to obtain the repo ID. - let repo = git_client - .repositories_client() - .get_repository(&organization, &repo_name, &project) - .await?; - - // Get all policies configured on the specified repository. - // Many git repository APIs take either a repository ID or a repository name, - // but this particular API only accepts a repository ID. - let policies = git_client - .policy_configurations_client() - .get(organization, project) - .repository_id(repo.id) - .await? - .value; - - println!("Policies:\n{:#?}", policies); - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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"); + let repo_name = env::args() + .nth(1) + .expect("Usage: git_items_list "); + + // Create a git client + let git_client = git::ClientBuilder::new(credential).build(); + + // Get the specified repo by name, as we need to obtain the repo ID. + let repo = git_client + .repositories_client() + .get_repository(&organization, &repo_name, &project) + .await?; + + // Get all policies configured on the specified repository. + // Many git repository APIs take either a repository ID or a repository name, + // but this particular API only accepts a repository ID. + let policies = git_client + .policy_configurations_client() + .get(organization, project) + .repository_id(repo.id) + .await? + .value; + + println!("Policies:\n{:#?}", policies); + + Ok(()) } diff --git a/azure_devops_rust_api/examples/git_pr_commits.rs b/azure_devops_rust_api/examples/git_pr_commits.rs index 3638a5ef..e8d7a697 100644 --- a/azure_devops_rust_api/examples/git_pr_commits.rs +++ b/azure_devops_rust_api/examples/git_pr_commits.rs @@ -11,36 +11,36 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // Get ADO server configuration via environment variables - let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); - let repository_name = env::args() - .nth(1) - .expect("Usage: git_pr_commits "); - let pull_request_id: i32 = env::args() - .nth(2) - .expect("Usage: git_pr_commits ") - .parse() - .unwrap(); - let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT"); - // Set the max number of commits to get, default is 100 - let top_commits: i32 = 500; - - // Create a git client - let git_client = git::ClientBuilder::new(credential).build(); - - // Get Commits for the PR - let pr_commits = git_client - .pull_request_commits_client() - .get_pull_request_commits(&organization, &repository_name, pull_request_id, &project) - .top(top_commits) - .await?; - println!("{:#?}", pr_commits); - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // Get ADO server configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + let repository_name = env::args() + .nth(1) + .expect("Usage: git_pr_commits "); + let pull_request_id: i32 = env::args() + .nth(2) + .expect("Usage: git_pr_commits ") + .parse() + .unwrap(); + let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT"); + // Set the max number of commits to get, default is 100 + let top_commits: i32 = 500; + + // Create a git client + let git_client = git::ClientBuilder::new(credential).build(); + + // Get Commits for the PR + let pr_commits = git_client + .pull_request_commits_client() + .get_pull_request_commits(&organization, &repository_name, pull_request_id, &project) + .top(top_commits) + .await?; + println!("{:#?}", pr_commits); + + Ok(()) } diff --git a/azure_devops_rust_api/examples/git_pr_create.rs b/azure_devops_rust_api/examples/git_pr_create.rs index ce454fe3..5af6797f 100644 --- a/azure_devops_rust_api/examples/git_pr_create.rs +++ b/azure_devops_rust_api/examples/git_pr_create.rs @@ -12,51 +12,51 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - const USAGE: &str = - "Usage: git_pr_create <description>"; - - // 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"); - - let repo_name = env::args().nth(1).expect(USAGE); - let src_branch: String = env::args().nth(2).expect(USAGE); - let target_branch: String = env::args().nth(3).expect(USAGE); - let title: String = env::args().nth(4).expect(USAGE); - let description: String = env::args().nth(5).expect(USAGE); - - // Create a git client - let git_client = git::ClientBuilder::new(credential).build(); - - // Create GitPullRequestCreateOptions with all the mandatory parameters - println!("Create PR to merge {} => {}", src_branch, target_branch); - let mut pr_create_options = GitPullRequestCreateOptions::new( - // Need to specify full git refs path - format!("refs/heads/{src_branch}"), - format!("refs/heads/{target_branch}"), - title, - ); - - // Set any additional optional parameters - pr_create_options.description = Some(description); - // Label creation is unfortunately currently not very ergonomic... - pr_create_options.labels = vec![ - WebApiCreateTagRequestData::new("example_label1".to_string()), - WebApiCreateTagRequestData::new("example_label2".to_string()), - ]; - - // Define the new PR - let pr = git_client - .pull_requests_client() - .create(organization, repo_name, project, pr_create_options) - .await?; - println!("Created PR:\n{:#?}", pr); - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + const USAGE: &str = + "Usage: git_pr_create <repository-name> <src_branch> <target_branch> <title> <description>"; + + // 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"); + + let repo_name = env::args().nth(1).expect(USAGE); + let src_branch: String = env::args().nth(2).expect(USAGE); + let target_branch: String = env::args().nth(3).expect(USAGE); + let title: String = env::args().nth(4).expect(USAGE); + let description: String = env::args().nth(5).expect(USAGE); + + // Create a git client + let git_client = git::ClientBuilder::new(credential).build(); + + // Create GitPullRequestCreateOptions with all the mandatory parameters + println!("Create PR to merge {} => {}", src_branch, target_branch); + let mut pr_create_options = GitPullRequestCreateOptions::new( + // Need to specify full git refs path + format!("refs/heads/{src_branch}"), + format!("refs/heads/{target_branch}"), + title, + ); + + // Set any additional optional parameters + pr_create_options.description = Some(description); + // Label creation is unfortunately currently not very ergonomic... + pr_create_options.labels = vec![ + WebApiCreateTagRequestData::new("example_label1".to_string()), + WebApiCreateTagRequestData::new("example_label2".to_string()), + ]; + + // Define the new PR + let pr = git_client + .pull_requests_client() + .create(organization, repo_name, project, pr_create_options) + .await?; + println!("Created PR:\n{:#?}", pr); + + Ok(()) } diff --git a/azure_devops_rust_api/examples/git_pr_files_changed.rs b/azure_devops_rust_api/examples/git_pr_files_changed.rs index c6c93293..a5b1777f 100644 --- a/azure_devops_rust_api/examples/git_pr_files_changed.rs +++ b/azure_devops_rust_api/examples/git_pr_files_changed.rs @@ -12,76 +12,76 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // Get ADO server configuration via environment variables - let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); - let repository_name = env::args() - .nth(1) - .expect("Usage: git_pr_files_changed <repository-name> <pull_request_id>"); - let pull_request_id: i32 = env::args() - .nth(2) - .expect("Usage: git_pr_files_changed <repository-name> <pull_request_id>") - .parse() - .unwrap(); - let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT"); + // Get ADO server configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + let repository_name = env::args() + .nth(1) + .expect("Usage: git_pr_files_changed <repository-name> <pull_request_id>"); + let pull_request_id: i32 = env::args() + .nth(2) + .expect("Usage: git_pr_files_changed <repository-name> <pull_request_id>") + .parse() + .unwrap(); + let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT"); - // Set the max number of commits to get, default is 100 - let top_commits: i32 = 500; + // Set the max number of commits to get, default is 100 + let top_commits: i32 = 500; - // Create a git client - let git_client = git::ClientBuilder::new(credential).build(); + // Create a git client + let git_client = git::ClientBuilder::new(credential).build(); - // Get Commits for the PR - let pr_commits = git_client - .pull_request_commits_client() - .get_pull_request_commits(&organization, &repository_name, pull_request_id, &project) - .top(top_commits) - .await? - .value; + // Get Commits for the PR + let pr_commits = git_client + .pull_request_commits_client() + .get_pull_request_commits(&organization, &repository_name, pull_request_id, &project) + .top(top_commits) + .await? + .value; - // Record unique filenames which are changed in the PR - let mut files_changed = HashSet::<String>::new(); + // Record unique filenames which are changed in the PR + let mut files_changed = HashSet::<String>::new(); - // Get each commit in the PR - println!("\nCommits:"); - for commit in pr_commits.iter() { - let commit_id = &commit.commit_id; - let comment = match &commit.comment { - Some(comment) => comment.clone(), - _ => "".to_string(), - }; - println!("{} {}", commit_id, comment); + // Get each commit in the PR + println!("\nCommits:"); + for commit in pr_commits.iter() { + let commit_id = &commit.commit_id; + let comment = match &commit.comment { + Some(comment) => comment.clone(), + _ => "".to_string(), + }; + println!("{} {}", commit_id, comment); - // Get the commit changes in a commit - let pr_commits_changes = git_client - .commits_client() - .get_changes(&organization, commit_id, &repository_name, &project) - .await? - .changes; + // Get the commit changes in a commit + let pr_commits_changes = git_client + .commits_client() + .get_changes(&organization, commit_id, &repository_name, &project) + .await? + .changes; - // Get files changed in the commit - for change in pr_commits_changes.iter() { - let item = &change.change.item; - match (item["gitObjectType"].as_str(), item["path"].as_str()) { - // We are only interested in files not directories. - // files are "blob" type, directories are "folder" type. - (Some("blob"), Some(filename)) => { - files_changed.insert(filename.to_string()); - } - _ => {} - } + // Get files changed in the commit + for change in pr_commits_changes.iter() { + let item = &change.change.item; + match (item["gitObjectType"].as_str(), item["path"].as_str()) { + // We are only interested in files not directories. + // files are "blob" type, directories are "folder" type. + (Some("blob"), Some(filename)) => { + files_changed.insert(filename.to_string()); } + _ => {} + } } - println!("\nChanged files:"); - // Unique files changed in the PR - for filename in files_changed.iter() { - println!("{}", filename) - } + } + println!("\nChanged files:"); + // Unique files changed in the PR + for filename in files_changed.iter() { + println!("{}", filename) + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/git_pr_work_items.rs b/azure_devops_rust_api/examples/git_pr_work_items.rs index fd5630ab..ec23f4ef 100644 --- a/azure_devops_rust_api/examples/git_pr_work_items.rs +++ b/azure_devops_rust_api/examples/git_pr_work_items.rs @@ -11,35 +11,35 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // Get ADO server configuration via environment variables - let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); - let repository_name = env::args() - .nth(1) - .expect("Usage: git_pr_work_items <repository-name> <pull_request_id>"); - let pull_request_id: i32 = env::args() - .nth(2) - .expect("Usage: git_pr_work_items <repository-name> <pull_request_id>") - .parse() - .unwrap(); - let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT"); - - // Create a "git" client - let git_client = git::ClientBuilder::new(credential).build(); - - // Get work item(s) associated with PR - let pr_work_items = git_client - .pull_request_work_items_client() - .list(&organization, &repository_name, pull_request_id, &project) - .await?; - - println!("PR work items:"); - println!("{:#?}", pr_work_items); - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // Get ADO server configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + let repository_name = env::args() + .nth(1) + .expect("Usage: git_pr_work_items <repository-name> <pull_request_id>"); + let pull_request_id: i32 = env::args() + .nth(2) + .expect("Usage: git_pr_work_items <repository-name> <pull_request_id>") + .parse() + .unwrap(); + let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT"); + + // Create a "git" client + let git_client = git::ClientBuilder::new(credential).build(); + + // Get work item(s) associated with PR + let pr_work_items = git_client + .pull_request_work_items_client() + .list(&organization, &repository_name, pull_request_id, &project) + .await?; + + println!("PR work items:"); + println!("{:#?}", pr_work_items); + + Ok(()) } diff --git a/azure_devops_rust_api/examples/git_repo_get.rs b/azure_devops_rust_api/examples/git_repo_get.rs index c16a0572..ced3015d 100644 --- a/azure_devops_rust_api/examples/git_repo_get.rs +++ b/azure_devops_rust_api/examples/git_repo_get.rs @@ -11,64 +11,64 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); - let repo_name = env::args() - .nth(1) - .expect("Usage: git_repo_get <repository-name>"); + // 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"); + let repo_name = env::args() + .nth(1) + .expect("Usage: git_repo_get <repository-name>"); - // Create a "git" client - let git_client = git::ClientBuilder::new(credential).build(); + // Create a "git" client + let git_client = git::ClientBuilder::new(credential).build(); - // Get the specified repo - let repo = git_client - .repositories_client() - .get_repository(&organization, &repo_name, &project) - .await?; - println!("{:#?}", repo); + // Get the specified repo + let repo = git_client + .repositories_client() + .get_repository(&organization, &repo_name, &project) + .await?; + println!("{:#?}", repo); - // Get up to 10 pull requests on the specified repo - let prs = git_client - .pull_requests_client() - .get_pull_requests(&organization, &repo.id, &project) - .top(10) - .await? - .value; + // Get up to 10 pull requests on the specified repo + let prs = git_client + .pull_requests_client() + .get_pull_requests(&organization, &repo.id, &project) + .top(10) + .await? + .value; - println!("\nFound {} pull requests", prs.len()); - for pr in &prs { - println!("{:<8}{}", pr.pull_request_id, pr.title.as_ref().unwrap()); - } + println!("\nFound {} pull requests", prs.len()); + for pr in &prs { + println!("{:<8}{}", pr.pull_request_id, pr.title.as_ref().unwrap()); + } - if let Some(pr) = prs.iter().next() { - println!("\nExample PR struct:"); - println!("{:#?}", pr); - } + if let Some(pr) = prs.iter().next() { + println!("\nExample PR struct:"); + println!("{:#?}", pr); + } - // Get up to 10 refs on the specified repo - let git_refs = git_client - .refs_client() - .list(&organization, &repo.id, &project) - .top(10) - .await? - .value; + // Get up to 10 refs on the specified repo + let git_refs = git_client + .refs_client() + .list(&organization, &repo.id, &project) + .top(10) + .await? + .value; - println!("\nGot {} refs", git_refs.len()); - for git_ref in &git_refs { - println!("{:<50}{}", git_ref.name, git_ref.object_id); - } + println!("\nGot {} refs", git_refs.len()); + for git_ref in &git_refs { + println!("{:<50}{}", git_ref.name, git_ref.object_id); + } - if let Some(git_ref) = git_refs.iter().next() { - println!("\nExample ref struct:"); - println!("{:#?}", git_ref); - } + if let Some(git_ref) = git_refs.iter().next() { + println!("\nExample ref struct:"); + println!("{:#?}", git_ref); + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/git_repo_get_raw_rsp.rs b/azure_devops_rust_api/examples/git_repo_get_raw_rsp.rs index 04bc8d22..70e439d0 100644 --- a/azure_devops_rust_api/examples/git_repo_get_raw_rsp.rs +++ b/azure_devops_rust_api/examples/git_repo_get_raw_rsp.rs @@ -12,34 +12,34 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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"); - let repo_name = env::args() - .nth(1) - .expect("Usage: git_repo_get_raw <repository-name>"); - - // Create a "git" client - let git_client = git::ClientBuilder::new(credential).build(); - - // Invoke the operation via `send()` rather than `into_future()` to get a raw response - let rsp = git_client - .repositories_client() - .get_repository(&organization, &repo_name, &project) - .send() - .await? - .into_raw_response(); - - // Display the raw response details - println!("status: {:#?}", rsp.status()); - println!("headers:\n{:#?}", rsp.headers()); - println!("body:\n{:#?}", rsp.into_body().collect_string().await?); - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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"); + let repo_name = env::args() + .nth(1) + .expect("Usage: git_repo_get_raw <repository-name>"); + + // Create a "git" client + let git_client = git::ClientBuilder::new(credential).build(); + + // Invoke the operation via `send()` rather than `into_future()` to get a raw response + let rsp = git_client + .repositories_client() + .get_repository(&organization, &repo_name, &project) + .send() + .await? + .into_raw_response(); + + // Display the raw response details + println!("status: {:#?}", rsp.status()); + println!("headers:\n{:#?}", rsp.headers()); + println!("body:\n{:#?}", rsp.into_body().collect_string().await?); + + Ok(()) } diff --git a/azure_devops_rust_api/examples/git_repo_list.rs b/azure_devops_rust_api/examples/git_repo_list.rs index d82e4c75..65a143ad 100644 --- a/azure_devops_rust_api/examples/git_repo_list.rs +++ b/azure_devops_rust_api/examples/git_repo_list.rs @@ -11,30 +11,30 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); + // 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 git client - let git_client = git::ClientBuilder::new(credential).build(); + // Create a git client + let git_client = git::ClientBuilder::new(credential).build(); - // Get all repositories in the specified organization/project - let repos = git_client - .repositories_client() - .list(organization, project) - .await? - .value; + // Get all repositories in the specified organization/project + let repos = git_client + .repositories_client() + .list(organization, project) + .await? + .value; - for repo in repos.iter() { - println!("{}", repo.name); - } - println!("{} repos found", repos.len()); + for repo in repos.iter() { + println!("{}", repo.name); + } + println!("{} repos found", repos.len()); - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/graph_query.rs b/azure_devops_rust_api/examples/graph_query.rs index 0f764557..0a23e8a7 100644 --- a/azure_devops_rust_api/examples/graph_query.rs +++ b/azure_devops_rust_api/examples/graph_query.rs @@ -12,37 +12,37 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // Get ADO configuration via environment variables - let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); - let name = env::args().nth(1).expect("Usage: graph_query <name>"); - - // Create a "graph" client - let graph_client = graph::ClientBuilder::new(credential).build(); - - // Create a query for a user with the specified name - let query = GraphSubjectQuery { - query: Some(name.to_string()), - scope_descriptor: None, - subject_kind: vec!["User".to_string()], - }; - - // Query the specified user - let subjects = graph_client - .subject_query_client() - .query(&organization, query) - .await? - .value; - - println!("Found {} subjects", subjects.len()); - if let Some(subject) = subjects.iter().next() { - println!("subject: {:#?}", subject); - } - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // Get ADO configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + let name = env::args().nth(1).expect("Usage: graph_query <name>"); + + // Create a "graph" client + let graph_client = graph::ClientBuilder::new(credential).build(); + + // Create a query for a user with the specified name + let query = GraphSubjectQuery { + query: Some(name.to_string()), + scope_descriptor: None, + subject_kind: vec!["User".to_string()], + }; + + // Query the specified user + let subjects = graph_client + .subject_query_client() + .query(&organization, query) + .await? + .value; + + println!("Found {} subjects", subjects.len()); + if let Some(subject) = subjects.iter().next() { + println!("subject: {:#?}", subject); + } + + Ok(()) } diff --git a/azure_devops_rust_api/examples/hooks_list.rs b/azure_devops_rust_api/examples/hooks_list.rs index 684990b3..8abb7103 100644 --- a/azure_devops_rust_api/examples/hooks_list.rs +++ b/azure_devops_rust_api/examples/hooks_list.rs @@ -10,43 +10,43 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // Get ADO server configuration via environment variables - let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); - // Create service hook client - let hook_client = hooks::ClientBuilder::new(credential).build(); - - // Get all consumers - println!("The service hook consumers are:"); - let service_hook_consumers = hook_client - .consumers_client() - .list(&organization) - .await? - .value; - println!("{:#?}", service_hook_consumers); - - // Get all publishers - println!("The service hook publishers are:"); - let service_hook_publishers = hook_client - .publishers_client() - .list(&organization) - .await? - .value; - println!("{:#?}", service_hook_publishers); - - // Get all subscriptions - println!("The service hook subscriptions are:"); - let service_hook_subscriptions = hook_client - .subscriptions_client() - .list(&organization) - .await? - .value; - println!("{:#?}", service_hook_subscriptions); - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // Get ADO server configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + // Create service hook client + let hook_client = hooks::ClientBuilder::new(credential).build(); + + // Get all consumers + println!("The service hook consumers are:"); + let service_hook_consumers = hook_client + .consumers_client() + .list(&organization) + .await? + .value; + println!("{:#?}", service_hook_consumers); + + // Get all publishers + println!("The service hook publishers are:"); + let service_hook_publishers = hook_client + .publishers_client() + .list(&organization) + .await? + .value; + println!("{:#?}", service_hook_publishers); + + // Get all subscriptions + println!("The service hook subscriptions are:"); + let service_hook_subscriptions = hook_client + .subscriptions_client() + .list(&organization) + .await? + .value; + println!("{:#?}", service_hook_subscriptions); + + Ok(()) } diff --git a/azure_devops_rust_api/examples/ims_query.rs b/azure_devops_rust_api/examples/ims_query.rs index c4951cde..88304eab 100644 --- a/azure_devops_rust_api/examples/ims_query.rs +++ b/azure_devops_rust_api/examples/ims_query.rs @@ -11,40 +11,40 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // Get ADO configuration via environment variables - let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); - let user_email = env::args() - .nth(1) - .expect("Usage: identity_query <email_address>"); - - // Create an "ims" client - let ims_client = ims::ClientBuilder::new(credential).build(); - - // Query the specified user - let identities = ims_client - .identities_client() - .read_identities(organization) - .search_filter("General") - .filter_value(&user_email) - .await? - .value; - - println!("Found {} identities", identities.len()); - for identity in &identities { - if let Some(id) = &identity.identity_base.id { - println!("{id} {user_email}"); - } + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // Get ADO configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + let user_email = env::args() + .nth(1) + .expect("Usage: identity_query <email_address>"); + + // Create an "ims" client + let ims_client = ims::ClientBuilder::new(credential).build(); + + // Query the specified user + let identities = ims_client + .identities_client() + .read_identities(organization) + .search_filter("General") + .filter_value(&user_email) + .await? + .value; + + println!("Found {} identities", identities.len()); + for identity in &identities { + if let Some(id) = &identity.identity_base.id { + println!("{id} {user_email}"); } + } - if let Some(identity) = identities.iter().next() { - println!("{:#?}", identity); - } + if let Some(identity) = identities.iter().next() { + println!("{:#?}", identity); + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/member_entitlement_management.rs b/azure_devops_rust_api/examples/member_entitlement_management.rs index 8dbf686f..0167f139 100644 --- a/azure_devops_rust_api/examples/member_entitlement_management.rs +++ b/azure_devops_rust_api/examples/member_entitlement_management.rs @@ -10,26 +10,26 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // Get ADO server configuration via environment variables - let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + // Get ADO server configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); - // Create member_entitlement_management client - let mem_client = member_entitlement_management::ClientBuilder::new(credential).build(); + // Create member_entitlement_management client + let mem_client = member_entitlement_management::ClientBuilder::new(credential).build(); - // Get entitlement summary - println!("Entitlement summary:"); - let entitlement_summary = mem_client - .user_entitlement_summary_client() - .get(organization) - .select("AccessLevels,Licenses,Projects,Groups") - .await?; - println!("{:#?}", entitlement_summary); + // Get entitlement summary + println!("Entitlement summary:"); + let entitlement_summary = mem_client + .user_entitlement_summary_client() + .get(organization) + .select("AccessLevels,Licenses,Projects,Groups") + .await?; + println!("{:#?}", entitlement_summary); - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/permissions_report.rs b/azure_devops_rust_api/examples/permissions_report.rs index 569c8dd4..71813d1f 100644 --- a/azure_devops_rust_api/examples/permissions_report.rs +++ b/azure_devops_rust_api/examples/permissions_report.rs @@ -10,26 +10,26 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // Get ADO server configuration via environment variables - let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + // Get ADO server configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); - // Create permissions_report client - let permissions_report_client = permissions_report::ClientBuilder::new(credential).build(); + // Create permissions_report client + let permissions_report_client = permissions_report::ClientBuilder::new(credential).build(); - // Get Permissions reports - println!("Permissions reports:"); - let permissions_reports = permissions_report_client - .permissions_report_client() - .list(&organization) - .await? - .value; - println!("{:#?}", permissions_reports); + // Get Permissions reports + println!("Permissions reports:"); + let permissions_reports = permissions_report_client + .permissions_report_client() + .list(&organization) + .await? + .value; + println!("{:#?}", permissions_reports); - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/pipeline_preview.rs b/azure_devops_rust_api/examples/pipeline_preview.rs index 332bb8df..2099598b 100644 --- a/azure_devops_rust_api/examples/pipeline_preview.rs +++ b/azure_devops_rust_api/examples/pipeline_preview.rs @@ -12,61 +12,61 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); - let pipeline_name = env::args().nth(1).expect("Usage: pipeline_preview <name>"); + // 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"); + let pipeline_name = env::args().nth(1).expect("Usage: pipeline_preview <name>"); - // Create a pipelines client - let pipelines_client = pipelines::ClientBuilder::new(credential).build(); + // Create a pipelines client + let pipelines_client = pipelines::ClientBuilder::new(credential).build(); - // List all pipelines in the specified organization/project - let pipelines = pipelines_client - .pipelines_client() - .list(&organization, &project) - .await? - .value; - println!("Total pipelines: {}", pipelines.len()); + // List all pipelines in the specified organization/project + let pipelines = pipelines_client + .pipelines_client() + .list(&organization, &project) + .await? + .value; + println!("Total pipelines: {}", pipelines.len()); - // Filter the pipelines to just those that contain the specified name - println!("\nMatched pipelines:"); - let matched_pipelines: Vec<Pipeline> = pipelines - .iter() - .filter(|pipeline| pipeline.name.contains(&pipeline_name)) - .cloned() - .collect(); + // Filter the pipelines to just those that contain the specified name + println!("\nMatched pipelines:"); + let matched_pipelines: Vec<Pipeline> = pipelines + .iter() + .filter(|pipeline| pipeline.name.contains(&pipeline_name)) + .cloned() + .collect(); - if let Some(pipeline) = matched_pipelines.iter().next() { - // Demonstrate how to query a preview of pipeline YAML... - // Define the pipeline params - let run_pipeline_params = RunPipelineParameters { - preview_run: Some(true), - resources: None, - stages_to_skip: vec![], - template_parameters: None, - variables: None, - yaml_override: None, - }; + if let Some(pipeline) = matched_pipelines.iter().next() { + // Demonstrate how to query a preview of pipeline YAML... + // Define the pipeline params + let run_pipeline_params = RunPipelineParameters { + preview_run: Some(true), + resources: None, + stages_to_skip: vec![], + template_parameters: None, + variables: None, + yaml_override: None, + }; - // Create a preview client - let preview_client = pipelines_client.preview_client(); + // Create a preview client + let preview_client = pipelines_client.preview_client(); - // Request a preview of the specified pipeline - let preview = preview_client - .preview(&organization, run_pipeline_params, &project, pipeline.id) - .await?; + // Request a preview of the specified pipeline + let preview = preview_client + .preview(&organization, run_pipeline_params, &project, pipeline.id) + .await?; - // Display the full pipeline YAML - if let Some(final_yaml) = preview.final_yaml { - println!("Pipeline preview:\n{}", final_yaml); - } + // Display the full pipeline YAML + if let Some(final_yaml) = preview.final_yaml { + println!("Pipeline preview:\n{}", final_yaml); } + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/pipelines.rs b/azure_devops_rust_api/examples/pipelines.rs index 94f5db47..62e05c2d 100644 --- a/azure_devops_rust_api/examples/pipelines.rs +++ b/azure_devops_rust_api/examples/pipelines.rs @@ -12,76 +12,76 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); - let pipeline_name = env::args().nth(1).expect("Usage: pipelines <name>"); + // 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"); + let pipeline_name = env::args().nth(1).expect("Usage: pipelines <name>"); - // Create a pipelines client - let pipelines_client = pipelines::ClientBuilder::new(credential).build(); + // Create a pipelines client + let pipelines_client = pipelines::ClientBuilder::new(credential).build(); - // List all pipelines in the specified organization/project - let pipelines = pipelines_client - .pipelines_client() - .list(&organization, &project) - .await? - .value; - println!("Total pipelines: {}", pipelines.len()); + // List all pipelines in the specified organization/project + let pipelines = pipelines_client + .pipelines_client() + .list(&organization, &project) + .await? + .value; + println!("Total pipelines: {}", pipelines.len()); - // Filter the pipelines to just those that contain the specified name - println!("\nMatched pipelines:"); - let matched_pipelines: Vec<Pipeline> = pipelines - .iter() - .filter(|pipeline| pipeline.name.contains(&pipeline_name)) - .cloned() - .collect(); + // Filter the pipelines to just those that contain the specified name + println!("\nMatched pipelines:"); + let matched_pipelines: Vec<Pipeline> = pipelines + .iter() + .filter(|pipeline| pipeline.name.contains(&pipeline_name)) + .cloned() + .collect(); - for pipeline in matched_pipelines.iter() { - println!("{:4} {}", pipeline.id, pipeline.name); - } + for pipeline in matched_pipelines.iter() { + println!("{:4} {}", pipeline.id, pipeline.name); + } - if let Some(pipeline) = matched_pipelines.iter().next() { - println!("\nExample pipeline struct from list:"); - println!("{:#?}", pipeline); + if let Some(pipeline) = matched_pipelines.iter().next() { + println!("\nExample pipeline struct from list:"); + println!("{:#?}", pipeline); - // The pipeline struct returned from list is different from that returned by get. - // Query and display the struct returned by get for comparison. - let pipeline = pipelines_client - .pipelines_client() - .get(&organization, &project, pipeline.id) - .await?; - println!("\nExample pipeline struct from get:"); - println!("{:#?}", pipeline); + // The pipeline struct returned from list is different from that returned by get. + // Query and display the struct returned by get for comparison. + let pipeline = pipelines_client + .pipelines_client() + .get(&organization, &project, pipeline.id) + .await?; + println!("\nExample pipeline struct from get:"); + println!("{:#?}", pipeline); - // Use the client to list all runs of the selected pipeline - let runs = pipelines_client - .runs_client() - .list(&organization, &project, pipeline.id) - .await? - .value; + // Use the client to list all runs of the selected pipeline + let runs = pipelines_client + .runs_client() + .list(&organization, &project, pipeline.id) + .await? + .value; - println!("\nPipeline runs: {}", runs.len()); - // Display [result, state] for each pipeline run - for run in runs.iter() { - let result = match &run.result { - Some(result) => format!("{:?}", result), - None => "-".to_string(), - }; - println!( - "{:8} {:16} {:16} {:14}", - run.run_reference.id, - run.run_reference.name, - result, - format!("{:?}", run.state) - ); - } + println!("\nPipeline runs: {}", runs.len()); + // Display [result, state] for each pipeline run + for run in runs.iter() { + let result = match &run.result { + Some(result) => format!("{:?}", result), + None => "-".to_string(), + }; + println!( + "{:8} {:16} {:16} {:14}", + run.run_reference.id, + run.run_reference.name, + result, + format!("{:?}", run.state) + ); } + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/policy.rs b/azure_devops_rust_api/examples/policy.rs index ca4ba63c..1929e561 100644 --- a/azure_devops_rust_api/examples/policy.rs +++ b/azure_devops_rust_api/examples/policy.rs @@ -11,61 +11,61 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); + // 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 policy client - let policy_client = policy::ClientBuilder::new(credential).build(); + // Create a policy client + let policy_client = policy::ClientBuilder::new(credential).build(); - // Get all policy configurations in the specified organization/project - let policy_types = policy_client - .types_client() - .list(&organization, &project) - .await? - .value; + // Get all policy configurations in the specified organization/project + let policy_types = policy_client + .types_client() + .list(&organization, &project) + .await? + .value; - for policy_type in policy_types.iter() { - let type_ref = &policy_type.policy_type_ref; - println!( - "{} {:32} {}", - type_ref.id, type_ref.display_name, policy_type.description - ); - } - println!("{} policy types found", policy_types.len()); - - let work_item_linking_policy_id = policy_types - .iter() - .find_map(|pt| { - if pt.policy_type_ref.display_name == "Work item linking" { - Some(pt.policy_type_ref.id.clone()) - } else { - None - } - }) - .unwrap(); + for policy_type in policy_types.iter() { + let type_ref = &policy_type.policy_type_ref; println!( - "Work item linking policy id: {}", - work_item_linking_policy_id + "{} {:32} {}", + type_ref.id, type_ref.display_name, policy_type.description ); + } + println!("{} policy types found", policy_types.len()); + + let work_item_linking_policy_id = policy_types + .iter() + .find_map(|pt| { + if pt.policy_type_ref.display_name == "Work item linking" { + Some(pt.policy_type_ref.id.clone()) + } else { + None + } + }) + .unwrap(); + println!( + "Work item linking policy id: {}", + work_item_linking_policy_id + ); - let configs = policy_client - .configurations_client() - .list(&organization, &project) - .policy_type(work_item_linking_policy_id) - .await? - .value; - println!("{} work item policy configurations found", configs.len()); + let configs = policy_client + .configurations_client() + .list(&organization, &project) + .policy_type(work_item_linking_policy_id) + .await? + .value; + println!("{} work item policy configurations found", configs.len()); - if let Some(config) = configs.iter().next() { - println!("Example config:\n{:#?}", config); - } + if let Some(config) = configs.iter().next() { + println!("Example config:\n{:#?}", config); + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/release.rs b/azure_devops_rust_api/examples/release.rs index fd78b73b..a3ac7d59 100644 --- a/azure_devops_rust_api/examples/release.rs +++ b/azure_devops_rust_api/examples/release.rs @@ -10,55 +10,55 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); + // 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 release client - let release_client = release::ClientBuilder::new(credential).build(); - let folder_path = r#"\"#.to_string(); + // Create release client + let release_client = release::ClientBuilder::new(credential).build(); + let folder_path = r#"\"#.to_string(); - // Get list of approvals - println!("Approvals:"); - let approvals = release_client - .approvals_client() - .list(&organization, &project) - .await? - .value; - println!("{:#?}", approvals); + // Get list of approvals + println!("Approvals:"); + let approvals = release_client + .approvals_client() + .list(&organization, &project) + .await? + .value; + println!("{:#?}", approvals); - // Get list of folders - println!("\nFolders:"); - let folders = release_client - .folders_client() - .list(&organization, &project, &folder_path) - .await? - .value; - println!("{:#?}", folders); + // Get list of folders + println!("\nFolders:"); + let folders = release_client + .folders_client() + .list(&organization, &project, &folder_path) + .await? + .value; + println!("{:#?}", folders); - // Get list of deployments - println!("\nDeployments:"); - let deployments = release_client - .deployments_client() - .list(&organization, &project) - .await? - .value; - println!("{:#?}", deployments); + // Get list of deployments + println!("\nDeployments:"); + let deployments = release_client + .deployments_client() + .list(&organization, &project) + .await? + .value; + println!("{:#?}", deployments); - // Get a list of releases - println!("\nReleases:"); - let releases = release_client - .releases_client() - .list(&organization, &project) - .await? - .value; - println!("{:#?}", releases); + // Get a list of releases + println!("\nReleases:"); + let releases = release_client + .releases_client() + .list(&organization, &project) + .await? + .value; + println!("{:#?}", releases); - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/release_get_release.rs b/azure_devops_rust_api/examples/release_get_release.rs index d5c186fc..c6f58818 100644 --- a/azure_devops_rust_api/examples/release_get_release.rs +++ b/azure_devops_rust_api/examples/release_get_release.rs @@ -10,42 +10,42 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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 release client - let release_client = release::ClientBuilder::new(credential).build(); - - // Get the release ID from user - let release_id: i32 = env::args() - .nth(1) - .expect("Usage: release_get_specific_release <release_id>") - .parse() - .unwrap(); - - // Query a specific release - println!("\nRelease:"); - let release = release_client - .releases_client() - .get_release(&organization, &project, release_id) - .await?; - println!("{:#?}", release); - - // Get manual interventions on a release - println!("\nManual interventions:"); - let manual_interventions = release_client - .manual_interventions_client() - .list(&organization, &project, release_id) - .await? - .value; - println!("{:#?}", manual_interventions); - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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 release client + let release_client = release::ClientBuilder::new(credential).build(); + + // Get the release ID from user + let release_id: i32 = env::args() + .nth(1) + .expect("Usage: release_get_specific_release <release_id>") + .parse() + .unwrap(); + + // Query a specific release + println!("\nRelease:"); + let release = release_client + .releases_client() + .get_release(&organization, &project, release_id) + .await?; + println!("{:#?}", release); + + // Get manual interventions on a release + println!("\nManual interventions:"); + let manual_interventions = release_client + .manual_interventions_client() + .list(&organization, &project, release_id) + .await? + .value; + println!("{:#?}", manual_interventions); + + Ok(()) } diff --git a/azure_devops_rust_api/examples/release_logs.rs b/azure_devops_rust_api/examples/release_logs.rs index 215f4cc9..fd84b222 100644 --- a/azure_devops_rust_api/examples/release_logs.rs +++ b/azure_devops_rust_api/examples/release_logs.rs @@ -13,51 +13,51 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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"); - let release_id: i32 = env::args() - .nth(1) - .expect("Usage: release-logs <release-id> <output-file>") - .parse::<i32>() - .ok() - .expect("Must Provide release ID"); - let output_file: String = env::args() - .nth(2) - .expect("Usage: release-logs <release-id> <output-file>"); - - // Create release client - let release_client = release::ClientBuilder::new(credential).build(); - - // Get release logs - println!("\nDownloading release logs for release {}", release_id); - let (status, _headers, body) = release_client - .releases_client() - .get_logs(organization, project, release_id) - .send() - .await? - .into_raw_response() - .deconstruct(); - - if status != azure_core::StatusCode::Ok { - println!("Request failed. status:{}", status); - return Err(anyhow!("Request failed")); - } - - // Write the data as a zipfile - println!("Writing data to zipfile: {}", output_file); - let data = body.collect().await?; - let mut file = File::create(&output_file)?; - file.write_all(&data)?; - println!("Logs saved"); - - println!("Use 'unzip {}' to extract the logs", output_file); - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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"); + let release_id: i32 = env::args() + .nth(1) + .expect("Usage: release-logs <release-id> <output-file>") + .parse::<i32>() + .ok() + .expect("Must Provide release ID"); + let output_file: String = env::args() + .nth(2) + .expect("Usage: release-logs <release-id> <output-file>"); + + // Create release client + let release_client = release::ClientBuilder::new(credential).build(); + + // Get release logs + println!("\nDownloading release logs for release {}", release_id); + let (status, _headers, body) = release_client + .releases_client() + .get_logs(organization, project, release_id) + .send() + .await? + .into_raw_response() + .deconstruct(); + + if status != azure_core::StatusCode::Ok { + println!("Request failed. status:{}", status); + return Err(anyhow!("Request failed")); + } + + // Write the data as a zipfile + println!("Writing data to zipfile: {}", output_file); + let data = body.collect().await?; + let mut file = File::create(&output_file)?; + file.write_all(&data)?; + println!("Logs saved"); + + println!("Use 'unzip {}' to extract the logs", output_file); + + Ok(()) } diff --git a/azure_devops_rust_api/examples/search_code.rs b/azure_devops_rust_api/examples/search_code.rs index 56e5e2d0..f9d8e929 100644 --- a/azure_devops_rust_api/examples/search_code.rs +++ b/azure_devops_rust_api/examples/search_code.rs @@ -6,7 +6,7 @@ use anyhow::Result; use azure_devops_rust_api::search; use azure_devops_rust_api::search::models::{ - CodeSearchRequest, EntitySearchRequest, EntitySearchRequestBase, + CodeSearchRequest, EntitySearchRequest, EntitySearchRequestBase, }; use std::env; @@ -14,48 +14,48 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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 search client - println!("Create search client"); - let search_client = search::ClientBuilder::new(credential).build(); - - let entity_search_request_base = EntitySearchRequestBase { - filters: None, - search_text: Some("file:Cargo.toml futures".to_string()), - }; - - let entity_search_request = EntitySearchRequest { - entity_search_request_base, - top: Some(10), // Must specify `top`, otherwise search fails - ..Default::default() - }; - - let code_search_request = CodeSearchRequest { - entity_search_request, - include_snippet: Some(true), - }; - - // Do the search - println!("Search..."); - let search_results = search_client - .code_search_results_client() - .fetch_code_search_results(organization, code_search_request, project) - .await? - .results; - - println!("Found {} results", search_results.len()); - if let Some(result) = search_results.iter().next() { - println!("Example search result:\n{:#?}", result); - } - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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 search client + println!("Create search client"); + let search_client = search::ClientBuilder::new(credential).build(); + + let entity_search_request_base = EntitySearchRequestBase { + filters: None, + search_text: Some("file:Cargo.toml futures".to_string()), + }; + + let entity_search_request = EntitySearchRequest { + entity_search_request_base, + top: Some(10), // Must specify `top`, otherwise search fails + ..Default::default() + }; + + let code_search_request = CodeSearchRequest { + entity_search_request, + include_snippet: Some(true), + }; + + // Do the search + println!("Search..."); + let search_results = search_client + .code_search_results_client() + .fetch_code_search_results(organization, code_search_request, project) + .await? + .results; + + println!("Found {} results", search_results.len()); + if let Some(result) = search_results.iter().next() { + println!("Example search result:\n{:#?}", result); + } + + Ok(()) } diff --git a/azure_devops_rust_api/examples/search_package.rs b/azure_devops_rust_api/examples/search_package.rs index 52027dcb..1bcb6987 100644 --- a/azure_devops_rust_api/examples/search_package.rs +++ b/azure_devops_rust_api/examples/search_package.rs @@ -6,7 +6,7 @@ use anyhow::Result; use azure_devops_rust_api::search; use azure_devops_rust_api::search::models::{ - EntitySearchRequest, EntitySearchRequestBase, PackageSearchRequest, + EntitySearchRequest, EntitySearchRequestBase, PackageSearchRequest, }; use std::env; @@ -14,48 +14,48 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // Get ADO configuration via environment variables - let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); - let search_package_name = - env::var("PKG_NAME").expect("Must define a package name <PKG_NAME> to be searched"); - - // Create a search client - println!("Create search client"); - let search_client = search::ClientBuilder::new(credential).build(); - - let entity_search_request_base = EntitySearchRequestBase { - filters: None, - search_text: Some(search_package_name.to_string()), - }; - - let entity_search_request = EntitySearchRequest { - entity_search_request_base, - top: Some(10), // Must specify `top`, otherwise search fails - ..Default::default() - }; - - let package_search_request = PackageSearchRequest { - entity_search_request, - }; - - // Do the search - println!("Search..."); - let search_results = search_client - .package_search_results_client() - .fetch_package_search_results(organization, package_search_request) - .await? - .results; - - println!("Found {} results", search_results.len()); - if let Some(result) = search_results.iter().next() { - println!("Example search result:\n{:#?}", result); - } - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // Get ADO configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + let search_package_name = + env::var("PKG_NAME").expect("Must define a package name <PKG_NAME> to be searched"); + + // Create a search client + println!("Create search client"); + let search_client = search::ClientBuilder::new(credential).build(); + + let entity_search_request_base = EntitySearchRequestBase { + filters: None, + search_text: Some(search_package_name.to_string()), + }; + + let entity_search_request = EntitySearchRequest { + entity_search_request_base, + top: Some(10), // Must specify `top`, otherwise search fails + ..Default::default() + }; + + let package_search_request = PackageSearchRequest { + entity_search_request, + }; + + // Do the search + println!("Search..."); + let search_results = search_client + .package_search_results_client() + .fetch_package_search_results(organization, package_search_request) + .await? + .results; + + println!("Found {} results", search_results.len()); + if let Some(result) = search_results.iter().next() { + println!("Example search result:\n{:#?}", result); + } + + Ok(()) } diff --git a/azure_devops_rust_api/examples/search_repositories.rs b/azure_devops_rust_api/examples/search_repositories.rs index e6fe450f..5397fb12 100644 --- a/azure_devops_rust_api/examples/search_repositories.rs +++ b/azure_devops_rust_api/examples/search_repositories.rs @@ -11,31 +11,31 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); + // 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"); - let repository_name = env::args() - .nth(1) - .expect("Usage: Repo name to be searched <repository-name>"); + let repository_name = env::args() + .nth(1) + .expect("Usage: Repo name to be searched <repository-name>"); - // Create a search client - println!("Create search client"); - let search_client = search::ClientBuilder::new(credential).build(); + // Create a search client + println!("Create search client"); + let search_client = search::ClientBuilder::new(credential).build(); - // Do the search - println!("Search..."); - let search_results = search_client - .repositories_client() - .get(organization, project, repository_name) - .await?; + // Do the search + println!("Search..."); + let search_results = search_client + .repositories_client() + .get(organization, project, repository_name) + .await?; - println!("{:#?}", search_results); - Ok(()) + println!("{:#?}", search_results); + Ok(()) } diff --git a/azure_devops_rust_api/examples/search_work_item.rs b/azure_devops_rust_api/examples/search_work_item.rs index e001efbd..700d1047 100644 --- a/azure_devops_rust_api/examples/search_work_item.rs +++ b/azure_devops_rust_api/examples/search_work_item.rs @@ -6,7 +6,7 @@ use anyhow::Result; use azure_devops_rust_api::search; use azure_devops_rust_api::search::models::{ - EntitySearchRequest, EntitySearchRequestBase, WorkItemSearchRequest, + EntitySearchRequest, EntitySearchRequestBase, WorkItemSearchRequest, }; use std::env; @@ -14,50 +14,50 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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"); - let search_work_item_text = env::var("WORK_ITEM_SEARCH_TEXT") - .expect("Must define a text <PKG_NAME> to be searched for work item"); - - // Create a search client - println!("Create search client"); - let search_client = search::ClientBuilder::new(credential).build(); - - let entity_search_request_base = EntitySearchRequestBase { - filters: None, - search_text: Some(search_work_item_text.to_string()), - }; - - let entity_search_request = EntitySearchRequest { - entity_search_request_base, - top: Some(10), // Must specify `top`, otherwise search fails - ..Default::default() - }; - - // define body for the request - let work_item_search_request = WorkItemSearchRequest { - entity_search_request, - }; - - // Do the search - println!("Search..."); - let search_results = search_client - .work_item_search_results_client() - .fetch_work_item_search_results(organization, work_item_search_request, project) - .await? - .results; - - println!("Found {} results", search_results.len()); - if let Some(result) = search_results.iter().next() { - println!("Example search work item result:\n{:#?}", result); - } - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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"); + let search_work_item_text = env::var("WORK_ITEM_SEARCH_TEXT") + .expect("Must define a text <PKG_NAME> to be searched for work item"); + + // Create a search client + println!("Create search client"); + let search_client = search::ClientBuilder::new(credential).build(); + + let entity_search_request_base = EntitySearchRequestBase { + filters: None, + search_text: Some(search_work_item_text.to_string()), + }; + + let entity_search_request = EntitySearchRequest { + entity_search_request_base, + top: Some(10), // Must specify `top`, otherwise search fails + ..Default::default() + }; + + // define body for the request + let work_item_search_request = WorkItemSearchRequest { + entity_search_request, + }; + + // Do the search + println!("Search..."); + let search_results = search_client + .work_item_search_results_client() + .fetch_work_item_search_results(organization, work_item_search_request, project) + .await? + .results; + + println!("Found {} results", search_results.len()); + if let Some(result) = search_results.iter().next() { + println!("Example search work item result:\n{:#?}", result); + } + + Ok(()) } diff --git a/azure_devops_rust_api/examples/service_endpoint.rs b/azure_devops_rust_api/examples/service_endpoint.rs index 7a2c9585..1e6f0cf1 100644 --- a/azure_devops_rust_api/examples/service_endpoint.rs +++ b/azure_devops_rust_api/examples/service_endpoint.rs @@ -11,40 +11,40 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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 service_endpoint client - let service_endpoint_client = service_endpoint::ClientBuilder::new(credential).build(); - - // Use the client to list all service endpoints (aka "service connections") - let service_endpoints = service_endpoint_client - .endpoints_client() - .get_service_endpoints(&organization, &project) - .await? - .value; - println!("Total service_endpoints: {}", service_endpoints.len()); - - // Display the returned service endpoints - for endpoint in service_endpoints.iter() { - println!( - "{:38} {:40} {}", - endpoint.id, endpoint.name, endpoint.description - ); - } - - // Display an example service endpoint struct - if let Some(endpoint) = service_endpoints.iter().next() { - println!("\nExample service_endpoint struct:"); - println!("{:#?}", endpoint); - } - - Ok(()) + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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 service_endpoint client + let service_endpoint_client = service_endpoint::ClientBuilder::new(credential).build(); + + // Use the client to list all service endpoints (aka "service connections") + let service_endpoints = service_endpoint_client + .endpoints_client() + .get_service_endpoints(&organization, &project) + .await? + .value; + println!("Total service_endpoints: {}", service_endpoints.len()); + + // Display the returned service endpoints + for endpoint in service_endpoints.iter() { + println!( + "{:38} {:40} {}", + endpoint.id, endpoint.name, endpoint.description + ); + } + + // Display an example service endpoint struct + if let Some(endpoint) = service_endpoints.iter().next() { + println!("\nExample service_endpoint struct:"); + println!("{:#?}", endpoint); + } + + Ok(()) } diff --git a/azure_devops_rust_api/examples/status.rs b/azure_devops_rust_api/examples/status.rs index 6496ca19..3958c978 100644 --- a/azure_devops_rust_api/examples/status.rs +++ b/azure_devops_rust_api/examples/status.rs @@ -12,42 +12,42 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // The status API is unauthenticated, so don't provide usual credentials - let credential = Credential::unauthenticated(); - - // Create a status client - println!("Create status client"); - let status_client = status::ClientBuilder::new(credential).build(); - - // Get service status - println!("Get service status"); - let status = status_client.health_client().get().await?; - - println!( - "{:?}: {}", - status.status.status.health, status.status.status.message, - ); - - for service in status.services.iter() { - println!("{}:", service.id); - let (healthy, unhealthy): (Vec<_>, Vec<_>) = service - .geographies - .iter() - .partition(|health| health.health == Health::Healthy); - let healthy: Vec<&str> = healthy - .iter() - .map(|health| health.geography.id.as_ref()) - .collect(); - let unhealthy: Vec<&str> = unhealthy - .iter() - .map(|health| health.geography.id.as_ref()) - .collect(); - println!(" healthy: {}", healthy.join(" ")); - println!(" unhealthy: {}", unhealthy.join(" ")); - } - - Ok(()) + // Initialize logging + env_logger::init(); + + // The status API is unauthenticated, so don't provide usual credentials + let credential = Credential::unauthenticated(); + + // Create a status client + println!("Create status client"); + let status_client = status::ClientBuilder::new(credential).build(); + + // Get service status + println!("Get service status"); + let status = status_client.health_client().get().await?; + + println!( + "{:?}: {}", + status.status.status.health, status.status.status.message, + ); + + for service in status.services.iter() { + println!("{}:", service.id); + let (healthy, unhealthy): (Vec<_>, Vec<_>) = service + .geographies + .iter() + .partition(|health| health.health == Health::Healthy); + let healthy: Vec<&str> = healthy + .iter() + .map(|health| health.geography.id.as_ref()) + .collect(); + let unhealthy: Vec<&str> = unhealthy + .iter() + .map(|health| health.geography.id.as_ref()) + .collect(); + println!(" healthy: {}", healthy.join(" ")); + println!(" unhealthy: {}", unhealthy.join(" ")); + } + + Ok(()) } diff --git a/azure_devops_rust_api/examples/test_plan.rs b/azure_devops_rust_api/examples/test_plan.rs index 2ccb9c87..cedb19a5 100644 --- a/azure_devops_rust_api/examples/test_plan.rs +++ b/azure_devops_rust_api/examples/test_plan.rs @@ -11,57 +11,57 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); - let test_plan_id_value = env::var("TEST_PLAN_ID").expect("Must define PLAN_ID for the test"); - let test_plan_id: i32 = test_plan_id_value - .parse() - .expect("Failed to parse TEST_PLAN_ID"); - // Create test_plan client - let test_plan_client = test_plan::ClientBuilder::new(credential).build(); + // 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"); + let test_plan_id_value = env::var("TEST_PLAN_ID").expect("Must define PLAN_ID for the test"); + let test_plan_id: i32 = test_plan_id_value + .parse() + .expect("Failed to parse TEST_PLAN_ID"); + // Create test_plan client + let test_plan_client = test_plan::ClientBuilder::new(credential).build(); - // Get all test plans for project - println!("The test plan for project are:"); - let test_plans = test_plan_client - .test_plans_client() - .list(&organization, &project) - .await? - .value; - println!("{:#?}", test_plans); + // Get all test plans for project + println!("The test plan for project are:"); + let test_plans = test_plan_client + .test_plans_client() + .list(&organization, &project) + .await? + .value; + println!("{:#?}", test_plans); - // Get all suites for a test plan for a project - println!("The suites for the a plan for project are:"); - let test_suites = test_plan_client - .test_suites_client() - .get_test_suites_for_plan(&organization, &project, test_plan_id) - .await? - .value; - println!("{:#?}", test_suites); + // Get all suites for a test plan for a project + println!("The suites for the a plan for project are:"); + let test_suites = test_plan_client + .test_suites_client() + .get_test_suites_for_plan(&organization, &project, test_plan_id) + .await? + .value; + println!("{:#?}", test_suites); - // Get all test plan variables for project - println!("The test plans variables for project are:"); - let test_plan_variables = test_plan_client - .variables_client() - .list(&organization, &project) - .await? - .value; - println!("{:#?}", test_plan_variables); + // Get all test plan variables for project + println!("The test plans variables for project are:"); + let test_plan_variables = test_plan_client + .variables_client() + .list(&organization, &project) + .await? + .value; + println!("{:#?}", test_plan_variables); - // Get all test plan configuration for project - println!("The test plan configuration for project are:"); - let test_plan_configuration = test_plan_client - .configurations_client() - .list(&organization, &project) - .await? - .value; - println!("{:#?}", test_plan_configuration); + // Get all test plan configuration for project + println!("The test plan configuration for project are:"); + let test_plan_configuration = test_plan_client + .configurations_client() + .list(&organization, &project) + .await? + .value; + println!("{:#?}", test_plan_configuration); - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/test_runs_list.rs b/azure_devops_rust_api/examples/test_runs_list.rs index b637e3ce..209d1698 100644 --- a/azure_devops_rust_api/examples/test_runs_list.rs +++ b/azure_devops_rust_api/examples/test_runs_list.rs @@ -11,31 +11,31 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); + // 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"); - // Max number of runs for the project to be fetched - let top_test_runs: i32 = 200; + // Max number of runs for the project to be fetched + let top_test_runs: i32 = 200; - // Create test_run client - let test_run_client = test::ClientBuilder::new(credential).build(); + // Create test_run client + let test_run_client = test::ClientBuilder::new(credential).build(); - // Get all runs for project - println!("The test runs for project are:"); - let test_runs = test_run_client - .runs_client() - .list(&organization, &project) - .top(top_test_runs) - .await? - .value; - println!("{:#?}", test_runs); + // Get all runs for project + println!("The test runs for project are:"); + let test_runs = test_run_client + .runs_client() + .list(&organization, &project) + .top(top_test_runs) + .await? + .value; + println!("{:#?}", test_runs); - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/utils/mod.rs b/azure_devops_rust_api/examples/utils/mod.rs index 9ea2659a..bf2ba00c 100644 --- a/azure_devops_rust_api/examples/utils/mod.rs +++ b/azure_devops_rust_api/examples/utils/mod.rs @@ -6,37 +6,37 @@ use azure_identity::{AutoRefreshingTokenCredential, DefaultAzureCredentialBuilde use std::sync::Arc; fn authenticate_with_default_credential() -> Credential { - println!("Authenticate using auto-refereshing DefaultAzureCredential"); - // `DefaultAzureCredential` can authenticate using one of: - // - `EnvironmentCredential` - // - `ManagedIdentityCredential` - // - `AzureCliCredential` - // For examples we just want to use AzureCliCredential, so exclude the - // other mechanisms. - // It would be simpler to directly create `AzureCliCredential` here, but I want to - // demonstrate use of `DefaultAzureCredentialBuilder`. - let default_azure_credential = Arc::new( - DefaultAzureCredentialBuilder::new() - .exclude_environment_credential() - .exclude_managed_identity_credential() - .build(), - ); + println!("Authenticate using auto-refereshing DefaultAzureCredential"); + // `DefaultAzureCredential` can authenticate using one of: + // - `EnvironmentCredential` + // - `ManagedIdentityCredential` + // - `AzureCliCredential` + // For examples we just want to use AzureCliCredential, so exclude the + // other mechanisms. + // It would be simpler to directly create `AzureCliCredential` here, but I want to + // demonstrate use of `DefaultAzureCredentialBuilder`. + let default_azure_credential = Arc::new( + DefaultAzureCredentialBuilder::new() + .exclude_environment_credential() + .exclude_managed_identity_credential() + .build(), + ); - // Use the `AutoRefreshingTokenCredential` wrapper to cache the credentials, - // refreshing when required. - let auto_refreshing_credential = - Arc::new(AutoRefreshingTokenCredential::new(default_azure_credential)); - Credential::from_token_credential(auto_refreshing_credential) + // Use the `AutoRefreshingTokenCredential` wrapper to cache the credentials, + // refreshing when required. + let auto_refreshing_credential = + Arc::new(AutoRefreshingTokenCredential::new(default_azure_credential)); + Credential::from_token_credential(auto_refreshing_credential) } #[allow(dead_code)] pub fn get_credential() -> Credential { - // Get authentication credential either from a PAT ("ADO_TOKEN") or via the az cli - match std::env::var("ADO_TOKEN") { - Ok(token) if !token.is_empty() => { - println!("Authenticate using PAT provided via $ADO_TOKEN"); - Credential::from_pat(token) - } - _ => authenticate_with_default_credential(), + // Get authentication credential either from a PAT ("ADO_TOKEN") or via the az cli + match std::env::var("ADO_TOKEN") { + Ok(token) if !token.is_empty() => { + println!("Authenticate using PAT provided via $ADO_TOKEN"); + Credential::from_pat(token) } + _ => authenticate_with_default_credential(), + } } diff --git a/azure_devops_rust_api/examples/wiki_pages_create_or_update.rs b/azure_devops_rust_api/examples/wiki_pages_create_or_update.rs index 5927f232..560c7423 100644 --- a/azure_devops_rust_api/examples/wiki_pages_create_or_update.rs +++ b/azure_devops_rust_api/examples/wiki_pages_create_or_update.rs @@ -11,85 +11,85 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); - // Get wiki params based on arguments - let wiki_id = env::args() - .nth(1) - .expect("Usage: Wiki ID to create/update a page under <wiki-id>"); - let wiki_page_path = env::args() - .nth(2) - .expect("Usage: Wiki page path to create/update <wiki-page-path>"); - let wiki_content = env::args() - .nth(3) - .expect("Usage: Wiki content to be inserted into the page <wiki-content>"); + // 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"); + // Get wiki params based on arguments + let wiki_id = env::args() + .nth(1) + .expect("Usage: Wiki ID to create/update a page under <wiki-id>"); + let wiki_page_path = env::args() + .nth(2) + .expect("Usage: Wiki page path to create/update <wiki-page-path>"); + let wiki_content = env::args() + .nth(3) + .expect("Usage: Wiki content to be inserted into the page <wiki-content>"); - // Create a wiki pages client - let wiki_pages_client = wiki::ClientBuilder::new(credential).build().pages_client(); + // Create a wiki pages client + let wiki_pages_client = wiki::ClientBuilder::new(credential).build().pages_client(); - // To update an existing wiki page the page version, called an eTag, must be supplied in an `If-Match` header. NB: the RequestBuilder will insert this header for you when you call it with the `eTag`. - // This function call returns `Some(String)` containing the eTag if the pages exists, otherwise - // it will return `None` indicating that the page needs to be created. - let op_etag: Option<String> = get_wiki_page_etag( - &wiki_pages_client, - &wiki_page_path, - &organization, - &project, - &wiki_id, - ) - .await; + // To update an existing wiki page the page version, called an eTag, must be supplied in an `If-Match` header. NB: the RequestBuilder will insert this header for you when you call it with the `eTag`. + // This function call returns `Some(String)` containing the eTag if the pages exists, otherwise + // it will return `None` indicating that the page needs to be created. + let op_etag: Option<String> = get_wiki_page_etag( + &wiki_pages_client, + &wiki_page_path, + &organization, + &project, + &wiki_id, + ) + .await; - // The content to be displayed on the page - let wiki_body = wiki::models::WikiPageCreateOrUpdateParameters { - content: Some(wiki_content), - }; + // The content to be displayed on the page + let wiki_body = wiki::models::WikiPageCreateOrUpdateParameters { + content: Some(wiki_content), + }; - // Based on whether the page exists either update or create - match op_etag { - Some(etag) => { - println!("Updating wiki page..."); - match wiki_pages_client - .create_or_update( - organization, - wiki_body, - project, - wiki_id, - wiki_page_path, - etag, - ) - .await - { - Ok(p) => println!("Page updated: {:?}", p.remote_url), - Err(e) => panic!("Failed to update wiki page: {}", e), - } - } - None => { - println!("Creating wiki page..."); - match wiki_pages_client - .create_or_update( - organization, - wiki_body, - project, - wiki_id, - wiki_page_path, - "a123", // fake version value, unused in creation operation - ) - .await - { - Ok(p) => println!("Page created: {:?}", p.remote_url), - Err(e) => panic!("Failed to create wiki page: {}", e), - } - } + // Based on whether the page exists either update or create + match op_etag { + Some(etag) => { + println!("Updating wiki page..."); + match wiki_pages_client + .create_or_update( + organization, + wiki_body, + project, + wiki_id, + wiki_page_path, + etag, + ) + .await + { + Ok(p) => println!("Page updated: {:?}", p.remote_url), + Err(e) => panic!("Failed to update wiki page: {}", e), + } + } + None => { + println!("Creating wiki page..."); + match wiki_pages_client + .create_or_update( + organization, + wiki_body, + project, + wiki_id, + wiki_page_path, + "a123", // fake version value, unused in creation operation + ) + .await + { + Ok(p) => println!("Page created: {:?}", p.remote_url), + Err(e) => panic!("Failed to create wiki page: {}", e), + } } + } - Ok(()) + Ok(()) } /// Using a [pages::Client] attempt to retrieve the version (`eTag`) of a wiki page at `page_path`. @@ -97,36 +97,37 @@ async fn main() -> Result<()> { /// /// If the page does not exist [None] is returned and in such cases the page needs to be created async fn get_wiki_page_etag( - client: &pages::Client, - page_path: &String, - organisation: &String, - project: &String, - wiki_id: &String, + client: &pages::Client, + page_path: &String, + organisation: &String, + project: &String, + wiki_id: &String, ) -> Option<String> { - match client - .get_page(organisation, project, wiki_id) - .path(page_path) - .send() - .await - { - Ok(r) => { - let etag = r.headers().e_tag().unwrap().to_owned(); - println!("Etag for page {}, {}", page_path, etag); - Some(etag) - } - Err(e) => { - // If the response is a 404 then we need to create the page - if e.as_http_error() - .expect("Failed cast to http error") - .status() - .canonical_reason() - == "Not Found" - { - println!("Wiki page does not exist"); - None - } else { - panic!("Failed to retrieve etag: {}", e) - } - } + match client + .get_page(organisation, project, wiki_id) + .path(page_path) + .send() + .await + { + Ok(r) => { + let etag = r.headers().e_tag().unwrap().to_owned(); + println!("Etag for page {}, {}", page_path, etag); + Some(etag) + } + Err(e) => { + // If the response is a 404 then we need to create the page + if e + .as_http_error() + .expect("Failed cast to http error") + .status() + .canonical_reason() + == "Not Found" + { + println!("Wiki page does not exist"); + None + } else { + panic!("Failed to retrieve etag: {}", e) + } } + } } diff --git a/azure_devops_rust_api/examples/wit_work_item_create.rs b/azure_devops_rust_api/examples/wit_work_item_create.rs index cf337917..3c28a5c2 100644 --- a/azure_devops_rust_api/examples/wit_work_item_create.rs +++ b/azure_devops_rust_api/examples/wit_work_item_create.rs @@ -13,39 +13,39 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); + // 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 wit client - let wit_client = wit::ClientBuilder::new(credential).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 this file 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) - .await?; + // Create a wit client + let wit_client = wit::ClientBuilder::new(credential).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 this file 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) + .await?; - println!("{:#?}", work_item); + println!("{:#?}", work_item); - Ok(()) + Ok(()) } // When creating a work item you can also assign an iteration diff --git a/azure_devops_rust_api/examples/wit_work_item_get.rs b/azure_devops_rust_api/examples/wit_work_item_get.rs index f767f5f5..28e962bb 100644 --- a/azure_devops_rust_api/examples/wit_work_item_get.rs +++ b/azure_devops_rust_api/examples/wit_work_item_get.rs @@ -19,132 +19,133 @@ const RELATED_RELATION_TYPE: &str = "System.LinkTypes.Related"; // Extract work item id from url. // Work item url is of the form: https://dev.azure.com/.../<id>/_apis/wit/workItems/<work-item-id> fn work_item_id_from_url(/service/url: &str) -> Result<i32> { - url.rsplit('/') - .next() - .ok_or_else(|| anyhow!("Failed to extract last segment of URL: {url}"))? - .parse::<i32>() - .with_context(|| format!("Failed to parse work item id from url: {url}")) + url + .rsplit('/') + .next() + .ok_or_else(|| anyhow!("Failed to extract last segment of URL: {url}"))? + .parse::<i32>() + .with_context(|| format!("Failed to parse work item id from url: {url}")) } // Extract work item type from work item. fn work_item_type(work_item: &wit::models::WorkItem) -> String { - work_item - .fields - .get("System.WorkItemType") - .and_then(|value| value.as_str()) - .unwrap_or("<unknown>") - .to_string() + work_item + .fields + .get("System.WorkItemType") + .and_then(|value| value.as_str()) + .unwrap_or("<unknown>") + .to_string() } // Return work item ids of related work items with the specified relation type. fn work_item_relations(work_item: &wit::models::WorkItem, relation_type: &str) -> Vec<i32> { - work_item - .relations - .iter() - .filter(|relation| relation.link.rel == relation_type) - .filter_map(|relation| work_item_id_from_url(http://github.com/&relation.link.url).ok()) - .collect() + work_item + .relations + .iter() + .filter(|relation| relation.link.rel == relation_type) + .filter_map(|relation| work_item_id_from_url(http://github.com/&relation.link.url).ok()) + .collect() } fn relation_name(relation: &WorkItemRelation) -> String { - relation.link.attributes["name"] - .as_str() - .unwrap_or("<unknown>") - .to_string() + relation.link.attributes["name"] + .as_str() + .unwrap_or("<unknown>") + .to_string() } #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); - - // Get authentication credential - let credential = utils::get_credential(); - - // 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"); - let work_item_id: i32 = env::args() - .nth(1) - .expect("Usage: wit <work_item_id>") - .parse() - .expect("integer id"); - - // Create a wit client - let wit_client = wit::ClientBuilder::new(credential).build(); - - // Get specified work item - let work_item = wit_client - .work_items_client() - .get_work_item(&organization, work_item_id, &project) - .expand("All") - .await?; - - println!("Work item [{work_item_id}]:\n{:#?}", work_item); - - // Show work item type - println!("Work item type: {}", work_item_type(&work_item)); - - // Show child work items - let children = work_item_relations(&work_item, CHILD_RELATION_TYPE); + // Initialize logging + env_logger::init(); + + // Get authentication credential + let credential = utils::get_credential(); + + // 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"); + let work_item_id: i32 = env::args() + .nth(1) + .expect("Usage: wit <work_item_id>") + .parse() + .expect("integer id"); + + // Create a wit client + let wit_client = wit::ClientBuilder::new(credential).build(); + + // Get specified work item + let work_item = wit_client + .work_items_client() + .get_work_item(&organization, work_item_id, &project) + .expand("All") + .await?; + + println!("Work item [{work_item_id}]:\n{:#?}", work_item); + + // Show work item type + println!("Work item type: {}", work_item_type(&work_item)); + + // Show child work items + let children = work_item_relations(&work_item, CHILD_RELATION_TYPE); + println!( + "\n[{work_item_id}] {} children: {:#?}", + children.len(), + children + ); + + // Show parent work items (expect to see only 0 or 1) + let parent = work_item_relations(&work_item, PARENT_RELATION_TYPE); + println!("\n[{work_item_id}] {} parent: {:#?}", parent.len(), parent); + + // Show related work items + let related = work_item_relations(&work_item, RELATED_RELATION_TYPE); + println!( + "\n[{work_item_id}] {} related: {:#?}", + related.len(), + related + ); + + // Show all work item relations + println!( + "\n[{work_item_id}] All {} relations:", + work_item.relations.len() + ); + for relation in work_item.relations.iter() { println!( - "\n[{work_item_id}] {} children: {:#?}", - children.len(), - children + " {:30} {:40} {}", + relation_name(relation), + relation.link.rel, + relation.link.url ); - - // Show parent work items (expect to see only 0 or 1) - let parent = work_item_relations(&work_item, PARENT_RELATION_TYPE); - println!("\n[{work_item_id}] {} parent: {:#?}", parent.len(), parent); - - // Show related work items - let related = work_item_relations(&work_item, RELATED_RELATION_TYPE); - println!( - "\n[{work_item_id}] {} related: {:#?}", - related.len(), - related - ); - - // Show all work item relations - println!( - "\n[{work_item_id}] All {} relations:", - work_item.relations.len() - ); - for relation in work_item.relations.iter() { - println!( - " {:30} {:40} {}", - relation_name(relation), - relation.link.rel, - relation.link.url - ); - } - - if !children.is_empty() { - // Use a batch get request to query specific fields for child work items - let batch_get_request = wit::models::WorkItemBatchGetRequest { - ids: children, - fields: vec![ - "System.Id".to_string(), - "System.Title".to_string(), - "System.WorkItemType".to_string(), - "System.State".to_string(), - ], - as_of: None, - expand: None, - error_policy: None, - }; - - let child_details = wit_client - .work_items_client() - .get_work_items_batch(&organization, batch_get_request, &project) - .await? - .value; - - println!("\nChild work item batch get with selected fields:"); - for child in child_details.iter() { - println!("[{work_item_id}] {child:#?}", work_item_id = child.id,); - } + } + + if !children.is_empty() { + // Use a batch get request to query specific fields for child work items + let batch_get_request = wit::models::WorkItemBatchGetRequest { + ids: children, + fields: vec![ + "System.Id".to_string(), + "System.Title".to_string(), + "System.WorkItemType".to_string(), + "System.State".to_string(), + ], + as_of: None, + expand: None, + error_policy: None, + }; + + let child_details = wit_client + .work_items_client() + .get_work_items_batch(&organization, batch_get_request, &project) + .await? + .value; + + println!("\nChild work item batch get with selected fields:"); + for child in child_details.iter() { + println!("[{work_item_id}] {child:#?}", work_item_id = child.id,); } + } - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/examples/wit_work_item_queries.rs b/azure_devops_rust_api/examples/wit_work_item_queries.rs index c203bc55..a54015af 100644 --- a/azure_devops_rust_api/examples/wit_work_item_queries.rs +++ b/azure_devops_rust_api/examples/wit_work_item_queries.rs @@ -11,26 +11,26 @@ mod utils; #[tokio::main] async fn main() -> Result<()> { - // Initialize logging - env_logger::init(); + // Initialize logging + env_logger::init(); - // Get authentication credential - let credential = utils::get_credential(); + // Get authentication credential + let credential = utils::get_credential(); - // 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"); + // 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 wit client - let wit_client = wit::ClientBuilder::new(credential).build(); + // Create a wit client + let wit_client = wit::ClientBuilder::new(credential).build(); - // Get all work item queries - let work_item_queries = wit_client - .queries_client() - .list(&organization, &project) - .await?; + // Get all work item queries + let work_item_queries = wit_client + .queries_client() + .list(&organization, &project) + .await?; - println!("All work item queries:\n{:#?}", work_item_queries); + println!("All work item queries:\n{:#?}", work_item_queries); - Ok(()) + Ok(()) } diff --git a/azure_devops_rust_api/src/accounts/mod.rs b/azure_devops_rust_api/src/accounts/mod.rs index 396f3034..8582a813 100644 --- a/azure_devops_rust_api/src/accounts/mod.rs +++ b/azure_devops_rust_api/src/accounts/mod.rs @@ -9,266 +9,268 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://app.vssps.visualstudio.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self - } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self - } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self - } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self - } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } } impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await + } + pub fn accounts_client(&self) -> accounts::Client { + accounts::Client(self.clone()) + } +} +pub mod accounts { + use 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."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + owner_id: None, + member_id: None, + properties: None, + } } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AccountList> { + let bytes = self.0.into_body().collect().await?; + let body: models::AccountList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn accounts_client(&self) -> accounts::Client { - accounts::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } -} -pub mod accounts { - use 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."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - owner_id: None, - member_id: None, - properties: None, - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) owner_id: Option<String>, + pub(crate) member_id: Option<String>, + pub(crate) properties: Option<String>, } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AccountList> { - let bytes = self.0.into_body().collect().await?; - let body: models::AccountList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) owner_id: Option<String>, - pub(crate) member_id: Option<String>, - pub(crate) properties: Option<String>, - } - impl RequestBuilder { - #[doc = "ID for the owner of the accounts."] - pub fn owner_id(mut self, owner_id: impl Into<String>) -> Self { - self.owner_id = Some(owner_id.into()); - self - } - #[doc = "ID for a member of the accounts."] - pub fn member_id(mut self, member_id: impl Into<String>) -> Self { - self.member_id = Some(member_id.into()); - self + impl RequestBuilder { + #[doc = "ID for the owner of the accounts."] + pub fn owner_id(mut self, owner_id: impl Into<String>) -> Self { + self.owner_id = Some(owner_id.into()); + self + } + #[doc = "ID for a member of the accounts."] + pub fn member_id(mut self, member_id: impl Into<String>) -> Self { + self.member_id = Some(member_id.into()); + self + } + pub fn properties(mut self, properties: impl Into<String>) -> Self { + self.properties = Some(properties.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = + azure_core::Url::parse(&format!("{}/_apis/accounts", this.client.endpoint(),))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); } - pub fn properties(mut self, properties: impl Into<String>) -> Self { - self.properties = Some(properties.into()); - self + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(owner_id) = &this.owner_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("ownerId", owner_id); } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/_apis/accounts", - this.client.endpoint(), - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + if let Some(member_id) = &this.member_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("memberId", member_id); } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AccountList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::AccountList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + if let Some(properties) = &this.properties { + req + .url_mut() + .query_pairs_mut() + .append_pair("properties", properties); } - } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AccountList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AccountList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/accounts/models.rs b/azure_devops_rust_api/src/accounts/models.rs index dd3f3916..53b4967d 100644 --- a/azure_devops_rust_api/src/accounts/models.rs +++ b/azure_devops_rust_api/src/accounts/models.rs @@ -8,248 +8,246 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Account { - #[doc = "Identifier for an Account"] - #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] - pub account_id: Option<String>, - #[doc = "Name for an account"] - #[serde( - rename = "accountName", - default, - skip_serializing_if = "Option::is_none" - )] - pub account_name: Option<String>, - #[doc = "Owner of account"] - #[serde( - rename = "accountOwner", - default, - skip_serializing_if = "Option::is_none" - )] - pub account_owner: Option<String>, - #[doc = "Current account status"] - #[serde( - rename = "accountStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub account_status: Option<account::AccountStatus>, - #[doc = "Type of account: Personal, Organization"] - #[serde( - rename = "accountType", - default, - skip_serializing_if = "Option::is_none" - )] - pub account_type: Option<account::AccountType>, - #[doc = "Uri for an account"] - #[serde( - rename = "accountUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub account_uri: Option<String>, - #[doc = "Who created the account"] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<String>, - #[doc = "Date account was created"] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[serde(rename = "hasMoved", default, skip_serializing_if = "Option::is_none")] - pub has_moved: Option<bool>, - #[doc = "Identity of last person to update the account"] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<String>, - #[doc = "Date account was last updated"] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "Namespace for an account"] - #[serde( - rename = "namespaceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub namespace_id: Option<String>, - #[serde( - rename = "newCollectionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_collection_id: Option<String>, - #[doc = "Organization that created the account"] - #[serde( - rename = "organizationName", - default, - skip_serializing_if = "Option::is_none" - )] - pub organization_name: Option<String>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "Reason for current status"] - #[serde( - rename = "statusReason", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_reason: Option<String>, + #[doc = "Identifier for an Account"] + #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] + pub account_id: Option<String>, + #[doc = "Name for an account"] + #[serde( + rename = "accountName", + default, + skip_serializing_if = "Option::is_none" + )] + pub account_name: Option<String>, + #[doc = "Owner of account"] + #[serde( + rename = "accountOwner", + default, + skip_serializing_if = "Option::is_none" + )] + pub account_owner: Option<String>, + #[doc = "Current account status"] + #[serde( + rename = "accountStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub account_status: Option<account::AccountStatus>, + #[doc = "Type of account: Personal, Organization"] + #[serde( + rename = "accountType", + default, + skip_serializing_if = "Option::is_none" + )] + pub account_type: Option<account::AccountType>, + #[doc = "Uri for an account"] + #[serde( + rename = "accountUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub account_uri: Option<String>, + #[doc = "Who created the account"] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<String>, + #[doc = "Date account was created"] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[serde(rename = "hasMoved", default, skip_serializing_if = "Option::is_none")] + pub has_moved: Option<bool>, + #[doc = "Identity of last person to update the account"] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<String>, + #[doc = "Date account was last updated"] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "Namespace for an account"] + #[serde( + rename = "namespaceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub namespace_id: Option<String>, + #[serde( + rename = "newCollectionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_collection_id: Option<String>, + #[doc = "Organization that created the account"] + #[serde( + rename = "organizationName", + default, + skip_serializing_if = "Option::is_none" + )] + pub organization_name: Option<String>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "Reason for current status"] + #[serde( + rename = "statusReason", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_reason: Option<String>, } impl Account { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod account { - use super::*; - #[doc = "Current account status"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AccountStatus { - #[serde(rename = "none")] - None, - #[serde(rename = "enabled")] - Enabled, - #[serde(rename = "disabled")] - Disabled, - #[serde(rename = "deleted")] - Deleted, - #[serde(rename = "moved")] - Moved, - } - #[doc = "Type of account: Personal, Organization"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AccountType { - #[serde(rename = "personal")] - Personal, - #[serde(rename = "organization")] - Organization, - } + use super::*; + #[doc = "Current account status"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AccountStatus { + #[serde(rename = "none")] + None, + #[serde(rename = "enabled")] + Enabled, + #[serde(rename = "disabled")] + Disabled, + #[serde(rename = "deleted")] + Deleted, + #[serde(rename = "moved")] + Moved, + } + #[doc = "Type of account: Personal, Organization"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AccountType { + #[serde(rename = "personal")] + Personal, + #[serde(rename = "organization")] + Organization, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccountCreateInfoInternal { - #[serde( - rename = "accountName", - default, - skip_serializing_if = "Option::is_none" - )] - pub account_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub creator: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub organization: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub preferences: Option<AccountPreferencesInternal>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[serde( - rename = "serviceDefinitions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub service_definitions: Vec<serde_json::Value>, + #[serde( + rename = "accountName", + default, + skip_serializing_if = "Option::is_none" + )] + pub account_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub creator: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub organization: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preferences: Option<AccountPreferencesInternal>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[serde( + rename = "serviceDefinitions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub service_definitions: Vec<serde_json::Value>, } impl AccountCreateInfoInternal { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccountList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Account>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Account>, } impl AccountList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccountPreferencesInternal { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub culture: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub language: Option<String>, - #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] - pub time_zone: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub culture: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub language: Option<String>, + #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] + pub time_zone: Option<String>, } impl AccountPreferencesInternal { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PropertiesCollection { - #[doc = "The count of properties in the collection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<serde_json::Value>, - #[doc = "The set of keys in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub keys: Vec<String>, - #[doc = "The set of values in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<String>, + #[doc = "The count of properties in the collection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<serde_json::Value>, + #[doc = "The set of keys in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub keys: Vec<String>, + #[doc = "The set of values in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<String>, } impl PropertiesCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } 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 b2f56e9f..9a1e4d78 100644 --- a/azure_devops_rust_api/src/approvals_and_checks/mod.rs +++ b/azure_devops_rust_api/src/approvals_and_checks/mod.rs @@ -9,1995 +9,2001 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + 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()) + } +} +pub mod pipeline_permissions { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_pipeline_permisions_for_resources( + &self, + organization: impl Into<String>, + body: Vec<models::ResourcePipelinePermissions>, + project: impl Into<String>, + ) -> update_pipeline_permisions_for_resources::RequestBuilder { + update_pipeline_permisions_for_resources::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Given a ResourceType and ResourceId, returns authorized definitions for that resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + resource_type: impl Into<String>, + resource_id: impl Into<String>, + ) -> 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 = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self + #[doc = "Authorizes/Unauthorizes a list of definitions for a given resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_pipeline_permisions_for_resource( + &self, + organization: impl Into<String>, + body: impl Into<models::ResourcePipelinePermissions>, + project: impl Into<String>, + resource_type: impl Into<String>, + resource_id: impl Into<String>, + ) -> 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(), + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + } + pub mod update_pipeline_permisions_for_resources { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ResourcePipelinePermissionsList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ResourcePipelinePermissionsList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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 From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } -} -pub mod pipeline_permissions { + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::ResourcePipelinePermissions>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/pipelinepermissions", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ResourcePipelinePermissionsList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::ResourcePipelinePermissionsList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_pipeline_permisions_for_resources( - &self, - organization: impl Into<String>, - body: Vec<models::ResourcePipelinePermissions>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - resource_type: impl Into<String>, - resource_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_pipeline_permisions_for_resource( - &self, - organization: impl Into<String>, - body: impl Into<models::ResourcePipelinePermissions>, - project: impl Into<String>, - resource_type: impl Into<String>, - resource_id: impl Into<String>, - ) -> 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 update_pipeline_permisions_for_resources { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ResourcePipelinePermissionsList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourcePipelinePermissionsList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::ResourcePipelinePermissions>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/pipelinepermissions", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ResourcePipelinePermissionsList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ResourcePipelinePermissionsList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ResourcePipelinePermissions> { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourcePipelinePermissions = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) resource_type: String, - pub(crate) resource_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/pipelinepermissions/{}/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.resource_type, - &this.resource_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ResourcePipelinePermissions>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ResourcePipelinePermissions>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_pipeline_permisions_for_resource { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ResourcePipelinePermissions> { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourcePipelinePermissions = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/pipelinepermissions/{}/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.resource_type, - &this.resource_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ResourcePipelinePermissions>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ResourcePipelinePermissions>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ResourcePipelinePermissions> { + let bytes = self.0.into_body().collect().await?; + let body: models::ResourcePipelinePermissions = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) resource_type: String, + pub(crate) resource_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/pipelinepermissions/{}/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.resource_type, + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ResourcePipelinePermissions>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::ResourcePipelinePermissions>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_pipeline_permisions_for_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ResourcePipelinePermissions> { + let bytes = self.0.into_body().collect().await?; + let body: models::ResourcePipelinePermissions = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/pipelinepermissions/{}/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.resource_type, + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ResourcePipelinePermissions>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::ResourcePipelinePermissions>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } pub mod check_configurations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get Check configuration by resource type and id"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::CheckConfiguration>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: check configuration"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `id`: check configuration id"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::CheckConfiguration>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `id`: check configuration id"] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: List of resources."] + #[doc = "* `project`: Project ID or project name"] + pub fn query( + &self, + organization: impl Into<String>, + body: Vec<models::Resource>, + project: impl Into<String>, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + expand: None, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get Check configuration by resource type and id"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::CheckConfiguration>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: check configuration"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `id`: check configuration id"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::CheckConfiguration>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `id`: check configuration id"] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: List of resources."] - #[doc = "* `project`: Project ID or project name"] - pub fn query( - &self, - organization: impl Into<String>, - body: Vec<models::Resource>, - project: impl Into<String>, - ) -> query::RequestBuilder { - query::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body, - project: project.into(), - expand: None, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CheckConfigurationList> { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckConfigurationList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) resource_type: Option<String>, - pub(crate) resource_id: Option<String>, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "resource type"] - pub fn resource_type(mut self, resource_type: impl Into<String>) -> Self { - self.resource_type = Some(resource_type.into()); - self - } - #[doc = "resource id"] - pub fn resource_id(mut self, resource_id: impl Into<String>) -> Self { - self.resource_id = Some(resource_id.into()); - self - } - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/configurations", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CheckConfigurationList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::CheckConfigurationList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CheckConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CheckConfiguration, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/configurations", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CheckConfiguration>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CheckConfiguration>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CheckConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) id: i32, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/configurations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CheckConfiguration>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CheckConfiguration>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CheckConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CheckConfiguration, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/configurations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CheckConfiguration>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CheckConfiguration>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/configurations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CheckConfigurationList> { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckConfigurationList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::Resource>, - pub(crate) project: String, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "The properties that should be expanded in the list of check configurations."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/queryconfigurations", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CheckConfigurationList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::CheckConfigurationList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CheckConfigurationList> { + let bytes = self.0.into_body().collect().await?; + let body: models::CheckConfigurationList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) resource_type: Option<String>, + pub(crate) resource_id: Option<String>, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "resource type"] + pub fn resource_type(mut self, resource_type: impl Into<String>) -> Self { + self.resource_type = Some(resource_type.into()); + self + } + #[doc = "resource id"] + pub fn resource_id(mut self, resource_id: impl Into<String>) -> Self { + self.resource_id = Some(resource_id.into()); + self + } + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/configurations", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CheckConfigurationList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CheckConfigurationList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CheckConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::CheckConfiguration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CheckConfiguration, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/configurations", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CheckConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CheckConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CheckConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::CheckConfiguration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) id: i32, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/configurations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CheckConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CheckConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CheckConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::CheckConfiguration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CheckConfiguration, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/configurations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CheckConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CheckConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/configurations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod query { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CheckConfigurationList> { + let bytes = self.0.into_body().collect().await?; + let body: models::CheckConfigurationList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::Resource>, + pub(crate) project: String, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "The properties that should be expanded in the list of check configurations."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/queryconfigurations", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CheckConfigurationList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CheckConfigurationList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod check_evaluations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Initiate an evaluation for a check in a pipeline"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn evaluate( + &self, + organization: impl Into<String>, + body: impl Into<models::CheckSuiteRequest>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + check_suite_id: impl Into<String>, + ) -> 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 evaluate { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Initiate an evaluation for a check in a pipeline"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn evaluate( - &self, - organization: impl Into<String>, - body: impl Into<models::CheckSuiteRequest>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - check_suite_id: impl Into<String>, - ) -> 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 evaluate { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CheckSuite> { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckSuite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CheckSuiteRequest, - pub(crate) project: String, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/runs", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CheckSuite>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CheckSuite>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CheckSuite> { - let bytes = self.0.into_body().collect().await?; - let body: models::CheckSuite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) check_suite_id: String, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/runs/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.check_suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CheckSuite>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CheckSuite>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CheckSuite> { + let bytes = self.0.into_body().collect().await?; + let body: models::CheckSuite = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CheckSuiteRequest, + pub(crate) project: String, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/runs", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CheckSuite>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::CheckSuite>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CheckSuite> { + let bytes = self.0.into_body().collect().await?; + let body: models::CheckSuite = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) check_suite_id: String, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/runs/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.check_suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CheckSuite>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::CheckSuite>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod approvals { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn query( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + approval_ids: None, + expand: None, + } + } + #[doc = "Update approvals."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: Vec<models::ApprovalUpdateParameters>, + project: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + } + } + #[doc = "Get an approval."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `approval_id`: Id of the approval."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + approval_id: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + approval_id: approval_id.into(), + expand: None, + } + } + } + pub mod query { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn query( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> query::RequestBuilder { - query::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - approval_ids: None, - expand: None, - } - } - #[doc = "Update approvals."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: Vec<models::ApprovalUpdateParameters>, - project: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body, - project: project.into(), - } - } - #[doc = "Get an approval."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `approval_id`: Id of the approval."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - approval_id: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - approval_id: approval_id.into(), - expand: None, - } - } - } - pub mod query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ApprovalList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ApprovalList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) approval_ids: Option<String>, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - pub fn approval_ids(mut self, approval_ids: impl Into<String>) -> Self { - self.approval_ids = Some(approval_ids.into()); - self - } - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/approvals", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ApprovalList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ApprovalList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ApprovalList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ApprovalList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::ApprovalUpdateParameters>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/approvals", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ApprovalList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ApprovalList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Approval> { - let bytes = self.0.into_body().collect().await?; - let body: models::Approval = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) approval_id: String, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/approvals/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.approval_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Approval>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Approval>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ApprovalList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ApprovalList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) approval_ids: Option<String>, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + pub fn approval_ids(mut self, approval_ids: impl Into<String>) -> Self { + self.approval_ids = Some(approval_ids.into()); + self + } + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/approvals", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ApprovalList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ApprovalList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ApprovalList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ApprovalList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::ApprovalUpdateParameters>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/approvals", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ApprovalList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ApprovalList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Approval> { + let bytes = self.0.into_body().collect().await?; + let body: models::Approval = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) approval_id: String, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/approvals/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.approval_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Approval>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Approval>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/approvals_and_checks/models.rs b/azure_devops_rust_api/src/approvals_and_checks/models.rs index 69fa44b4..56da0bc2 100644 --- a/azure_devops_rust_api/src/approvals_and_checks/models.rs +++ b/azure_devops_rust_api/src/approvals_and_checks/models.rs @@ -8,1375 +8,1277 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Approval { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Identities which are not allowed to approve."] - #[serde( - rename = "blockedApprovers", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub blocked_approvers: Vec<IdentityRef>, - #[doc = "Date on which approval got created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Order in which approvers will be actionable."] - #[serde( - rename = "executionOrder", - default, - skip_serializing_if = "Option::is_none" - )] - pub execution_order: Option<approval::ExecutionOrder>, - #[doc = "Unique identifier of the approval."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Instructions for the approvers."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub instructions: Option<String>, - #[doc = "Date on which approval was last modified."] - #[serde( - rename = "lastModifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified_on: Option<time::OffsetDateTime>, - #[doc = "Minimum number of approvers that should approve for the entire approval to be considered approved."] - #[serde( - rename = "minRequiredApprovers", - default, - skip_serializing_if = "Option::is_none" - )] - pub min_required_approvers: Option<i32>, - #[doc = "Current user permissions for approval object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub permissions: Option<approval::Permissions>, - #[doc = "Overall status of the approval."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<approval::Status>, - #[doc = "List of steps associated with the approval."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub steps: Vec<ApprovalStep>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Identities which are not allowed to approve."] + #[serde( + rename = "blockedApprovers", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub blocked_approvers: Vec<IdentityRef>, + #[doc = "Date on which approval got created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Order in which approvers will be actionable."] + #[serde( + rename = "executionOrder", + default, + skip_serializing_if = "Option::is_none" + )] + pub execution_order: Option<approval::ExecutionOrder>, + #[doc = "Unique identifier of the approval."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Instructions for the approvers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub instructions: Option<String>, + #[doc = "Date on which approval was last modified."] + #[serde( + rename = "lastModifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified_on: Option<time::OffsetDateTime>, + #[doc = "Minimum number of approvers that should approve for the entire approval to be considered approved."] + #[serde( + rename = "minRequiredApprovers", + default, + skip_serializing_if = "Option::is_none" + )] + pub min_required_approvers: Option<i32>, + #[doc = "Current user permissions for approval object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub permissions: Option<approval::Permissions>, + #[doc = "Overall status of the approval."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<approval::Status>, + #[doc = "List of steps associated with the approval."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub steps: Vec<ApprovalStep>, } impl Approval { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod approval { - use super::*; - #[doc = "Order in which approvers will be actionable."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ExecutionOrder { - #[serde(rename = "anyOrder")] - AnyOrder, - #[serde(rename = "inSequence")] - InSequence, - } - #[doc = "Current user permissions for approval object."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Permissions { - #[serde(rename = "none")] - None, - #[serde(rename = "view")] - View, - #[serde(rename = "update")] - Update, - #[serde(rename = "reassign")] - Reassign, - #[serde(rename = "resourceAdmin")] - ResourceAdmin, - #[serde(rename = "queueBuild")] - QueueBuild, - } - #[doc = "Overall status of the approval."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "uninitiated")] - Uninitiated, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "approved")] - Approved, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "timedOut")] - TimedOut, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "Order in which approvers will be actionable."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ExecutionOrder { + #[serde(rename = "anyOrder")] + AnyOrder, + #[serde(rename = "inSequence")] + InSequence, + } + #[doc = "Current user permissions for approval object."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Permissions { + #[serde(rename = "none")] + None, + #[serde(rename = "view")] + View, + #[serde(rename = "update")] + Update, + #[serde(rename = "reassign")] + Reassign, + #[serde(rename = "resourceAdmin")] + ResourceAdmin, + #[serde(rename = "queueBuild")] + QueueBuild, + } + #[doc = "Overall status of the approval."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "uninitiated")] + Uninitiated, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "timedOut")] + TimedOut, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApprovalCheckConfiguration { - #[serde(flatten)] - pub check_configuration: CheckConfiguration, - #[doc = "Config to create a new approval."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option<ApprovalConfigSettings>, + #[serde(flatten)] + pub check_configuration: CheckConfiguration, + #[doc = "Config to create a new approval."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub settings: Option<ApprovalConfigSettings>, } impl ApprovalCheckConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApprovalCompletedNotificationEvent { - #[serde(flatten)] - pub approval_notification_event_base: ApprovalNotificationEventBase, + #[serde(flatten)] + pub approval_notification_event_base: ApprovalNotificationEventBase, } impl ApprovalCompletedNotificationEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Config to create a new approval."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApprovalConfig { - #[doc = "Ordered list of approvers."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub approvers: Vec<IdentityRef>, - #[doc = "Identities which are not allowed to approve."] - #[serde( - rename = "blockedApprovers", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub blocked_approvers: Vec<IdentityRef>, - #[doc = "Order in which approvers will be actionable."] - #[serde( - rename = "executionOrder", - default, - skip_serializing_if = "Option::is_none" - )] - pub execution_order: Option<approval_config::ExecutionOrder>, - #[doc = "Instructions for the approver."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub instructions: Option<String>, - #[doc = "Minimum number of approvers that should approve for the entire approval to be considered approved. Defaults to all."] - #[serde( - rename = "minRequiredApprovers", - default, - skip_serializing_if = "Option::is_none" - )] - pub min_required_approvers: Option<i32>, + #[doc = "Ordered list of approvers."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub approvers: Vec<IdentityRef>, + #[doc = "Identities which are not allowed to approve."] + #[serde( + rename = "blockedApprovers", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub blocked_approvers: Vec<IdentityRef>, + #[doc = "Order in which approvers will be actionable."] + #[serde( + rename = "executionOrder", + default, + skip_serializing_if = "Option::is_none" + )] + pub execution_order: Option<approval_config::ExecutionOrder>, + #[doc = "Instructions for the approver."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub instructions: Option<String>, + #[doc = "Minimum number of approvers that should approve for the entire approval to be considered approved. Defaults to all."] + #[serde( + rename = "minRequiredApprovers", + default, + skip_serializing_if = "Option::is_none" + )] + pub min_required_approvers: Option<i32>, } impl ApprovalConfig { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod approval_config { - use super::*; - #[doc = "Order in which approvers will be actionable."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ExecutionOrder { - #[serde(rename = "anyOrder")] - AnyOrder, - #[serde(rename = "inSequence")] - InSequence, - } + use super::*; + #[doc = "Order in which approvers will be actionable."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ExecutionOrder { + #[serde(rename = "anyOrder")] + AnyOrder, + #[serde(rename = "inSequence")] + InSequence, + } } #[doc = "Config to create a new approval."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApprovalConfigSettings { - #[serde(flatten)] - pub approval_config: ApprovalConfig, - #[doc = "Determines whether check requester can approve the check."] - #[serde( - rename = "requesterCannotBeApprover", - default, - skip_serializing_if = "Option::is_none" - )] - pub requester_cannot_be_approver: Option<bool>, + #[serde(flatten)] + pub approval_config: ApprovalConfig, + #[doc = "Determines whether check requester can approve the check."] + #[serde( + rename = "requesterCannotBeApprover", + default, + skip_serializing_if = "Option::is_none" + )] + pub requester_cannot_be_approver: Option<bool>, } impl ApprovalConfigSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApprovalList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Approval>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Approval>, } impl ApprovalList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data for notification base class for approval events."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApprovalNotificationEventBase { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub approval: Option<Approval>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub approval: Option<Approval>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, } impl ApprovalNotificationEventBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Request to create a new approval."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApprovalRequest { - #[doc = "Unique identifier with which the approval is to be registered."] - #[serde( - rename = "approvalId", - default, - skip_serializing_if = "Option::is_none" - )] - pub approval_id: Option<String>, - #[doc = "Config to create a new approval."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub config: Option<ApprovalConfig>, + #[doc = "Unique identifier with which the approval is to be registered."] + #[serde( + rename = "approvalId", + default, + skip_serializing_if = "Option::is_none" + )] + pub approval_id: Option<String>, + #[doc = "Config to create a new approval."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub config: Option<ApprovalConfig>, } impl ApprovalRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data for a single approval step."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApprovalStep { - #[doc = ""] - #[serde( - rename = "actualApprover", - default, - skip_serializing_if = "Option::is_none" - )] - pub actual_approver: Option<IdentityRef>, - #[doc = ""] - #[serde( - rename = "assignedApprover", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_approver: Option<IdentityRef>, - #[doc = "Comment associated with this step."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "History of the approval step"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub history: Vec<ApprovalStepHistory>, - #[doc = "Timestamp at which this step was initiated."] - #[serde( - rename = "initiatedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub initiated_on: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "lastModifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_modified_by: Option<IdentityRef>, - #[doc = "Timestamp at which this step was last modified."] - #[serde( - rename = "lastModifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified_on: Option<time::OffsetDateTime>, - #[doc = "Order in which the approvers are allowed to approve."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, - #[doc = "Current user permissions for step."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub permissions: Option<approval_step::Permissions>, - #[doc = "Current status of this step."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<approval_step::Status>, + #[doc = ""] + #[serde( + rename = "actualApprover", + default, + skip_serializing_if = "Option::is_none" + )] + pub actual_approver: Option<IdentityRef>, + #[doc = ""] + #[serde( + rename = "assignedApprover", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_approver: Option<IdentityRef>, + #[doc = "Comment associated with this step."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "History of the approval step"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub history: Vec<ApprovalStepHistory>, + #[doc = "Timestamp at which this step was initiated."] + #[serde( + rename = "initiatedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub initiated_on: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "lastModifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_modified_by: Option<IdentityRef>, + #[doc = "Timestamp at which this step was last modified."] + #[serde( + rename = "lastModifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified_on: Option<time::OffsetDateTime>, + #[doc = "Order in which the approvers are allowed to approve."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, + #[doc = "Current user permissions for step."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub permissions: Option<approval_step::Permissions>, + #[doc = "Current status of this step."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<approval_step::Status>, } impl ApprovalStep { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod approval_step { - use super::*; - #[doc = "Current user permissions for step."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Permissions { - #[serde(rename = "none")] - None, - #[serde(rename = "view")] - View, - #[serde(rename = "update")] - Update, - #[serde(rename = "reassign")] - Reassign, - #[serde(rename = "resourceAdmin")] - ResourceAdmin, - #[serde(rename = "queueBuild")] - QueueBuild, - } - #[doc = "Current status of this step."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "uninitiated")] - Uninitiated, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "approved")] - Approved, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "timedOut")] - TimedOut, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "Current user permissions for step."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Permissions { + #[serde(rename = "none")] + None, + #[serde(rename = "view")] + View, + #[serde(rename = "update")] + Update, + #[serde(rename = "reassign")] + Reassign, + #[serde(rename = "resourceAdmin")] + ResourceAdmin, + #[serde(rename = "queueBuild")] + QueueBuild, + } + #[doc = "Current status of this step."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "uninitiated")] + Uninitiated, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "timedOut")] + TimedOut, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "all")] + All, + } } #[doc = "Data for a single approval step history."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApprovalStepHistory { - #[doc = ""] - #[serde( - rename = "assignedTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_to: Option<IdentityRef>, - #[doc = "Comment associated with this step history."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Timestamp at which this step history was created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "assignedTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_to: Option<IdentityRef>, + #[doc = "Comment associated with this step history."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "Timestamp at which this step history was created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, } impl ApprovalStepHistory { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data to update an approval object or its individual step."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApprovalUpdateParameters { - #[doc = "ID of the approval to be updated."] - #[serde( - rename = "approvalId", - default, - skip_serializing_if = "Option::is_none" - )] - pub approval_id: Option<String>, - #[doc = ""] - #[serde( - rename = "assignedApprover", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_approver: Option<IdentityRef>, - #[doc = "Gets or sets comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = ""] - #[serde( - rename = "reassignTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub reassign_to: Option<IdentityRef>, - #[doc = "Gets or sets status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<approval_update_parameters::Status>, + #[doc = "ID of the approval to be updated."] + #[serde( + rename = "approvalId", + default, + skip_serializing_if = "Option::is_none" + )] + pub approval_id: Option<String>, + #[doc = ""] + #[serde( + rename = "assignedApprover", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_approver: Option<IdentityRef>, + #[doc = "Gets or sets comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = ""] + #[serde( + rename = "reassignTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub reassign_to: Option<IdentityRef>, + #[doc = "Gets or sets status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<approval_update_parameters::Status>, } impl ApprovalUpdateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod approval_update_parameters { - use super::*; - #[doc = "Gets or sets status."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "uninitiated")] - Uninitiated, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "approved")] - Approved, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "timedOut")] - TimedOut, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "Gets or sets status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "uninitiated")] + Uninitiated, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "timedOut")] + TimedOut, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApprovalsQueryParameters { - #[doc = "Query approvals based on list of approval IDs."] - #[serde( - rename = "approvalIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub approval_ids: Vec<String>, + #[doc = "Query approvals based on list of approval IDs."] + #[serde( + rename = "approvalIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub approval_ids: Vec<String>, } impl ApprovalsQueryParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckConfiguration { - #[serde(flatten)] - pub check_configuration_ref: CheckConfigurationRef, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Time when check got configured."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Is check disabled."] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "An issue (error, warning) associated with a check configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub issue: Option<CheckIssue>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "Time when configured check was modified."] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Timeout in minutes for the check."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option<i32>, + #[serde(flatten)] + pub check_configuration_ref: CheckConfigurationRef, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "Time when check got configured."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "Time when configured check was modified."] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Timeout in minutes for the check."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout: Option<i32>, } impl CheckConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckConfigurationData { - #[doc = ""] - #[serde( - rename = "checkConfiguration", - default, - skip_serializing_if = "Option::is_none" - )] - pub check_configuration: Option<CheckConfiguration>, - #[doc = "Definition Ref Id of the particular check."] - #[serde( - rename = "definitionRefId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_ref_id: Option<String>, + #[doc = ""] + #[serde( + rename = "checkConfiguration", + default, + skip_serializing_if = "Option::is_none" + )] + pub check_configuration: Option<CheckConfiguration>, + #[doc = "Definition Ref Id of the particular check."] + #[serde( + rename = "definitionRefId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_ref_id: Option<String>, } impl CheckConfigurationData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckConfigurationList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<CheckConfiguration>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<CheckConfiguration>, } impl CheckConfigurationList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckConfigurationRef { - #[doc = "Check configuration id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option<Resource>, - #[doc = ""] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<CheckType>, - #[doc = "The URL from which one can fetch the configured check."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Check configuration id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option<Resource>, + #[doc = ""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<CheckType>, + #[doc = "The URL from which one can fetch the configured check."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl CheckConfigurationRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckData { - #[doc = "List of check configuration data"] - #[serde( - rename = "checkConfigurationDataList", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub check_configuration_data_list: Vec<CheckConfigurationData>, - #[doc = "List of check definitions"] - #[serde( - rename = "checkDefinitions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub check_definitions: Vec<CheckDefinitionData>, - #[doc = "List of default check settings"] - #[serde( - rename = "defaultCheckSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_check_settings: Option<serde_json::Value>, - #[doc = "List of time zones."] - #[serde( - rename = "timeZoneList", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub time_zone_list: Vec<TimeZone>, + #[doc = "List of check configuration data"] + #[serde( + rename = "checkConfigurationDataList", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub check_configuration_data_list: Vec<CheckConfigurationData>, + #[doc = "List of check definitions"] + #[serde( + rename = "checkDefinitions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub check_definitions: Vec<CheckDefinitionData>, + #[doc = "List of time zones."] + #[serde( + rename = "timeZoneList", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub time_zone_list: Vec<TimeZone>, } impl CheckData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckDefinitionData { - #[doc = "Flag to allow multiple configurations of a particular check on a resource."] - #[serde( - rename = "allowMultipleConfigurations", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_multiple_configurations: Option<bool>, - #[doc = "Details about the check"] - #[serde( - rename = "checkDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub check_definition: Option<serde_json::Value>, - #[doc = "Check DefinitionRef Id"] - #[serde( - rename = "definitionRefId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_ref_id: Option<String>, - #[doc = "Description about the check"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub icon: Option<CheckIcon>, - #[doc = "Name of the check"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Check UI contribution Dependencies"] - #[serde( - rename = "uiContributionDependencies", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ui_contribution_dependencies: Vec<String>, - #[doc = "Check UI contribution Type"] - #[serde( - rename = "uiContributionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub ui_contribution_type: Option<String>, + #[doc = "Flag to allow multiple configurations of a particular check on a resource."] + #[serde( + rename = "allowMultipleConfigurations", + default, + skip_serializing_if = "Option::is_none" + )] + pub allow_multiple_configurations: Option<bool>, + #[doc = "Details about the check"] + #[serde( + rename = "checkDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub check_definition: Option<serde_json::Value>, + #[doc = "Check DefinitionRef Id"] + #[serde( + rename = "definitionRefId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_ref_id: Option<String>, + #[doc = "Description about the check"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icon: Option<CheckIcon>, + #[doc = "Name of the check"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Check UI contribution Dependencies"] + #[serde( + rename = "uiContributionDependencies", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ui_contribution_dependencies: Vec<String>, + #[doc = "Check UI contribution Type"] + #[serde( + rename = "uiContributionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub ui_contribution_type: Option<String>, } impl CheckDefinitionData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckIcon { - #[doc = "Asset Location of the icon"] - #[serde( - rename = "assetLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub asset_location: Option<String>, - #[doc = "Name of the icon"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Url of the icon"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Asset Location of the icon"] + #[serde( + rename = "assetLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub asset_location: Option<String>, + #[doc = "Name of the icon"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Url of the icon"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl CheckIcon { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An issue (error, warning) associated with a check configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CheckIssue { - #[doc = "Short summary of the check - its name and resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "A more detailed description of issue."] - #[serde( - rename = "detailedMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub detailed_message: Option<String>, - #[doc = "A description of issue."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "The type (error, warning) of the issue."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<check_issue::Type>, -} -impl CheckIssue { - pub fn new() -> Self { - Self::default() - } -} -pub mod check_issue { - use super::*; - #[doc = "The type (error, warning) of the issue."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "error")] - Error, - #[serde(rename = "warning")] - Warning, - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CheckIssueData { - #[doc = "List of default check issue settings"] - #[serde( - rename = "defaultCheckIssueSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_check_issue_settings: Option<serde_json::Value>, - #[doc = "List of resources with check issues"] - #[serde( - rename = "resourcesWithCheckIssuesList", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub resources_with_check_issues_list: Vec<ResourceCheckIssue>, -} -impl CheckIssueData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckRun { - #[serde(flatten)] - pub check_run_result: CheckRunResult, - #[doc = ""] - #[serde( - rename = "checkConfigurationRef", - default, - skip_serializing_if = "Option::is_none" - )] - pub check_configuration_ref: Option<CheckConfigurationRef>, - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[serde(flatten)] + pub check_run_result: CheckRunResult, + #[doc = ""] + #[serde( + rename = "checkConfigurationRef", + default, + skip_serializing_if = "Option::is_none" + )] + pub check_configuration_ref: Option<CheckConfigurationRef>, + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl CheckRun { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckRunResult { - #[serde( - rename = "resultMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_message: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<check_run_result::Status>, + #[serde( + rename = "resultMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_message: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<check_run_result::Status>, } impl CheckRunResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod check_run_result { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "none")] - None, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "running")] - Running, - #[serde(rename = "approved")] - Approved, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "timedOut")] - TimedOut, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "all")] - All, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "none")] + None, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "running")] + Running, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "timedOut")] + TimedOut, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckSuite { - #[serde(flatten)] - pub check_suite_ref: CheckSuiteRef, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "List of check runs associated with the given check suite request."] - #[serde( - rename = "checkRuns", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub check_runs: Vec<CheckRun>, - #[doc = "Completed date of the given check suite request"] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Optional message for the given check suite request"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "Overall check runs status for the given suite request. This is check suite status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<check_suite::Status>, + #[serde(flatten)] + pub check_suite_ref: CheckSuiteRef, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "List of check runs associated with the given check suite request."] + #[serde( + rename = "checkRuns", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub check_runs: Vec<CheckRun>, + #[doc = "Completed date of the given check suite request"] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Optional message for the given check suite request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "Overall check runs status for the given suite request. This is check suite status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<check_suite::Status>, } impl CheckSuite { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod check_suite { - use super::*; - #[doc = "Overall check runs status for the given suite request. This is check suite status"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "none")] - None, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "running")] - Running, - #[serde(rename = "approved")] - Approved, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "timedOut")] - TimedOut, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "Overall check runs status for the given suite request. This is check suite status"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "none")] + None, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "running")] + Running, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "timedOut")] + TimedOut, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckSuiteRef { - #[doc = "Evaluation context for the check suite request"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub context: Option<serde_json::Value>, - #[doc = "Unique suite id generated by the pipeline orchestrator for the pipeline check runs request on the list of resources Pipeline orchestrator will used this identifier to map the check requests on a stage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[doc = "Evaluation context for the check suite request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub context: Option<serde_json::Value>, + #[doc = "Unique suite id generated by the pipeline orchestrator for the pipeline check runs request on the list of resources Pipeline orchestrator will used this identifier to map the check requests on a stage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl CheckSuiteRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckSuiteRequest { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub context: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub resources: Vec<Resource>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub context: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub resources: Vec<Resource>, } impl CheckSuiteRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckType { - #[doc = "Gets or sets check type id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the check type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Gets or sets check type id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the check type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl CheckType { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GenericCheckConfiguration { - #[serde(flatten)] - pub check_configuration: CheckConfiguration, - #[doc = "Settings for the generic check configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option<serde_json::Value>, + #[serde(flatten)] + pub check_configuration: CheckConfiguration, + #[doc = "Settings for the generic check configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub settings: Option<serde_json::Value>, } impl GenericCheckConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, } + } } #[doc = "Represents a JSON object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JObject { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<String>, - #[doc = "Gets the node type for this JToken."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<String>, + #[doc = "Gets the node type for this JToken."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl JObject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Permission { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorized: Option<bool>, - #[doc = ""] - #[serde( - rename = "authorizedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorized_by: Option<IdentityRef>, - #[serde( - rename = "authorizedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub authorized_on: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorized: Option<bool>, + #[doc = ""] + #[serde( + rename = "authorizedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorized_by: Option<IdentityRef>, + #[serde( + rename = "authorizedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub authorized_on: Option<time::OffsetDateTime>, } impl Permission { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelinePermission { - #[serde(flatten)] - pub permission: Permission, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, + #[serde(flatten)] + pub permission: Permission, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, } impl PipelinePermission { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelineProcessResources { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub resources: Vec<PipelineResourceReference>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub resources: Vec<PipelineResourceReference>, } impl PipelineProcessResources { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelineResourceReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorized: Option<bool>, - #[serde( - rename = "authorizedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorized_by: Option<String>, - #[serde( - rename = "authorizedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub authorized_on: Option<time::OffsetDateTime>, - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorized: Option<bool>, + #[serde( + rename = "authorizedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorized_by: Option<String>, + #[serde( + rename = "authorizedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub authorized_on: Option<time::OffsetDateTime>, + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl PipelineResourceReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Resource { - #[doc = "Id of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Type of the resource."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Id of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Type of the resource."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl Resource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A check configuration issue (error, warning) associated with a resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceCheckIssue { - #[doc = "An issue (error, warning) associated with a check configuration."] - #[serde( - rename = "checkIssue", - default, - skip_serializing_if = "Option::is_none" - )] - pub check_issue: Option<CheckIssue>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option<Resource>, -} -impl ResourceCheckIssue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourcePipelinePermissions { - #[doc = ""] - #[serde( - rename = "allPipelines", - default, - skip_serializing_if = "Option::is_none" - )] - pub all_pipelines: Option<Permission>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub pipelines: Vec<PipelinePermission>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option<Resource>, + #[doc = ""] + #[serde( + rename = "allPipelines", + default, + skip_serializing_if = "Option::is_none" + )] + pub all_pipelines: Option<Permission>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub pipelines: Vec<PipelinePermission>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option<Resource>, } impl ResourcePipelinePermissions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourcePipelinePermissionsList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ResourcePipelinePermissions>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ResourcePipelinePermissions>, } impl ResourcePipelinePermissionsList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Config to facilitate task check"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskCheckConfig { - #[doc = ""] - #[serde( - rename = "definitionRef", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_ref: Option<TaskCheckDefinitionReference>, - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option<serde_json::Value>, - #[serde( - rename = "linkedVariableGroup", - default, - skip_serializing_if = "Option::is_none" - )] - pub linked_variable_group: Option<String>, - #[serde( - rename = "retryInterval", - default, - skip_serializing_if = "Option::is_none" - )] - pub retry_interval: Option<i32>, + #[doc = ""] + #[serde( + rename = "definitionRef", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_ref: Option<TaskCheckDefinitionReference>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inputs: Option<serde_json::Value>, + #[serde( + rename = "linkedVariableGroup", + default, + skip_serializing_if = "Option::is_none" + )] + pub linked_variable_group: Option<String>, + #[serde( + rename = "retryInterval", + default, + skip_serializing_if = "Option::is_none" + )] + pub retry_interval: Option<i32>, } impl TaskCheckConfig { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskCheckConfiguration { - #[serde(flatten)] - pub check_configuration: CheckConfiguration, - #[doc = "Config to facilitate task check"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option<TaskCheckConfig>, + #[serde(flatten)] + pub check_configuration: CheckConfiguration, + #[doc = "Config to facilitate task check"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub settings: Option<TaskCheckConfig>, } impl TaskCheckConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskCheckDefinitionReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl TaskCheckDefinitionReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimeZone { - #[doc = "Display name of the time zone."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Id of the time zone."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[doc = "Display name of the time zone."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Id of the time zone."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl TimeZone { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/artifacts/mod.rs b/azure_devops_rust_api/src/artifacts/mod.rs index 1a3bc9f5..c6a89b6b 100644 --- a/azure_devops_rust_api/src/artifacts/mod.rs +++ b/azure_devops_rust_api/src/artifacts/mod.rs @@ -9,5345 +9,5373 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://feeds.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + 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()) + } +} +pub mod service_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all service-wide feed creation and administration permissions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get_global_permissions( + &self, + organization: impl Into<String>, + ) -> get_global_permissions::RequestBuilder { + get_global_permissions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + include_ids: None, + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Set service-wide permissions that govern feed creation and administration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: New permissions for the organization."] + pub fn set_global_permissions( + &self, + organization: impl Into<String>, + body: Vec<models::GlobalPermission>, + ) -> set_global_permissions::RequestBuilder { + set_global_permissions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self + } + pub mod get_global_permissions { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GlobalPermissionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GlobalPermissionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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 AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } -} -pub mod service_settings { + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) include_ids: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/packaging/globalpermissions", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(include_ids) = &this.include_ids { + req + .url_mut() + .query_pairs_mut() + .append_pair("includeIds", &include_ids.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GlobalPermissionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GlobalPermissionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod set_global_permissions { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get all service-wide feed creation and administration permissions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get_global_permissions( - &self, - organization: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: New permissions for the organization."] - pub fn set_global_permissions( - &self, - organization: impl Into<String>, - body: Vec<models::GlobalPermission>, - ) -> set_global_permissions::RequestBuilder { - set_global_permissions::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body, - } - } - } - pub mod get_global_permissions { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GlobalPermissionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GlobalPermissionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) include_ids: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/packaging/globalpermissions", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(include_ids) = &this.include_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("includeIds", &include_ids.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GlobalPermissionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GlobalPermissionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod set_global_permissions { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GlobalPermissionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GlobalPermissionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::GlobalPermission>, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/packaging/globalpermissions", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GlobalPermissionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GlobalPermissionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GlobalPermissionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GlobalPermissionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::GlobalPermission>, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/packaging/globalpermissions", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GlobalPermissionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GlobalPermissionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod change_tracking { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_feed_changes( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_feed_change( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_changes( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get_feed_changes { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_feed_changes( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_feed_change( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_changes( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get_feed_changes { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FeedChangesResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedChangesResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) include_deleted: Option<bool>, - pub(crate) continuation_token: Option<i64>, - pub(crate) batch_size: Option<i32>, - } - 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); - self - } - #[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); - self - } - #[doc = "Number of package changes to fetch. The default value is 1000. The maximum value is 2000."] - pub fn batch_size(mut self, batch_size: i32) -> Self { - self.batch_size = Some(batch_size); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feedchanges", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FeedChangesResponse>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::FeedChangesResponse>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_feed_change { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FeedChange> { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedChange = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feedchanges/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FeedChange>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FeedChange>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_package_changes { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PackageChangesResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageChangesResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) project: String, - pub(crate) continuation_token: Option<i64>, - pub(crate) batch_size: Option<i32>, - } - 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); - self - } - #[doc = "Number of package changes to fetch. The default value is 1000. The maximum value is 2000."] - pub fn batch_size(mut self, batch_size: i32) -> Self { - self.batch_size = Some(batch_size); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/packagechanges", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PackageChangesResponse>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PackageChangesResponse>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FeedChangesResponse> { + let bytes = self.0.into_body().collect().await?; + let body: models::FeedChangesResponse = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) include_deleted: Option<bool>, + pub(crate) continuation_token: Option<i64>, + pub(crate) batch_size: Option<i32>, + } + 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); + self + } + #[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); + self + } + #[doc = "Number of package changes to fetch. The default value is 1000. The maximum value is 2000."] + pub fn batch_size(mut self, batch_size: i32) -> Self { + self.batch_size = Some(batch_size); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feedchanges", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FeedChangesResponse>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::FeedChangesResponse>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_feed_change { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FeedChange> { + let bytes = self.0.into_body().collect().await?; + let body: models::FeedChange = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feedchanges/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FeedChange>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::FeedChange>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_package_changes { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PackageChangesResponse> { + let bytes = self.0.into_body().collect().await?; + let body: models::PackageChangesResponse = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) project: String, + pub(crate) continuation_token: Option<i64>, + pub(crate) batch_size: Option<i32>, + } + 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); + self + } + #[doc = "Number of package changes to fetch. The default value is 1000. The maximum value is 2000."] + pub fn batch_size(mut self, batch_size: i32) -> Self { + self.batch_size = Some(batch_size); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/packagechanges", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PackageChangesResponse>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PackageChangesResponse>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod feed_recycle_bin { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn restore_deleted_feed( + &self, + organization: impl Into<String>, + body: impl Into<models::JsonPatchDocument>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn permanent_delete_feed( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 list { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn restore_deleted_feed( - &self, - organization: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn permanent_delete_feed( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FeedList> { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feedrecyclebin", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FeedList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FeedList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod restore_deleted_feed { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::JsonPatchDocument, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feedrecyclebin/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod permanent_delete_feed { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feedrecyclebin/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FeedList> { + let bytes = self.0.into_body().collect().await?; + let body: models::FeedList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feedrecyclebin", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FeedList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::FeedList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod restore_deleted_feed { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::JsonPatchDocument, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feedrecyclebin/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod permanent_delete_feed { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feedrecyclebin/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod feed_management { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_feeds( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A JSON object containing both required and optional attributes for the feed. Name is the only required value."] + #[doc = "* `project`: Project ID or project name"] + pub fn create_feed( + &self, + organization: impl Into<String>, + body: impl Into<models::Feed>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_feed( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A JSON object containing the feed settings to be updated."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_feed( + &self, + organization: impl Into<String>, + body: impl Into<models::FeedUpdate>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_feed( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_feed_permissions( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Permissions to set."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn set_feed_permissions( + &self, + organization: impl Into<String>, + body: Vec<models::FeedPermission>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_feed_views( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: View to be created."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn create_feed_view( + &self, + organization: impl Into<String>, + body: impl Into<models::FeedView>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `view_id`: Name or Id of the view."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_feed_view( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + view_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: New settings to apply to the specified view."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `view_id`: Name or Id of the view."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_feed_view( + &self, + organization: impl Into<String>, + body: impl Into<models::FeedView>, + feed_id: impl Into<String>, + view_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `view_id`: Name or Id of the view."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_feed_view( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + view_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get_feeds { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_feeds( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A JSON object containing both required and optional attributes for the feed. Name is the only required value."] - #[doc = "* `project`: Project ID or project name"] - pub fn create_feed( - &self, - organization: impl Into<String>, - body: impl Into<models::Feed>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_feed( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A JSON object containing the feed settings to be updated."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_feed( - &self, - organization: impl Into<String>, - body: impl Into<models::FeedUpdate>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_feed( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_feed_permissions( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Permissions to set."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn set_feed_permissions( - &self, - organization: impl Into<String>, - body: Vec<models::FeedPermission>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_feed_views( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: View to be created."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn create_feed_view( - &self, - organization: impl Into<String>, - body: impl Into<models::FeedView>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `view_id`: Name or Id of the view."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_feed_view( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - view_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: New settings to apply to the specified view."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `view_id`: Name or Id of the view."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_feed_view( - &self, - organization: impl Into<String>, - body: impl Into<models::FeedView>, - feed_id: impl Into<String>, - view_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `view_id`: Name or Id of the view."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_feed_view( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - view_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get_feeds { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FeedList> { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) feed_role: Option<String>, - pub(crate) include_deleted_upstreams: Option<bool>, - pub(crate) include_urls: Option<bool>, - } - 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<String>) -> Self { - self.feed_role = Some(feed_role.into()); - self - } - #[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 - } - #[doc = "Resolve names if 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(feed_role) = &this.feed_role { - req.url_mut() - .query_pairs_mut() - .append_pair("feedRole", feed_role); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FeedList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FeedList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_feed { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Feed> { - let bytes = self.0.into_body().collect().await?; - let body: models::Feed = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Feed, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Feed>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Feed>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_feed { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Feed> { - let bytes = self.0.into_body().collect().await?; - let body: models::Feed = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) project: String, - pub(crate) include_deleted_upstreams: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Feed>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Feed>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_feed { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Feed> { - let bytes = self.0.into_body().collect().await?; - let body: models::Feed = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::FeedUpdate, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Feed>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Feed>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_feed { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_feed_permissions { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FeedPermissionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedPermissionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) project: String, - pub(crate) include_ids: Option<bool>, - pub(crate) exclude_inherited_permissions: Option<bool>, - pub(crate) identity_descriptor: Option<String>, - pub(crate) include_deleted_feeds: Option<bool>, - } - 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); - self - } - #[doc = "Set to true to only return explicitly set permissions on the feed. Default is false."] - pub fn exclude_inherited_permissions( - mut self, - exclude_inherited_permissions: bool, - ) -> Self { - self.exclude_inherited_permissions = Some(exclude_inherited_permissions); - self - } - #[doc = "Filter permissions to the provided identity."] - pub fn identity_descriptor(mut self, identity_descriptor: impl Into<String>) -> Self { - self.identity_descriptor = Some(identity_descriptor.into()); - self - } - #[doc = "If includeDeletedFeeds is true, then feedId must be specified by name and not by Guid."] - pub fn include_deleted_feeds(mut self, include_deleted_feeds: bool) -> Self { - self.include_deleted_feeds = Some(include_deleted_feeds); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/permissions", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FeedPermissionList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FeedPermissionList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod set_feed_permissions { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FeedPermissionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedPermissionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::FeedPermission>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/permissions", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FeedPermissionList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FeedPermissionList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_feed_views { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FeedViewList> { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedViewList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/views", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FeedViewList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FeedViewList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_feed_view { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FeedView> { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedView = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::FeedView, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/views", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FeedView>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FeedView>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_feed_view { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FeedView> { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedView = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) view_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.view_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FeedView>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FeedView>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_feed_view { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FeedView> { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedView = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.view_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FeedView>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FeedView>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_feed_view { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) view_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.view_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FeedList> { + let bytes = self.0.into_body().collect().await?; + let body: models::FeedList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod artifact_details { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) feed_role: Option<String>, + pub(crate) include_deleted_upstreams: Option<bool>, + pub(crate) include_urls: Option<bool>, + } + 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<String>) -> Self { + self.feed_role = Some(feed_role.into()); + self + } + #[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 + } + #[doc = "Resolve names if 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(feed_role) = &this.feed_role { + req + .url_mut() + .query_pairs_mut() + .append_pair("feedRole", feed_role); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FeedList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::FeedList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_feed { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn query_package_metrics( - &self, - organization: impl Into<String>, - body: impl Into<models::PackageMetricsQuery>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_packages( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `package_id`: The package Id (GUID Id, not the package name)."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn query_package_version_metrics( - &self, - organization: impl Into<String>, - body: impl Into<models::PackageVersionMetricsQuery>, - feed_id: impl Into<String>, - package_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `package_id`: Id of the package (GUID Id, not name)."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_versions( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `package_id`: Id of the package (GUID Id, not name)."] - #[doc = "* `package_version_id`: Id of the package version (GUID Id, not name)."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_version( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_id: impl Into<String>, - package_version_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `package_id`: Id of the package (GUID Id, not name)."] - #[doc = "* `package_version_id`: Id of the package version (GUID Id, not name)."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_version_provenance( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_id: impl Into<String>, - package_version_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `package_id`: Id of the package (GUID Id, not name)."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_badge( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 query_package_metrics { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PackageMetricsList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageMetricsList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PackageMetricsQuery, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/packagemetricsbatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PackageMetricsList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PackageMetricsList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_packages { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PackageList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) project: String, - pub(crate) protocol_type: Option<String>, - pub(crate) package_name_query: Option<String>, - pub(crate) normalized_package_name: Option<String>, - pub(crate) include_urls: Option<bool>, - pub(crate) include_all_versions: Option<bool>, - pub(crate) is_listed: Option<bool>, - pub(crate) get_top_package_versions: Option<bool>, - pub(crate) is_release: Option<bool>, - pub(crate) include_description: Option<bool>, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) include_deleted: Option<bool>, - pub(crate) is_cached: Option<bool>, - pub(crate) direct_upstream_id: Option<String>, - } - impl RequestBuilder { - #[doc = "One of the supported artifact package types."] - pub fn protocol_type(mut self, protocol_type: impl Into<String>) -> Self { - self.protocol_type = Some(protocol_type.into()); - self - } - #[doc = "Filter to packages that contain the provided string. Characters in the string must conform to the package name constraints."] - pub fn package_name_query(mut self, package_name_query: impl Into<String>) -> Self { - self.package_name_query = Some(package_name_query.into()); - self - } - #[doc = "\\[Obsolete\\] Used for legacy scenarios and may be removed in future versions."] - pub fn normalized_package_name( - mut self, - normalized_package_name: impl Into<String>, - ) -> Self { - self.normalized_package_name = Some(normalized_package_name.into()); - self - } - #[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 = "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); - self - } - #[doc = "Only applicable for NuGet packages, setting it for other package types will result in a 404. If false, delisted package versions will be returned. Use this to filter the response when include_all_versions is set to true. Default is unset (do not return delisted packages)."] - pub fn is_listed(mut self, is_listed: bool) -> Self { - self.is_listed = Some(is_listed); - self - } - #[doc = "Changes the behavior of $top and $skip to return all versions of each package up to $top. Must be used in conjunction with include_all_versions=true"] - pub fn get_top_package_versions(mut self, get_top_package_versions: bool) -> Self { - self.get_top_package_versions = Some(get_top_package_versions); - self - } - #[doc = "Only applicable for Nuget packages. Use this to filter the response when include_all_versions is set to true. Default is True (only return packages without prerelease versioning)."] - pub fn is_release(mut self, is_release: bool) -> Self { - self.is_release = Some(is_release); - self - } - #[doc = "Return the description for every version of each package in the response. Default is False."] - pub fn include_description(mut self, include_description: bool) -> Self { - self.include_description = Some(include_description); - self - } - #[doc = "Get the top N packages (or package versions where get_top_package_versions=true)"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Skip the first N packages (or package versions where get_top_package_versions=true)"] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "Return deleted or unpublished versions of packages in the response. Default is False."] - pub fn include_deleted(mut self, include_deleted: bool) -> Self { - self.include_deleted = Some(include_deleted); - self - } - #[doc = "\\[Obsolete\\] Used for legacy scenarios and may be removed in future versions."] - pub fn is_cached(mut self, is_cached: bool) -> Self { - self.is_cached = Some(is_cached); - self - } - #[doc = "Filter results to return packages from a specific upstream."] - pub fn direct_upstream_id(mut self, direct_upstream_id: impl Into<String>) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/packages", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PackageList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PackageList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_package { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_id: String, - pub(crate) project: String, - pub(crate) include_all_versions: Option<bool>, - pub(crate) include_urls: Option<bool>, - pub(crate) is_listed: Option<bool>, - pub(crate) is_release: Option<bool>, - pub(crate) include_deleted: Option<bool>, - pub(crate) include_description: Option<bool>, - } - 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); - self - } - #[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 = "Only applicable for NuGet packages, setting it for other package types will result in a 404. If false, delisted package versions will be returned. Use this to filter the response when include_all_versions is set to true. Default is unset (do not return delisted packages)."] - pub fn is_listed(mut self, is_listed: bool) -> Self { - self.is_listed = Some(is_listed); - self - } - #[doc = "Only applicable for Nuget packages. Use this to filter the response when include_all_versions is set to true. Default is True (only return packages without prerelease versioning)."] - pub fn is_release(mut self, is_release: bool) -> Self { - self.is_release = Some(is_release); - self - } - #[doc = "Return deleted or unpublished versions of packages in the response. Default is False."] - pub fn include_deleted(mut self, include_deleted: bool) -> Self { - self.include_deleted = Some(include_deleted); - self - } - #[doc = "Return the description for every version of each package in the response. Default is False."] - pub fn include_description(mut self, include_description: bool) -> Self { - self.include_description = Some(include_description); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/packages/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod query_package_version_metrics { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PackageVersionMetricsList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageVersionMetricsList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versionmetricsbatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PackageVersionMetricsList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PackageVersionMetricsList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_package_versions { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PackageVersionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageVersionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_id: String, - pub(crate) project: String, - pub(crate) include_urls: Option<bool>, - pub(crate) is_listed: Option<bool>, - pub(crate) is_deleted: Option<bool>, - } - 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); - self - } - #[doc = "Only applicable for NuGet packages. If false, delisted package versions will be returned."] - pub fn is_listed(mut self, is_listed: bool) -> Self { - self.is_listed = Some(is_listed); - self - } - #[doc = "If set specifies whether to return only deleted or non-deleted versions of packages in the response. Default is unset (return all versions)."] - pub fn is_deleted(mut self, is_deleted: bool) -> Self { - self.is_deleted = Some(is_deleted); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versions", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PackageVersionList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PackageVersionList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_package_version { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PackageVersion> { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageVersion = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_id: String, - pub(crate) package_version_id: String, - pub(crate) project: String, - pub(crate) include_urls: Option<bool>, - pub(crate) is_listed: Option<bool>, - pub(crate) is_deleted: Option<bool>, - } - 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); - self - } - #[doc = "Only applicable for NuGet packages. If false, delisted package versions will be returned."] - pub fn is_listed(mut self, is_listed: bool) -> Self { - self.is_listed = Some(is_listed); - self - } - #[doc = "This does not have any effect on the requested package version, for other versions returned specifies whether to return only deleted or non-deleted versions of packages in the response. Default is unset (return all versions)."] - pub fn is_deleted(mut self, is_deleted: bool) -> Self { - self.is_deleted = Some(is_deleted); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_id, - &this.package_version_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PackageVersion>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PackageVersion>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_package_version_provenance { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PackageVersionProvenance> { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageVersionProvenance = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/Versions/{}/provenance", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_id, - &this.package_version_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PackageVersionProvenance>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PackageVersionProvenance>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_badge { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/public/packaging/Feeds/{}/Packages/{}/badge", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Feed> { + let bytes = self.0.into_body().collect().await?; + let body: models::Feed = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Feed, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Feed>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Feed>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_feed { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Feed> { + let bytes = self.0.into_body().collect().await?; + let body: models::Feed = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) project: String, + pub(crate) include_deleted_upstreams: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Feed>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Feed>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_feed { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Feed> { + let bytes = self.0.into_body().collect().await?; + let body: models::Feed = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::FeedUpdate, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Feed>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Feed>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_feed { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_feed_permissions { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FeedPermissionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::FeedPermissionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) project: String, + pub(crate) include_ids: Option<bool>, + pub(crate) exclude_inherited_permissions: Option<bool>, + pub(crate) identity_descriptor: Option<String>, + pub(crate) include_deleted_feeds: Option<bool>, + } + 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); + self + } + #[doc = "Set to true to only return explicitly set permissions on the feed. Default is false."] + pub fn exclude_inherited_permissions(mut self, exclude_inherited_permissions: bool) -> Self { + self.exclude_inherited_permissions = Some(exclude_inherited_permissions); + self + } + #[doc = "Filter permissions to the provided identity."] + pub fn identity_descriptor(mut self, identity_descriptor: impl Into<String>) -> Self { + self.identity_descriptor = Some(identity_descriptor.into()); + self + } + #[doc = "If includeDeletedFeeds is true, then feedId must be specified by name and not by Guid."] + pub fn include_deleted_feeds(mut self, include_deleted_feeds: bool) -> Self { + self.include_deleted_feeds = Some(include_deleted_feeds); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/permissions", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FeedPermissionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::FeedPermissionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod set_feed_permissions { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FeedPermissionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::FeedPermissionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::FeedPermission>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/permissions", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FeedPermissionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::FeedPermissionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_feed_views { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FeedViewList> { + let bytes = self.0.into_body().collect().await?; + let body: models::FeedViewList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/views", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FeedViewList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::FeedViewList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_feed_view { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FeedView> { + let bytes = self.0.into_body().collect().await?; + let body: models::FeedView = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::FeedView, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/views", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FeedView>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::FeedView>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_feed_view { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FeedView> { + let bytes = self.0.into_body().collect().await?; + let body: models::FeedView = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) view_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.view_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FeedView>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::FeedView>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_feed_view { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FeedView> { + let bytes = self.0.into_body().collect().await?; + let body: models::FeedView = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.view_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FeedView>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::FeedView>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_feed_view { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) view_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.view_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod artifact_details { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn query_package_metrics( + &self, + organization: impl Into<String>, + body: impl Into<models::PackageMetricsQuery>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_packages( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `package_id`: The package Id (GUID Id, not the package name)."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn query_package_version_metrics( + &self, + organization: impl Into<String>, + body: impl Into<models::PackageVersionMetricsQuery>, + feed_id: impl Into<String>, + package_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `package_id`: Id of the package (GUID Id, not name)."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_versions( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `package_id`: Id of the package (GUID Id, not name)."] + #[doc = "* `package_version_id`: Id of the package version (GUID Id, not name)."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_version( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_id: impl Into<String>, + package_version_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `package_id`: Id of the package (GUID Id, not name)."] + #[doc = "* `package_version_id`: Id of the package version (GUID Id, not name)."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_version_provenance( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_id: impl Into<String>, + package_version_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `package_id`: Id of the package (GUID Id, not name)."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_badge( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 query_package_metrics { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PackageMetricsList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PackageMetricsList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PackageMetricsQuery, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/packagemetricsbatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PackageMetricsList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PackageMetricsList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_packages { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PackageList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PackageList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) project: String, + pub(crate) protocol_type: Option<String>, + pub(crate) package_name_query: Option<String>, + pub(crate) normalized_package_name: Option<String>, + pub(crate) include_urls: Option<bool>, + pub(crate) include_all_versions: Option<bool>, + pub(crate) is_listed: Option<bool>, + pub(crate) get_top_package_versions: Option<bool>, + pub(crate) is_release: Option<bool>, + pub(crate) include_description: Option<bool>, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) include_deleted: Option<bool>, + pub(crate) is_cached: Option<bool>, + pub(crate) direct_upstream_id: Option<String>, + } + impl RequestBuilder { + #[doc = "One of the supported artifact package types."] + pub fn protocol_type(mut self, protocol_type: impl Into<String>) -> Self { + self.protocol_type = Some(protocol_type.into()); + self + } + #[doc = "Filter to packages that contain the provided string. Characters in the string must conform to the package name constraints."] + pub fn package_name_query(mut self, package_name_query: impl Into<String>) -> Self { + self.package_name_query = Some(package_name_query.into()); + self + } + #[doc = "\\[Obsolete\\] Used for legacy scenarios and may be removed in future versions."] + pub fn normalized_package_name(mut self, normalized_package_name: impl Into<String>) -> Self { + self.normalized_package_name = Some(normalized_package_name.into()); + self + } + #[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 = "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); + self + } + #[doc = "Only applicable for NuGet packages, setting it for other package types will result in a 404. If false, delisted package versions will be returned. Use this to filter the response when include_all_versions is set to true. Default is unset (do not return delisted packages)."] + pub fn is_listed(mut self, is_listed: bool) -> Self { + self.is_listed = Some(is_listed); + self + } + #[doc = "Changes the behavior of $top and $skip to return all versions of each package up to $top. Must be used in conjunction with include_all_versions=true"] + pub fn get_top_package_versions(mut self, get_top_package_versions: bool) -> Self { + self.get_top_package_versions = Some(get_top_package_versions); + self + } + #[doc = "Only applicable for Nuget packages. Use this to filter the response when include_all_versions is set to true. Default is True (only return packages without prerelease versioning)."] + pub fn is_release(mut self, is_release: bool) -> Self { + self.is_release = Some(is_release); + self + } + #[doc = "Return the description for every version of each package in the response. Default is False."] + pub fn include_description(mut self, include_description: bool) -> Self { + self.include_description = Some(include_description); + self + } + #[doc = "Get the top N packages (or package versions where get_top_package_versions=true)"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skip the first N packages (or package versions where get_top_package_versions=true)"] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Return deleted or unpublished versions of packages in the response. Default is False."] + pub fn include_deleted(mut self, include_deleted: bool) -> Self { + self.include_deleted = Some(include_deleted); + self + } + #[doc = "\\[Obsolete\\] Used for legacy scenarios and may be removed in future versions."] + pub fn is_cached(mut self, is_cached: bool) -> Self { + self.is_cached = Some(is_cached); + self + } + #[doc = "Filter results to return packages from a specific upstream."] + pub fn direct_upstream_id(mut self, direct_upstream_id: impl Into<String>) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/packages", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PackageList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PackageList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_package { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_id: String, + pub(crate) project: String, + pub(crate) include_all_versions: Option<bool>, + pub(crate) include_urls: Option<bool>, + pub(crate) is_listed: Option<bool>, + pub(crate) is_release: Option<bool>, + pub(crate) include_deleted: Option<bool>, + pub(crate) include_description: Option<bool>, + } + 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); + self + } + #[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 = "Only applicable for NuGet packages, setting it for other package types will result in a 404. If false, delisted package versions will be returned. Use this to filter the response when include_all_versions is set to true. Default is unset (do not return delisted packages)."] + pub fn is_listed(mut self, is_listed: bool) -> Self { + self.is_listed = Some(is_listed); + self + } + #[doc = "Only applicable for Nuget packages. Use this to filter the response when include_all_versions is set to true. Default is True (only return packages without prerelease versioning)."] + pub fn is_release(mut self, is_release: bool) -> Self { + self.is_release = Some(is_release); + self + } + #[doc = "Return deleted or unpublished versions of packages in the response. Default is False."] + pub fn include_deleted(mut self, include_deleted: bool) -> Self { + self.include_deleted = Some(include_deleted); + self + } + #[doc = "Return the description for every version of each package in the response. Default is False."] + pub fn include_description(mut self, include_description: bool) -> Self { + self.include_description = Some(include_description); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/packages/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod query_package_version_metrics { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PackageVersionMetricsList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PackageVersionMetricsList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versionmetricsbatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PackageVersionMetricsList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PackageVersionMetricsList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_package_versions { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PackageVersionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PackageVersionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_id: String, + pub(crate) project: String, + pub(crate) include_urls: Option<bool>, + pub(crate) is_listed: Option<bool>, + pub(crate) is_deleted: Option<bool>, + } + 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); + self + } + #[doc = "Only applicable for NuGet packages. If false, delisted package versions will be returned."] + pub fn is_listed(mut self, is_listed: bool) -> Self { + self.is_listed = Some(is_listed); + self + } + #[doc = "If set specifies whether to return only deleted or non-deleted versions of packages in the response. Default is unset (return all versions)."] + pub fn is_deleted(mut self, is_deleted: bool) -> Self { + self.is_deleted = Some(is_deleted); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versions", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PackageVersionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PackageVersionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_package_version { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PackageVersion> { + let bytes = self.0.into_body().collect().await?; + let body: models::PackageVersion = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_id: String, + pub(crate) package_version_id: String, + pub(crate) project: String, + pub(crate) include_urls: Option<bool>, + pub(crate) is_listed: Option<bool>, + pub(crate) is_deleted: Option<bool>, + } + 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); + self + } + #[doc = "Only applicable for NuGet packages. If false, delisted package versions will be returned."] + pub fn is_listed(mut self, is_listed: bool) -> Self { + self.is_listed = Some(is_listed); + self + } + #[doc = "This does not have any effect on the requested package version, for other versions returned specifies whether to return only deleted or non-deleted versions of packages in the response. Default is unset (return all versions)."] + pub fn is_deleted(mut self, is_deleted: bool) -> Self { + self.is_deleted = Some(is_deleted); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_id, + &this.package_version_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PackageVersion>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PackageVersion>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_package_version_provenance { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PackageVersionProvenance> { + let bytes = self.0.into_body().collect().await?; + let body: models::PackageVersionProvenance = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/Versions/{}/provenance", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_id, + &this.package_version_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PackageVersionProvenance>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PackageVersionProvenance>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_badge { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/public/packaging/Feeds/{}/Packages/{}/badge", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod recycle_bin { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_recycle_bin_packages( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed"] + #[doc = "* `project`: Project ID or project name"] + pub fn empty_recycle_bin( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `package_id`: The package Id (GUID Id, not the package name)."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_recycle_bin_package( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `package_id`: The package Id (GUID Id, not the package name)."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_recycle_bin_package_versions( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or Id of the feed."] + #[doc = "* `package_id`: The package Id (GUID Id, not the package name)."] + #[doc = "* `package_version_id`: The package version Id 9guid Id, not the version string)."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_recycle_bin_package_version( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_id: impl Into<String>, + package_version_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get_recycle_bin_packages { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_recycle_bin_packages( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed"] - #[doc = "* `project`: Project ID or project name"] - pub fn empty_recycle_bin( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `package_id`: The package Id (GUID Id, not the package name)."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_recycle_bin_package( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `package_id`: The package Id (GUID Id, not the package name)."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_recycle_bin_package_versions( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or Id of the feed."] - #[doc = "* `package_id`: The package Id (GUID Id, not the package name)."] - #[doc = "* `package_version_id`: The package version Id 9guid Id, not the version string)."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_recycle_bin_package_version( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_id: impl Into<String>, - package_version_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get_recycle_bin_packages { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PackageList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) project: String, - pub(crate) protocol_type: Option<String>, - pub(crate) package_name_query: Option<String>, - pub(crate) include_urls: Option<bool>, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) include_all_versions: Option<bool>, - } - impl RequestBuilder { - #[doc = "Type of package (e.g. NuGet, npm, ...)."] - pub fn protocol_type(mut self, protocol_type: impl Into<String>) -> Self { - self.protocol_type = Some(protocol_type.into()); - self - } - #[doc = "Filter to packages matching this name."] - pub fn package_name_query(mut self, package_name_query: impl Into<String>) -> Self { - self.package_name_query = Some(package_name_query.into()); - self - } - #[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 = "Get the top N packages."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Skip the first N packages."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[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); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PackageList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PackageList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod empty_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::OperationReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::OperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::OperationReference>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::OperationReference>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_recycle_bin_package { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_id: String, - pub(crate) project: String, - pub(crate) include_urls: Option<bool>, - } - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(include_urls) = &this.include_urls { - req.url_mut() - .query_pairs_mut() - .append_pair("includeUrls", &include_urls.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_recycle_bin_package_versions { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::RecycleBinPackageVersionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::RecycleBinPackageVersionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_id: String, - pub(crate) project: String, - pub(crate) include_urls: Option<bool>, - } - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}/Versions", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(include_urls) = &this.include_urls { - req.url_mut() - .query_pairs_mut() - .append_pair("includeUrls", &include_urls.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RecycleBinPackageVersionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::RecycleBinPackageVersionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_recycle_bin_package_version { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RecycleBinPackageVersion> { - let bytes = self.0.into_body().collect().await?; - let body: models::RecycleBinPackageVersion = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_id: String, - pub(crate) package_version_id: String, - pub(crate) project: String, - pub(crate) include_urls: Option<bool>, - } - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}/Versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_id, - &this.package_version_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(include_urls) = &this.include_urls { - req.url_mut() - .query_pairs_mut() - .append_pair("includeUrls", &include_urls.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RecycleBinPackageVersion>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::RecycleBinPackageVersion>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PackageList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PackageList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) project: String, + pub(crate) protocol_type: Option<String>, + pub(crate) package_name_query: Option<String>, + pub(crate) include_urls: Option<bool>, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) include_all_versions: Option<bool>, + } + impl RequestBuilder { + #[doc = "Type of package (e.g. NuGet, npm, ...)."] + pub fn protocol_type(mut self, protocol_type: impl Into<String>) -> Self { + self.protocol_type = Some(protocol_type.into()); + self + } + #[doc = "Filter to packages matching this name."] + pub fn package_name_query(mut self, package_name_query: impl Into<String>) -> Self { + self.package_name_query = Some(package_name_query.into()); + self + } + #[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 = "Get the top N packages."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skip the first N packages."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[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); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PackageList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PackageList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod empty_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::OperationReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationReference = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::OperationReference>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::OperationReference>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_recycle_bin_package { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_id: String, + pub(crate) project: String, + pub(crate) include_urls: Option<bool>, + } + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(include_urls) = &this.include_urls { + req + .url_mut() + .query_pairs_mut() + .append_pair("includeUrls", &include_urls.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_recycle_bin_package_versions { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RecycleBinPackageVersionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::RecycleBinPackageVersionList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_id: String, + pub(crate) project: String, + pub(crate) include_urls: Option<bool>, + } + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}/Versions", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(include_urls) = &this.include_urls { + req + .url_mut() + .query_pairs_mut() + .append_pair("includeUrls", &include_urls.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RecycleBinPackageVersionList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::RecycleBinPackageVersionList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_recycle_bin_package_version { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RecycleBinPackageVersion> { + let bytes = self.0.into_body().collect().await?; + let body: models::RecycleBinPackageVersion = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_id: String, + pub(crate) package_version_id: String, + pub(crate) project: String, + pub(crate) include_urls: Option<bool>, + } + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}/Versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_id, + &this.package_version_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(include_urls) = &this.include_urls { + req + .url_mut() + .query_pairs_mut() + .append_pair("includeUrls", &include_urls.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RecycleBinPackageVersion>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RecycleBinPackageVersion>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod retention_policies { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_retention_policy( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Feed retention policy."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn set_retention_policy( + &self, + organization: impl Into<String>, + body: impl Into<models::FeedRetentionPolicy>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_retention_policy( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get_retention_policy { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_retention_policy( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Feed retention policy."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn set_retention_policy( - &self, - organization: impl Into<String>, - body: impl Into<models::FeedRetentionPolicy>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_retention_policy( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get_retention_policy { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FeedRetentionPolicy> { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedRetentionPolicy = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FeedRetentionPolicy>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::FeedRetentionPolicy>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod set_retention_policy { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FeedRetentionPolicy> { - let bytes = self.0.into_body().collect().await?; - let body: models::FeedRetentionPolicy = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::FeedRetentionPolicy, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FeedRetentionPolicy>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::FeedRetentionPolicy>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_retention_policy { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FeedRetentionPolicy> { + let bytes = self.0.into_body().collect().await?; + let body: models::FeedRetentionPolicy = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FeedRetentionPolicy>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::FeedRetentionPolicy>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod set_retention_policy { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FeedRetentionPolicy> { + let bytes = self.0.into_body().collect().await?; + let body: models::FeedRetentionPolicy = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::FeedRetentionPolicy, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FeedRetentionPolicy>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::FeedRetentionPolicy>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_retention_policy { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod provenance { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The feed and metadata for the session"] + #[doc = "* `protocol`: The protocol that the session will target"] + #[doc = "* `project`: Project ID or project name"] + pub fn create_session( + &self, + organization: impl Into<String>, + body: impl Into<models::SessionRequest>, + protocol: impl Into<String>, + project: impl Into<String>, + ) -> create_session::RequestBuilder { + create_session::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + protocol: protocol.into(), + project: project.into(), + } + } + } + pub mod create_session { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The feed and metadata for the session"] - #[doc = "* `protocol`: The protocol that the session will target"] - #[doc = "* `project`: Project ID or project name"] - pub fn create_session( - &self, - organization: impl Into<String>, - body: impl Into<models::SessionRequest>, - protocol: impl Into<String>, - project: impl Into<String>, - ) -> create_session::RequestBuilder { - create_session::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - protocol: protocol.into(), - project: project.into(), - } - } - } - pub mod create_session { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SessionResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::SessionResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::SessionRequest, - pub(crate) protocol: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/provenance/session/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.protocol - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SessionResponse>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::SessionResponse>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SessionResponse> { + let bytes = self.0.into_body().collect().await?; + let body: models::SessionResponse = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::SessionRequest, + pub(crate) protocol: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/provenance/session/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.protocol + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SessionResponse>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SessionResponse>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/artifacts/models.rs b/azure_devops_rust_api/src/artifacts/models.rs index a06f8832..2085d8c9 100644 --- a/azure_devops_rust_api/src/artifacts/models.rs +++ b/azure_devops_rust_api/src/artifacts/models.rs @@ -8,1620 +8,1597 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildPackage { - #[doc = "Display name of the feed."] - #[serde(rename = "feedName", default, skip_serializing_if = "Option::is_none")] - pub feed_name: Option<String>, - #[doc = "Package version description."] - #[serde( - rename = "packageDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub package_description: Option<String>, - #[doc = "Display name of the package."] - #[serde( - rename = "packageName", - default, - skip_serializing_if = "Option::is_none" - )] - pub package_name: Option<String>, - #[doc = "Version of the package."] - #[serde( - rename = "packageVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub package_version: Option<String>, - #[doc = "TFS project id."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "Type of the package."] - #[serde( - rename = "protocolType", - default, - skip_serializing_if = "Option::is_none" - )] - pub protocol_type: Option<String>, + #[doc = "Display name of the feed."] + #[serde(rename = "feedName", default, skip_serializing_if = "Option::is_none")] + pub feed_name: Option<String>, + #[doc = "Package version description."] + #[serde( + rename = "packageDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub package_description: Option<String>, + #[doc = "Display name of the package."] + #[serde( + rename = "packageName", + default, + skip_serializing_if = "Option::is_none" + )] + pub package_name: Option<String>, + #[doc = "Version of the package."] + #[serde( + rename = "packageVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub package_version: Option<String>, + #[doc = "TFS project id."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "Type of the package."] + #[serde( + rename = "protocolType", + default, + skip_serializing_if = "Option::is_none" + )] + pub protocol_type: Option<String>, } impl BuildPackage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A container for artifacts."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Feed { - #[serde(flatten)] - pub feed_core: FeedCore, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "If set, this feed supports generation of package badges."] - #[serde( - rename = "badgesEnabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub badges_enabled: Option<bool>, - #[doc = "The view that the feed administrator has indicated is the default experience for readers."] - #[serde( - rename = "defaultViewId", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_view_id: Option<String>, - #[doc = "The date that this feed was deleted."] - #[serde( - rename = "deletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deleted_date: Option<time::OffsetDateTime>, - #[doc = "A description for the feed. Descriptions must not exceed 255 characters."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "If set, the feed will hide all deleted/unpublished versions"] - #[serde( - rename = "hideDeletedPackageVersions", - default, - skip_serializing_if = "Option::is_none" - )] - pub hide_deleted_package_versions: Option<bool>, - #[doc = "The date that this feed was permanently deleted."] - #[serde( - rename = "permanentDeletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub permanent_deleted_date: Option<time::OffsetDateTime>, - #[doc = "Explicit permissions for the feed."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub permissions: Vec<FeedPermission>, - #[doc = "The date that this feed is scheduled to be permanently deleted."] - #[serde( - rename = "scheduledPermanentDeleteDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub scheduled_permanent_delete_date: Option<time::OffsetDateTime>, - #[doc = "If set, time that the UpstreamEnabled property was changed. Will be null if UpstreamEnabled was never changed after Feed creation."] - #[serde( - rename = "upstreamEnabledChangedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub upstream_enabled_changed_date: Option<time::OffsetDateTime>, - #[doc = "The URL of the base feed in GUID form."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(flatten)] + pub feed_core: FeedCore, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "If set, this feed supports generation of package badges."] + #[serde( + rename = "badgesEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub badges_enabled: Option<bool>, + #[doc = "The view that the feed administrator has indicated is the default experience for readers."] + #[serde( + rename = "defaultViewId", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_view_id: Option<String>, + #[doc = "The date that this feed was deleted."] + #[serde( + rename = "deletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deleted_date: Option<time::OffsetDateTime>, + #[doc = "A description for the feed. Descriptions must not exceed 255 characters."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "If set, the feed will hide all deleted/unpublished versions"] + #[serde( + rename = "hideDeletedPackageVersions", + default, + skip_serializing_if = "Option::is_none" + )] + pub hide_deleted_package_versions: Option<bool>, + #[doc = "The date that this feed was permanently deleted."] + #[serde( + rename = "permanentDeletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub permanent_deleted_date: Option<time::OffsetDateTime>, + #[doc = "Explicit permissions for the feed."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub permissions: Vec<FeedPermission>, + #[doc = "The date that this feed is scheduled to be permanently deleted."] + #[serde( + rename = "scheduledPermanentDeleteDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub scheduled_permanent_delete_date: Option<time::OffsetDateTime>, + #[doc = "If set, time that the UpstreamEnabled property was changed. Will be null if UpstreamEnabled was never changed after Feed creation."] + #[serde( + rename = "upstreamEnabledChangedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub upstream_enabled_changed_date: Option<time::OffsetDateTime>, + #[doc = "The URL of the base feed in GUID form."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Feed { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedBatchData { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<FeedBatchOperationData>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option<feed_batch_data::Operation>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<FeedBatchOperationData>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option<feed_batch_data::Operation>, } impl FeedBatchData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod feed_batch_data { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Operation { - #[serde(rename = "saveCachedPackages")] - SaveCachedPackages, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Operation { + #[serde(rename = "saveCachedPackages")] + SaveCachedPackages, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedBatchOperationData {} impl FeedBatchOperationData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A container that encapsulates the state of the feed after a create, update, or delete."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedChange { - #[doc = "The type of operation."] - #[serde( - rename = "changeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_type: Option<feed_change::ChangeType>, - #[doc = "A container for artifacts."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub feed: Option<Feed>, - #[doc = "A token that identifies the next change in the log of changes."] - #[serde( - rename = "feedContinuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub feed_continuation_token: Option<i64>, - #[doc = "A token that identifies the latest package change for this feed. This can be used to quickly determine if there have been any changes to packages in a specific feed."] - #[serde( - rename = "latestPackageContinuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_package_continuation_token: Option<i64>, + #[doc = "The type of operation."] + #[serde( + rename = "changeType", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_type: Option<feed_change::ChangeType>, + #[doc = "A container for artifacts."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub feed: Option<Feed>, + #[doc = "A token that identifies the next change in the log of changes."] + #[serde( + rename = "feedContinuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub feed_continuation_token: Option<i64>, + #[doc = "A token that identifies the latest package change for this feed. This can be used to quickly determine if there have been any changes to packages in a specific feed."] + #[serde( + rename = "latestPackageContinuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_package_continuation_token: Option<i64>, } impl FeedChange { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod feed_change { - use super::*; - #[doc = "The type of operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ChangeType { - #[serde(rename = "addOrUpdate")] - AddOrUpdate, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "permanentDelete")] - PermanentDelete, - } + use super::*; + #[doc = "The type of operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ChangeType { + #[serde(rename = "addOrUpdate")] + AddOrUpdate, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "permanentDelete")] + PermanentDelete, + } } #[doc = "A result set containing the feed changes for the range that was requested."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedChangesResponse { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "The number of changes in this set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "A container that encapsulates the state of the feed after a create, update, or delete."] - #[serde( - rename = "feedChanges", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub feed_changes: Vec<FeedChange>, - #[doc = "When iterating through the log of changes this value indicates the value that should be used for the next continuation token."] - #[serde( - rename = "nextFeedContinuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub next_feed_continuation_token: Option<i64>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "The number of changes in this set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "A container that encapsulates the state of the feed after a create, update, or delete."] + #[serde( + rename = "feedChanges", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub feed_changes: Vec<FeedChange>, + #[doc = "When iterating through the log of changes this value indicates the value that should be used for the next continuation token."] + #[serde( + rename = "nextFeedContinuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub next_feed_continuation_token: Option<i64>, } impl FeedChangesResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An object that contains all of the settings for a specific feed."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedCore { - #[doc = "Supported capabilities of a feed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub capabilities: Option<feed_core::Capabilities>, - #[doc = "This will either be the feed GUID or the feed GUID and view GUID depending on how the feed was accessed."] - #[serde( - rename = "fullyQualifiedId", - default, - skip_serializing_if = "Option::is_none" - )] - pub fully_qualified_id: Option<String>, - #[doc = "Full name of the view, in feed@view format."] - #[serde( - rename = "fullyQualifiedName", - default, - skip_serializing_if = "Option::is_none" - )] - pub fully_qualified_name: Option<String>, - #[doc = "A GUID that uniquely identifies this feed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "If set, all packages in the feed are immutable. It is important to note that feed views are immutable; therefore, this flag will always be set for views."] - #[serde( - rename = "isReadOnly", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_read_only: Option<bool>, - #[doc = "A name for the feed. feed names must follow these rules: <list type=\"bullet\"><item><description> Must not exceed 64 characters </description></item><item><description> Must not contain whitespaces </description></item><item><description> Must not start with an underscore or a period </description></item><item><description> Must not end with a period </description></item><item><description> Must not contain any of the following illegal characters: <!\\[CDATA\\[ @, ~, ;, {, }, \\\\, +, =, <, >, |, /, \\\\\\\\, ?, :, &, $, *, \\\", #, \\[, \\] \\]\\]></description></item></list>"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, - #[doc = "This should always be true. Setting to false will override all sources in UpstreamSources."] - #[serde( - rename = "upstreamEnabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub upstream_enabled: Option<bool>, - #[doc = "A list of sources that this feed will fetch packages from. An empty list indicates that this feed will not search any additional sources for packages."] - #[serde( - rename = "upstreamSources", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub upstream_sources: Vec<UpstreamSource>, - #[doc = "A view on top of a feed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub view: Option<FeedView>, - #[doc = "View Id."] - #[serde(rename = "viewId", default, skip_serializing_if = "Option::is_none")] - pub view_id: Option<String>, - #[doc = "View name."] - #[serde(rename = "viewName", default, skip_serializing_if = "Option::is_none")] - pub view_name: Option<String>, + #[doc = "Supported capabilities of a feed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: Option<feed_core::Capabilities>, + #[doc = "This will either be the feed GUID or the feed GUID and view GUID depending on how the feed was accessed."] + #[serde( + rename = "fullyQualifiedId", + default, + skip_serializing_if = "Option::is_none" + )] + pub fully_qualified_id: Option<String>, + #[doc = "Full name of the view, in feed@view format."] + #[serde( + rename = "fullyQualifiedName", + default, + skip_serializing_if = "Option::is_none" + )] + pub fully_qualified_name: Option<String>, + #[doc = "A GUID that uniquely identifies this feed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "If set, all packages in the feed are immutable. It is important to note that feed views are immutable; therefore, this flag will always be set for views."] + #[serde( + rename = "isReadOnly", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_read_only: Option<bool>, + #[doc = "A name for the feed. feed names must follow these rules: <list type=\"bullet\"><item><description> Must not exceed 64 characters </description></item><item><description> Must not contain whitespaces </description></item><item><description> Must not start with an underscore or a period </description></item><item><description> Must not end with a period </description></item><item><description> Must not contain any of the following illegal characters: <!\\[CDATA\\[ @, ~, ;, {, }, \\\\, +, =, <, >, |, /, \\\\\\\\, ?, :, &, $, *, \\\", #, \\[, \\] \\]\\]></description></item></list>"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, + #[doc = "OBSOLETE: This should always be true. Setting to false will override all sources in UpstreamSources."] + #[serde( + rename = "upstreamEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub upstream_enabled: Option<bool>, + #[doc = "A list of sources that this feed will fetch packages from. An empty list indicates that this feed will not search any additional sources for packages."] + #[serde( + rename = "upstreamSources", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub upstream_sources: Vec<UpstreamSource>, + #[doc = "A view on top of a feed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub view: Option<FeedView>, + #[doc = "View Id."] + #[serde(rename = "viewId", default, skip_serializing_if = "Option::is_none")] + pub view_id: Option<String>, + #[doc = "View name."] + #[serde(rename = "viewName", default, skip_serializing_if = "Option::is_none")] + pub view_name: Option<String>, } impl FeedCore { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod feed_core { - use super::*; - #[doc = "Supported capabilities of a feed."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Capabilities { - #[serde(rename = "none")] - None, - #[serde(rename = "upstreamV2")] - UpstreamV2, - #[serde(rename = "underMaintenance")] - UnderMaintenance, - #[serde(rename = "defaultCapabilities")] - DefaultCapabilities, - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeedIdsResult { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, -} -impl FeedIdsResult { - pub fn new() -> Self { - Self::default() - } + use super::*; + #[doc = "Supported capabilities of a feed."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Capabilities { + #[serde(rename = "none")] + None, + #[serde(rename = "upstreamV2")] + UpstreamV2, + #[serde(rename = "underMaintenance")] + UnderMaintenance, + #[serde(rename = "defaultCapabilities")] + DefaultCapabilities, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Feed>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Feed>, } impl FeedList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Permissions for a feed."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedPermission { - #[doc = "Display name for the identity."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Identity associated with this role."] - #[serde( - rename = "identityDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_descriptor: Option<String>, - #[doc = "Id of the identity associated with this role."] - #[serde( - rename = "identityId", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_id: Option<String>, - #[doc = "Boolean indicating whether the role is inherited or set directly."] - #[serde( - rename = "isInheritedRole", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_inherited_role: Option<bool>, - #[doc = "The role for this identity on a feed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub role: Option<feed_permission::Role>, + #[doc = "Display name for the identity."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Identity associated with this role."] + #[serde( + rename = "identityDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_descriptor: Option<String>, + #[doc = "Id of the identity associated with this role."] + #[serde( + rename = "identityId", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_id: Option<String>, + #[doc = "Boolean indicating whether the role is inherited or set directly."] + #[serde( + rename = "isInheritedRole", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_inherited_role: Option<bool>, + #[doc = "The role for this identity on a feed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub role: Option<feed_permission::Role>, } impl FeedPermission { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod feed_permission { - use super::*; - #[doc = "The role for this identity on a feed."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Role { - #[serde(rename = "custom")] - Custom, - #[serde(rename = "none")] - None, - #[serde(rename = "reader")] - Reader, - #[serde(rename = "contributor")] - Contributor, - #[serde(rename = "administrator")] - Administrator, - #[serde(rename = "collaborator")] - Collaborator, - } + use super::*; + #[doc = "The role for this identity on a feed."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Role { + #[serde(rename = "custom")] + Custom, + #[serde(rename = "none")] + None, + #[serde(rename = "reader")] + Reader, + #[serde(rename = "contributor")] + Contributor, + #[serde(rename = "administrator")] + Administrator, + #[serde(rename = "collaborator")] + Collaborator, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedPermissionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<FeedPermission>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<FeedPermission>, } impl FeedPermissionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Retention policy settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedRetentionPolicy { - #[doc = "This attribute is deprecated and is not honoured by retention"] - #[serde( - rename = "ageLimitInDays", - default, - skip_serializing_if = "Option::is_none" - )] - pub age_limit_in_days: Option<i32>, - #[doc = "Maximum versions to preserve per package and package type."] - #[serde( - rename = "countLimit", - default, - skip_serializing_if = "Option::is_none" - )] - pub count_limit: Option<i32>, - #[doc = "Number of days to preserve a package version after its latest download."] - #[serde( - rename = "daysToKeepRecentlyDownloadedPackages", - default, - skip_serializing_if = "Option::is_none" - )] - pub days_to_keep_recently_downloaded_packages: Option<i32>, + #[doc = "This attribute is deprecated and is not honoured by retention"] + #[serde( + rename = "ageLimitInDays", + default, + skip_serializing_if = "Option::is_none" + )] + pub age_limit_in_days: Option<i32>, + #[doc = "Maximum versions to preserve per package and package type."] + #[serde( + rename = "countLimit", + default, + skip_serializing_if = "Option::is_none" + )] + pub count_limit: Option<i32>, + #[doc = "Number of days to preserve a package version after its latest download."] + #[serde( + rename = "daysToKeepRecentlyDownloadedPackages", + default, + skip_serializing_if = "Option::is_none" + )] + pub days_to_keep_recently_downloaded_packages: Option<i32>, } impl FeedRetentionPolicy { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Update a feed definition with these new values."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedUpdate { - #[doc = "If set, the feed will allow upload of packages that exist on the upstream"] - #[serde( - rename = "allowUpstreamNameConflict", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_upstream_name_conflict: Option<bool>, - #[doc = "If set, this feed supports generation of package badges."] - #[serde( - rename = "badgesEnabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub badges_enabled: Option<bool>, - #[doc = "The view that the feed administrator has indicated is the default experience for readers."] - #[serde( - rename = "defaultViewId", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_view_id: Option<String>, - #[doc = "A description for the feed. Descriptions must not exceed 255 characters."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "If set, feed will hide all deleted/unpublished versions"] - #[serde( - rename = "hideDeletedPackageVersions", - default, - skip_serializing_if = "Option::is_none" - )] - pub hide_deleted_package_versions: Option<bool>, - #[doc = "A GUID that uniquely identifies this feed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "A name for the feed. feed names must follow these rules: <list type=\"bullet\"><item><description> Must not exceed 64 characters </description></item><item><description> Must not contain whitespaces </description></item><item><description> Must not start with an underscore or a period </description></item><item><description> Must not end with a period </description></item><item><description> Must not contain any of the following illegal characters: <!\\[CDATA\\[ @, ~, ;, {, }, \\\\, +, =, <, >, |, /, \\\\\\\\, ?, :, &, $, *, \\\", #, \\[, \\] \\]\\]></description></item></list>"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "If set, the feed can proxy packages from an upstream feed"] - #[serde( - rename = "upstreamEnabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub upstream_enabled: Option<bool>, - #[doc = "A list of sources that this feed will fetch packages from. An empty list indicates that this feed will not search any additional sources for packages."] - #[serde( - rename = "upstreamSources", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub upstream_sources: Vec<UpstreamSource>, + #[doc = "If set, the feed will allow upload of packages that exist on the upstream"] + #[serde( + rename = "allowUpstreamNameConflict", + default, + skip_serializing_if = "Option::is_none" + )] + pub allow_upstream_name_conflict: Option<bool>, + #[doc = "If set, this feed supports generation of package badges."] + #[serde( + rename = "badgesEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub badges_enabled: Option<bool>, + #[doc = "The view that the feed administrator has indicated is the default experience for readers."] + #[serde( + rename = "defaultViewId", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_view_id: Option<String>, + #[doc = "A description for the feed. Descriptions must not exceed 255 characters."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "If set, feed will hide all deleted/unpublished versions"] + #[serde( + rename = "hideDeletedPackageVersions", + default, + skip_serializing_if = "Option::is_none" + )] + pub hide_deleted_package_versions: Option<bool>, + #[doc = "A GUID that uniquely identifies this feed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "A name for the feed. feed names must follow these rules: <list type=\"bullet\"><item><description> Must not exceed 64 characters </description></item><item><description> Must not contain whitespaces </description></item><item><description> Must not start with an underscore or a period </description></item><item><description> Must not end with a period </description></item><item><description> Must not contain any of the following illegal characters: <!\\[CDATA\\[ @, ~, ;, {, }, \\\\, +, =, <, >, |, /, \\\\\\\\, ?, :, &, $, *, \\\", #, \\[, \\] \\]\\]></description></item></list>"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "OBSOLETE: If set, the feed can proxy packages from an upstream feed"] + #[serde( + rename = "upstreamEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub upstream_enabled: Option<bool>, + #[doc = "A list of sources that this feed will fetch packages from. An empty list indicates that this feed will not search any additional sources for packages."] + #[serde( + rename = "upstreamSources", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub upstream_sources: Vec<UpstreamSource>, } impl FeedUpdate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A view on top of a feed."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedView { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Id of the view."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the view."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Type of view."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<feed_view::Type>, - #[doc = "Url of the view."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Visibility status of the view."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub visibility: Option<feed_view::Visibility>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Id of the view."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the view."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Type of view."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<feed_view::Type>, + #[doc = "Url of the view."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Visibility status of the view."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub visibility: Option<feed_view::Visibility>, } impl FeedView { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod feed_view { - use super::*; - #[doc = "Type of view."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "none")] - None, - #[serde(rename = "release")] - Release, - #[serde(rename = "implicit")] - Implicit, - } - #[doc = "Visibility status of the view."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Visibility { - #[serde(rename = "private")] - Private, - #[serde(rename = "collection")] - Collection, - #[serde(rename = "organization")] - Organization, - #[serde(rename = "aadTenant")] - AadTenant, - } + use super::*; + #[doc = "Type of view."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "none")] + None, + #[serde(rename = "release")] + Release, + #[serde(rename = "implicit")] + Implicit, + } + #[doc = "Visibility status of the view."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Visibility { + #[serde(rename = "private")] + Private, + #[serde(rename = "collection")] + Collection, + #[serde(rename = "organization")] + Organization, + #[serde(rename = "aadTenant")] + AadTenant, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedViewList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<FeedView>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<FeedView>, } impl FeedViewList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Permissions for feed service-wide operations such as the creation of new feeds."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GlobalPermission { - #[doc = "Identity of the user with the provided Role."] - #[serde( - rename = "identityDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_descriptor: Option<String>, - #[doc = "IdentityId corresponding to the IdentityDescriptor"] - #[serde( - rename = "identityId", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_id: Option<String>, - #[doc = "Role associated with the Identity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub role: Option<global_permission::Role>, + #[doc = "Identity of the user with the provided Role."] + #[serde( + rename = "identityDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_descriptor: Option<String>, + #[doc = "IdentityId corresponding to the IdentityDescriptor"] + #[serde( + rename = "identityId", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_id: Option<String>, + #[doc = "Role associated with the Identity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub role: Option<global_permission::Role>, } impl GlobalPermission { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod global_permission { - use super::*; - #[doc = "Role associated with the Identity."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Role { - #[serde(rename = "custom")] - Custom, - #[serde(rename = "none")] - None, - #[serde(rename = "feedCreator")] - FeedCreator, - #[serde(rename = "administrator")] - Administrator, - } + use super::*; + #[doc = "Role associated with the Identity."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Role { + #[serde(rename = "custom")] + Custom, + #[serde(rename = "none")] + None, + #[serde(rename = "feedCreator")] + FeedCreator, + #[serde(rename = "administrator")] + Administrator, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GlobalPermissionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GlobalPermission>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GlobalPermission>, } impl GlobalPermissionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An Identity descriptor is a wrapper for the identity type (Windows SID, Passport) along with a unique identifier such as the SID or PUID."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityDescriptor { - #[doc = "The unique identifier for this identity, not exceeding 256 chars, which will be persisted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, - #[doc = "Type of descriptor (for example, Windows, Passport, etc.)."] - #[serde( - rename = "identityType", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_type: Option<String>, + #[doc = "The unique identifier for this identity, not exceeding 256 chars, which will be persisted."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, + #[doc = "Type of descriptor (for example, Windows, Passport, etc.)."] + #[serde( + rename = "identityType", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_type: Option<String>, } impl IdentityDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for JSON Patch Operations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchDocument {} impl JsonPatchDocument { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for a JSON Patch operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchOperation { - #[doc = "The path to copy from for the Move/Copy operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub from: Option<String>, - #[doc = "The patch operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub op: Option<json_patch_operation::Op>, - #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "The value for the operation. This is either a primitive or a JToken."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = "The path to copy from for the Move/Copy operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub from: Option<String>, + #[doc = "The patch operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub op: Option<json_patch_operation::Op>, + #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "The value for the operation. This is either a primitive or a JToken."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl JsonPatchOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod json_patch_operation { - use super::*; - #[doc = "The patch operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Op { - #[serde(rename = "add")] - Add, - #[serde(rename = "remove")] - Remove, - #[serde(rename = "replace")] - Replace, - #[serde(rename = "move")] - Move, - #[serde(rename = "copy")] - Copy, - #[serde(rename = "test")] - Test, - } + use super::*; + #[doc = "The patch operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Op { + #[serde(rename = "add")] + Add, + #[serde(rename = "remove")] + Remove, + #[serde(rename = "replace")] + Replace, + #[serde(rename = "move")] + Move, + #[serde(rename = "copy")] + Copy, + #[serde(rename = "test")] + Test, + } } #[doc = "Core data about any package, including its id and version information and basic state."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MinimalPackageVersion { - #[doc = "Upstream source this package was ingested from."] - #[serde( - rename = "directUpstreamSourceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub direct_upstream_source_id: Option<String>, - #[doc = "Id for the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "\\[Obsolete\\] Used for legacy scenarios and may be removed in future versions."] - #[serde( - rename = "isCachedVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_cached_version: Option<bool>, - #[doc = "True if this package has been deleted."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "True if this is the latest version of the package by package type sort order."] - #[serde(rename = "isLatest", default, skip_serializing_if = "Option::is_none")] - pub is_latest: Option<bool>, - #[doc = "(NuGet and Cargo Only) True if this package is listed."] - #[serde(rename = "isListed", default, skip_serializing_if = "Option::is_none")] - pub is_listed: Option<bool>, - #[doc = "Normalized version using normalization rules specific to a package type."] - #[serde( - rename = "normalizedVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub normalized_version: Option<String>, - #[doc = "Package description."] - #[serde( - rename = "packageDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub package_description: Option<String>, - #[doc = "UTC Date the package was published to the service."] - #[serde( - rename = "publishDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub publish_date: Option<time::OffsetDateTime>, - #[doc = "Internal storage id."] - #[serde(rename = "storageId", default, skip_serializing_if = "Option::is_none")] - pub storage_id: Option<String>, - #[doc = "Display version."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, - #[doc = "List of views containing this package version."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub views: Vec<FeedView>, + #[doc = "Upstream source this package was ingested from."] + #[serde( + rename = "directUpstreamSourceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub direct_upstream_source_id: Option<String>, + #[doc = "Id for the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "\\[Obsolete\\] Used for legacy scenarios and may be removed in future versions."] + #[serde( + rename = "isCachedVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_cached_version: Option<bool>, + #[doc = "True if this package has been deleted."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "True if this is the latest version of the package by package type sort order."] + #[serde(rename = "isLatest", default, skip_serializing_if = "Option::is_none")] + pub is_latest: Option<bool>, + #[doc = "(NuGet Only) True if this package is listed."] + #[serde(rename = "isListed", default, skip_serializing_if = "Option::is_none")] + pub is_listed: Option<bool>, + #[doc = "Normalized version using normalization rules specific to a package type."] + #[serde( + rename = "normalizedVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub normalized_version: Option<String>, + #[doc = "Package description."] + #[serde( + rename = "packageDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub package_description: Option<String>, + #[doc = "UTC Date the package was published to the service."] + #[serde( + rename = "publishDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub publish_date: Option<time::OffsetDateTime>, + #[doc = "Internal storage id."] + #[serde(rename = "storageId", default, skip_serializing_if = "Option::is_none")] + pub storage_id: Option<String>, + #[doc = "Display version."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, + #[doc = "List of views containing this package version."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub views: Vec<FeedView>, } impl MinimalPackageVersion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference for an async operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationReference { - #[doc = "Unique identifier for the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Unique identifier for the plugin."] - #[serde(rename = "pluginId", default, skip_serializing_if = "Option::is_none")] - pub plugin_id: Option<String>, - #[doc = "The current status of the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<operation_reference::Status>, - #[doc = "URL to get the full operation object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Unique identifier for the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Unique identifier for the plugin."] + #[serde(rename = "pluginId", default, skip_serializing_if = "Option::is_none")] + pub plugin_id: Option<String>, + #[doc = "The current status of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<operation_reference::Status>, + #[doc = "URL to get the full operation object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl OperationReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod operation_reference { - use super::*; - #[doc = "The current status of the operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "notSet")] - NotSet, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "cancelled")] - Cancelled, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - } + use super::*; + #[doc = "The current status of the operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "notSet")] + NotSet, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "cancelled")] + Cancelled, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + } } #[doc = "A package, which is a container for one or more package versions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Package { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Id of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Used for legacy scenarios and may be removed in future versions."] - #[serde(rename = "isCached", default, skip_serializing_if = "Option::is_none")] - pub is_cached: Option<bool>, - #[doc = "The display name of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The normalized name representing the identity of this package within its package type."] - #[serde( - rename = "normalizedName", - default, - skip_serializing_if = "Option::is_none" - )] - pub normalized_name: Option<String>, - #[doc = "Type of the package."] - #[serde( - rename = "protocolType", - default, - skip_serializing_if = "Option::is_none" - )] - pub protocol_type: Option<String>, - #[doc = "\\[Obsolete\\] - this field is unused and will be removed in a future release."] - #[serde(rename = "starCount", default, skip_serializing_if = "Option::is_none")] - pub star_count: Option<i32>, - #[doc = "Url for this package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "All versions for this package within its feed."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub versions: Vec<MinimalPackageVersion>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Id of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Used for legacy scenarios and may be removed in future versions."] + #[serde(rename = "isCached", default, skip_serializing_if = "Option::is_none")] + pub is_cached: Option<bool>, + #[doc = "The display name of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The normalized name representing the identity of this package within its package type."] + #[serde( + rename = "normalizedName", + default, + skip_serializing_if = "Option::is_none" + )] + pub normalized_name: Option<String>, + #[doc = "Type of the package."] + #[serde( + rename = "protocolType", + default, + skip_serializing_if = "Option::is_none" + )] + pub protocol_type: Option<String>, + #[doc = "\\[Obsolete\\] - this field is unused and will be removed in a future release."] + #[serde(rename = "starCount", default, skip_serializing_if = "Option::is_none")] + pub star_count: Option<i32>, + #[doc = "Url for this package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "All versions for this package within its feed."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub versions: Vec<MinimalPackageVersion>, } impl Package { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A single change to a feed's packages."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageChange { - #[doc = "A package, which is a container for one or more package versions."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub package: Option<Package>, - #[doc = "A change to a single package version."] - #[serde( - rename = "packageVersionChange", - default, - skip_serializing_if = "Option::is_none" - )] - pub package_version_change: Option<PackageVersionChange>, + #[doc = "A package, which is a container for one or more package versions."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub package: Option<Package>, + #[doc = "A change to a single package version."] + #[serde( + rename = "packageVersionChange", + default, + skip_serializing_if = "Option::is_none" + )] + pub package_version_change: Option<PackageVersionChange>, } impl PackageChange { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A set of change operations to a feed's packages."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageChangesResponse { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Number of changes in this batch."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Token that should be used in future calls for this feed to retrieve new changes."] - #[serde( - rename = "nextPackageContinuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub next_package_continuation_token: Option<i64>, - #[doc = "List of changes."] - #[serde( - rename = "packageChanges", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub package_changes: Vec<PackageChange>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Number of changes in this batch."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Token that should be used in future calls for this feed to retrieve new changes."] + #[serde( + rename = "nextPackageContinuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub next_package_continuation_token: Option<i64>, + #[doc = "List of changes."] + #[serde( + rename = "packageChanges", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub package_changes: Vec<PackageChange>, } impl PackageChangesResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A dependency on another package version."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageDependency { - #[doc = "Dependency package group (an optional classification within some package types)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub group: Option<String>, - #[doc = "Dependency package name."] - #[serde( - rename = "packageName", - default, - skip_serializing_if = "Option::is_none" - )] - pub package_name: Option<String>, - #[doc = "Dependency package version range."] - #[serde( - rename = "versionRange", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_range: Option<String>, + #[doc = "Dependency package group (an optional classification within some package types)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option<String>, + #[doc = "Dependency package name."] + #[serde( + rename = "packageName", + default, + skip_serializing_if = "Option::is_none" + )] + pub package_name: Option<String>, + #[doc = "Dependency package version range."] + #[serde( + rename = "versionRange", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_range: Option<String>, } impl PackageDependency { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A package file for a specific package version, only relevant to package types that contain multiple files per version."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageFile { - #[doc = "Hierarchical representation of files."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub children: Vec<PackageFile>, - #[doc = "File name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Extended metadata for a specific package type."] - #[serde( - rename = "protocolMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub protocol_metadata: Option<ProtocolMetadata>, + #[doc = "Hierarchical representation of files."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub children: Vec<PackageFile>, + #[doc = "File name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Extended metadata for a specific package type."] + #[serde( + rename = "protocolMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub protocol_metadata: Option<ProtocolMetadata>, } impl PackageFile { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Package>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Package>, } impl PackageList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "All metrics for a certain package id"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageMetrics { - #[doc = "Total count of downloads per package id."] - #[serde( - rename = "downloadCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub download_count: Option<f64>, - #[doc = "Number of downloads per unique user per package id."] - #[serde( - rename = "downloadUniqueUsers", - default, - skip_serializing_if = "Option::is_none" - )] - pub download_unique_users: Option<f64>, - #[doc = "UTC date and time when package was last downloaded."] - #[serde( - rename = "lastDownloaded", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_downloaded: Option<time::OffsetDateTime>, - #[doc = "Package id."] - #[serde(rename = "packageId", default, skip_serializing_if = "Option::is_none")] - pub package_id: Option<String>, + #[doc = "Total count of downloads per package id."] + #[serde( + rename = "downloadCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub download_count: Option<f64>, + #[doc = "Number of downloads per unique user per package id."] + #[serde( + rename = "downloadUniqueUsers", + default, + skip_serializing_if = "Option::is_none" + )] + pub download_unique_users: Option<f64>, + #[doc = "UTC date and time when package was last downloaded."] + #[serde( + rename = "lastDownloaded", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_downloaded: Option<time::OffsetDateTime>, + #[doc = "Package id."] + #[serde(rename = "packageId", default, skip_serializing_if = "Option::is_none")] + pub package_id: Option<String>, } impl PackageMetrics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageMetricsList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<PackageMetrics>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<PackageMetrics>, } impl PackageMetricsList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Query to get package metrics"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageMetricsQuery { - #[doc = "List of package ids"] - #[serde( - rename = "packageIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub package_ids: Vec<String>, + #[doc = "List of package ids"] + #[serde( + rename = "packageIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub package_ids: Vec<String>, } impl PackageMetricsQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A specific version of a package."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageVersion { - #[serde(flatten)] - pub minimal_package_version: MinimalPackageVersion, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Package version author."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<String>, - #[doc = "UTC date that this package version was deleted."] - #[serde( - rename = "deletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deleted_date: Option<time::OffsetDateTime>, - #[doc = "List of dependencies for this package version."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dependencies: Vec<PackageDependency>, - #[doc = "Package version description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Files associated with this package version, only relevant for multi-file package types."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub files: Vec<PackageFile>, - #[doc = "Other versions of this package."] - #[serde( - rename = "otherVersions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub other_versions: Vec<MinimalPackageVersion>, - #[doc = "Extended metadata for a specific package type."] - #[serde( - rename = "protocolMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub protocol_metadata: Option<ProtocolMetadata>, - #[doc = "List of upstream sources through which a package version moved to land in this feed."] - #[serde( - rename = "sourceChain", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub source_chain: Vec<UpstreamSource>, - #[doc = "Package version summary."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub summary: Option<String>, - #[doc = "Package version tags."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[doc = "Package version url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(flatten)] + pub minimal_package_version: MinimalPackageVersion, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Package version author."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<String>, + #[doc = "UTC date that this package version was deleted."] + #[serde( + rename = "deletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deleted_date: Option<time::OffsetDateTime>, + #[doc = "List of dependencies for this package version."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dependencies: Vec<PackageDependency>, + #[doc = "Package version description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Files associated with this package version, only relevant for multi-file package types."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub files: Vec<PackageFile>, + #[doc = "Other versions of this package."] + #[serde( + rename = "otherVersions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub other_versions: Vec<MinimalPackageVersion>, + #[doc = "Extended metadata for a specific package type."] + #[serde( + rename = "protocolMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub protocol_metadata: Option<ProtocolMetadata>, + #[doc = "List of upstream sources through which a package version moved to land in this feed."] + #[serde( + rename = "sourceChain", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub source_chain: Vec<UpstreamSource>, + #[doc = "Package version summary."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub summary: Option<String>, + #[doc = "Package version tags."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[doc = "Package version url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl PackageVersion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A change to a single package version."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageVersionChange { - #[doc = "The type of change that was performed."] - #[serde( - rename = "changeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_type: Option<package_version_change::ChangeType>, - #[doc = "Token marker for this change, allowing the caller to send this value back to the service and receive changes beyond this one."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<i64>, - #[doc = "A specific version of a package."] - #[serde( - rename = "packageVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub package_version: Option<PackageVersion>, + #[doc = "The type of change that was performed."] + #[serde( + rename = "changeType", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_type: Option<package_version_change::ChangeType>, + #[doc = "Token marker for this change, allowing the caller to send this value back to the service and receive changes beyond this one."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<i64>, + #[doc = "A specific version of a package."] + #[serde( + rename = "packageVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub package_version: Option<PackageVersion>, } impl PackageVersionChange { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod package_version_change { - use super::*; - #[doc = "The type of change that was performed."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ChangeType { - #[serde(rename = "addOrUpdate")] - AddOrUpdate, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "permanentDelete")] - PermanentDelete, - } + use super::*; + #[doc = "The type of change that was performed."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ChangeType { + #[serde(rename = "addOrUpdate")] + AddOrUpdate, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "permanentDelete")] + PermanentDelete, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageVersionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<PackageVersion>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<PackageVersion>, } impl PackageVersionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "All metrics for a certain package version id"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageVersionMetrics { - #[doc = "Total count of downloads per package version id."] - #[serde( - rename = "downloadCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub download_count: Option<f64>, - #[doc = "Number of downloads per unique user per package version id."] - #[serde( - rename = "downloadUniqueUsers", - default, - skip_serializing_if = "Option::is_none" - )] - pub download_unique_users: Option<f64>, - #[doc = "UTC date and time when package version was last downloaded."] - #[serde( - rename = "lastDownloaded", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_downloaded: Option<time::OffsetDateTime>, - #[doc = "Package id."] - #[serde(rename = "packageId", default, skip_serializing_if = "Option::is_none")] - pub package_id: Option<String>, - #[doc = "Package version id."] - #[serde( - rename = "packageVersionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub package_version_id: Option<String>, + #[doc = "Total count of downloads per package version id."] + #[serde( + rename = "downloadCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub download_count: Option<f64>, + #[doc = "Number of downloads per unique user per package version id."] + #[serde( + rename = "downloadUniqueUsers", + default, + skip_serializing_if = "Option::is_none" + )] + pub download_unique_users: Option<f64>, + #[doc = "UTC date and time when package version was last downloaded."] + #[serde( + rename = "lastDownloaded", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_downloaded: Option<time::OffsetDateTime>, + #[doc = "Package id."] + #[serde(rename = "packageId", default, skip_serializing_if = "Option::is_none")] + pub package_id: Option<String>, + #[doc = "Package version id."] + #[serde( + rename = "packageVersionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub package_version_id: Option<String>, } impl PackageVersionMetrics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageVersionMetricsList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<PackageVersionMetrics>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<PackageVersionMetrics>, } impl PackageVersionMetricsList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Query to get package version metrics"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageVersionMetricsQuery { - #[doc = "List of package version ids"] - #[serde( - rename = "packageVersionIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub package_version_ids: Vec<String>, + #[doc = "List of package version ids"] + #[serde( + rename = "packageVersionIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub package_version_ids: Vec<String>, } impl PackageVersionMetricsQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Provenance for a published package version"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageVersionProvenance { - #[doc = "Name or Id of the feed."] - #[serde(rename = "feedId", default, skip_serializing_if = "Option::is_none")] - pub feed_id: Option<String>, - #[doc = "Id of the package (GUID Id, not name)."] - #[serde(rename = "packageId", default, skip_serializing_if = "Option::is_none")] - pub package_id: Option<String>, - #[doc = "Id of the package version (GUID Id, not name)."] - #[serde( - rename = "packageVersionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub package_version_id: Option<String>, - #[doc = "Data about the origin of a published package"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub provenance: Option<Provenance>, + #[doc = "Name or Id of the feed."] + #[serde(rename = "feedId", default, skip_serializing_if = "Option::is_none")] + pub feed_id: Option<String>, + #[doc = "Id of the package (GUID Id, not name)."] + #[serde(rename = "packageId", default, skip_serializing_if = "Option::is_none")] + pub package_id: Option<String>, + #[doc = "Id of the package version (GUID Id, not name)."] + #[serde( + rename = "packageVersionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub package_version_id: Option<String>, + #[doc = "Data about the origin of a published package"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provenance: Option<Provenance>, } impl PackageVersionProvenance { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectReference { - #[doc = "Gets or sets id of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Gets or sets name of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets visibility of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub visibility: Option<String>, + #[doc = "Gets or sets id of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Gets or sets name of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets visibility of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub visibility: Option<String>, } impl ProjectReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Extended metadata for a specific package type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProtocolMetadata { - #[doc = "Extended metadata for a specific package type, formatted to the associated schema version definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "Schema version."] - #[serde( - rename = "schemaVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub schema_version: Option<i32>, + #[doc = "Extended metadata for a specific package type, formatted to the associated schema version definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "Schema version."] + #[serde( + rename = "schemaVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub schema_version: Option<i32>, } impl ProtocolMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data about the origin of a published package"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Provenance { - #[doc = "Other provenance data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "Type of provenance source, for example \"InternalBuild\", \"InternalRelease\""] - #[serde( - rename = "provenanceSource", - default, - skip_serializing_if = "Option::is_none" - )] - pub provenance_source: Option<String>, - #[doc = "Identity of user that published the package"] - #[serde( - rename = "publisherUserIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_user_identity: Option<String>, - #[doc = "HTTP User-Agent used when pushing the package."] - #[serde(rename = "userAgent", default, skip_serializing_if = "Option::is_none")] - pub user_agent: Option<String>, + #[doc = "Other provenance data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "Type of provenance source, for example \"InternalBuild\", \"InternalRelease\""] + #[serde( + rename = "provenanceSource", + default, + skip_serializing_if = "Option::is_none" + )] + pub provenance_source: Option<String>, + #[doc = "Identity of user that published the package"] + #[serde( + rename = "publisherUserIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_user_identity: Option<String>, + #[doc = "HTTP User-Agent used when pushing the package."] + #[serde(rename = "userAgent", default, skip_serializing_if = "Option::is_none")] + pub user_agent: Option<String>, } impl Provenance { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A single package version within the recycle bin."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecycleBinPackageVersion { - #[serde(flatten)] - pub package_version: PackageVersion, - #[doc = "UTC date on which the package will automatically be removed from the recycle bin and permanently deleted."] - #[serde( - rename = "scheduledPermanentDeleteDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub scheduled_permanent_delete_date: Option<time::OffsetDateTime>, + #[serde(flatten)] + pub package_version: PackageVersion, + #[doc = "UTC date on which the package will automatically be removed from the recycle bin and permanently deleted."] + #[serde( + rename = "scheduledPermanentDeleteDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub scheduled_permanent_delete_date: Option<time::OffsetDateTime>, } impl RecycleBinPackageVersion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecycleBinPackageVersionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<RecycleBinPackageVersion>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<RecycleBinPackageVersion>, } impl RecycleBinPackageVersionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SaveCachedPackagesData { - #[serde(flatten)] - pub feed_batch_operation_data: FeedBatchOperationData, - #[serde( - rename = "normalizedPackageNames", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub normalized_package_names: Vec<String>, - #[serde( - rename = "viewsForPromotion", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub views_for_promotion: Vec<String>, + #[serde(flatten)] + pub feed_batch_operation_data: FeedBatchOperationData, + #[serde( + rename = "normalizedPackageNames", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub normalized_package_names: Vec<String>, + #[serde( + rename = "viewsForPromotion", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub views_for_promotion: Vec<String>, } impl SaveCachedPackagesData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SessionRequest { - #[doc = "Generic property bag to store data about the session"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "The feed name or id for the session"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub feed: Option<String>, - #[doc = "The type of session If a known value is provided, the Data dictionary will be validated for the presence of properties required by that type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<String>, + #[doc = "Generic property bag to store data about the session"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "The feed name or id for the session"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub feed: Option<String>, + #[doc = "The type of session If a known value is provided, the Data dictionary will be validated for the presence of properties required by that type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<String>, } impl SessionRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SessionResponse { - #[doc = "The unique identifier for the session"] - #[serde(rename = "sessionId", default, skip_serializing_if = "Option::is_none")] - pub session_id: Option<String>, - #[doc = "The name for the session"] - #[serde( - rename = "sessionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub session_name: Option<String>, + #[doc = "The unique identifier for the session"] + #[serde(rename = "sessionId", default, skip_serializing_if = "Option::is_none")] + pub session_id: Option<String>, + #[doc = "The name for the session"] + #[serde( + rename = "sessionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub session_name: Option<String>, } impl SessionResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Upstream source definition, including its Identity, package type, and other associated information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpstreamSource { - #[doc = "UTC date that this upstream was deleted."] - #[serde( - rename = "deletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deleted_date: Option<time::OffsetDateTime>, - #[doc = "Locator for connecting to the upstream source in a user friendly format, that may potentially change over time"] - #[serde( - rename = "displayLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_location: Option<String>, - #[doc = "Identity of the upstream source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "For an internal upstream type, track the Azure DevOps organization that contains it."] - #[serde( - rename = "internalUpstreamCollectionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub internal_upstream_collection_id: Option<String>, - #[doc = "For an internal upstream type, track the feed id being referenced."] - #[serde( - rename = "internalUpstreamFeedId", - default, - skip_serializing_if = "Option::is_none" - )] - pub internal_upstream_feed_id: Option<String>, - #[doc = "For an internal upstream type, track the project of the feed being referenced."] - #[serde( - rename = "internalUpstreamProjectId", - default, - skip_serializing_if = "Option::is_none" - )] - pub internal_upstream_project_id: Option<String>, - #[doc = "For an internal upstream type, track the view of the feed being referenced."] - #[serde( - rename = "internalUpstreamViewId", - default, - skip_serializing_if = "Option::is_none" - )] - pub internal_upstream_view_id: Option<String>, - #[doc = "Consistent locator for connecting to the upstream source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option<String>, - #[doc = "Display name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Package type associated with the upstream source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub protocol: Option<String>, - #[doc = "The identity of the service endpoint that holds credentials to use when accessing the upstream."] - #[serde( - rename = "serviceEndpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_id: Option<String>, - #[doc = "Specifies the projectId of the Service Endpoint."] - #[serde( - rename = "serviceEndpointProjectId", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_project_id: Option<String>, - #[doc = "Specifies the status of the upstream."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<upstream_source::Status>, - #[doc = "Provides a human-readable reason for the status of the upstream."] - #[serde( - rename = "statusDetails", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub status_details: Vec<UpstreamStatusDetail>, - #[doc = "Source type, such as Public or Internal."] - #[serde( - rename = "upstreamSourceType", - default, - skip_serializing_if = "Option::is_none" - )] - pub upstream_source_type: Option<upstream_source::UpstreamSourceType>, + #[doc = "UTC date that this upstream was deleted."] + #[serde( + rename = "deletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deleted_date: Option<time::OffsetDateTime>, + #[doc = "Locator for connecting to the upstream source in a user friendly format, that may potentially change over time"] + #[serde( + rename = "displayLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_location: Option<String>, + #[doc = "Identity of the upstream source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "For an internal upstream type, track the Azure DevOps organization that contains it."] + #[serde( + rename = "internalUpstreamCollectionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub internal_upstream_collection_id: Option<String>, + #[doc = "For an internal upstream type, track the feed id being referenced."] + #[serde( + rename = "internalUpstreamFeedId", + default, + skip_serializing_if = "Option::is_none" + )] + pub internal_upstream_feed_id: Option<String>, + #[doc = "For an internal upstream type, track the project of the feed being referenced."] + #[serde( + rename = "internalUpstreamProjectId", + default, + skip_serializing_if = "Option::is_none" + )] + pub internal_upstream_project_id: Option<String>, + #[doc = "For an internal upstream type, track the view of the feed being referenced."] + #[serde( + rename = "internalUpstreamViewId", + default, + skip_serializing_if = "Option::is_none" + )] + pub internal_upstream_view_id: Option<String>, + #[doc = "Consistent locator for connecting to the upstream source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option<String>, + #[doc = "Display name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Package type associated with the upstream source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub protocol: Option<String>, + #[doc = "The identity of the service endpoint that holds credentials to use when accessing the upstream."] + #[serde( + rename = "serviceEndpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_id: Option<String>, + #[doc = "Specifies the projectId of the Service Endpoint."] + #[serde( + rename = "serviceEndpointProjectId", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_project_id: Option<String>, + #[doc = "Specifies the status of the upstream."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<upstream_source::Status>, + #[doc = "Provides a human-readable reason for the status of the upstream."] + #[serde( + rename = "statusDetails", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub status_details: Vec<UpstreamStatusDetail>, + #[doc = "Source type, such as Public or Internal."] + #[serde( + rename = "upstreamSourceType", + default, + skip_serializing_if = "Option::is_none" + )] + pub upstream_source_type: Option<upstream_source::UpstreamSourceType>, } impl UpstreamSource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod upstream_source { - use super::*; - #[doc = "Specifies the status of the upstream."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "ok")] - Ok, - #[serde(rename = "disabled")] - Disabled, - } - #[doc = "Source type, such as Public or Internal."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum UpstreamSourceType { - #[serde(rename = "public")] - Public, - #[serde(rename = "internal")] - Internal, - } + use super::*; + #[doc = "Specifies the status of the upstream."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "ok")] + Ok, + #[serde(rename = "disabled")] + Disabled, + } + #[doc = "Source type, such as Public or Internal."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum UpstreamSourceType { + #[serde(rename = "public")] + Public, + #[serde(rename = "internal")] + Internal, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpstreamStatusDetail { - #[doc = "Provides a human-readable reason for the status of the upstream."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<String>, + #[doc = "Provides a human-readable reason for the status of the upstream."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<String>, } impl UpstreamStatusDetail { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } 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 98f82952..a0aa10a3 100644 --- a/azure_devops_rust_api/src/artifacts_package_types/mod.rs +++ b/azure_devops_rust_api/src/artifacts_package_types/mod.rs @@ -9,7585 +9,7811 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://pkgs.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + 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()) + } +} +pub mod maven { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed`: The name or id of the feed"] + #[doc = "* `group_id`: The group id of the package"] + #[doc = "* `artifact_id`: The artifact id of the package"] + #[doc = "* `project`: Project ID or project name"] + pub fn get_upstreaming_behavior( + &self, + organization: impl Into<String>, + feed: impl Into<String>, + group_id: impl Into<String>, + artifact_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed`: The name or id of the feed"] + #[doc = "* `body`: The behavior to apply to the package within the scope of the feed"] + #[doc = "* `project`: Project ID or project name"] + pub fn set_upstreaming_behavior( + &self, + organization: impl Into<String>, + feed: impl Into<String>, + group_id: impl Into<String>, + artifact_id: impl Into<String>, + body: impl Into<models::UpstreamingBehavior>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed`: Name or ID of the feed."] + #[doc = "* `group_id`: Group ID of the package."] + #[doc = "* `artifact_id`: Artifact ID of the package."] + #[doc = "* `version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_version( + &self, + organization: impl Into<String>, + feed: impl Into<String>, + group_id: impl Into<String>, + artifact_id: impl Into<String>, + version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Details to be updated."] + #[doc = "* `feed`: Name or ID of the feed."] + #[doc = "* `group_id`: Group ID of the package."] + #[doc = "* `artifact_id`: Artifact ID of the package."] + #[doc = "* `version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_package_version( + &self, + organization: impl Into<String>, + body: impl Into<models::PackageVersionDetails>, + feed: impl Into<String>, + group_id: impl Into<String>, + artifact_id: impl Into<String>, + version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed`: Name or ID of the feed."] + #[doc = "* `group_id`: Group ID of the package."] + #[doc = "* `artifact_id`: Artifact ID of the package."] + #[doc = "* `version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_package_version( + &self, + organization: impl Into<String>, + feed: impl Into<String>, + group_id: impl Into<String>, + artifact_id: impl Into<String>, + version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed`: Name or ID of the feed."] + #[doc = "* `group_id`: Group ID of the package."] + #[doc = "* `artifact_id`: Artifact ID of the package."] + #[doc = "* `version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + feed: impl Into<String>, + group_id: impl Into<String>, + artifact_id: impl Into<String>, + version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Set the 'Deleted' property to false to restore the package."] + #[doc = "* `feed`: Name or ID of the feed."] + #[doc = "* `group_id`: Group ID of the package."] + #[doc = "* `artifact_id`: Artifact ID of the package."] + #[doc = "* `version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn restore_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + body: impl Into<models::MavenRecycleBinPackageVersionDetails>, + feed: impl Into<String>, + group_id: impl Into<String>, + artifact_id: impl Into<String>, + version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed`: Name or ID of the feed."] + #[doc = "* `group_id`: Group ID of the package."] + #[doc = "* `artifact_id`: Artifact ID of the package."] + #[doc = "* `version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + feed: impl Into<String>, + group_id: impl Into<String>, + artifact_id: impl Into<String>, + version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_recycle_bin_packages( + &self, + organization: impl Into<String>, + body: impl Into<models::MavenPackagesBatchRequest>, + feed: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `group_id`: GroupId of the maven package"] + #[doc = "* `artifact_id`: ArtifactId of the maven package"] + #[doc = "* `version`: Version of the package"] + #[doc = "* `file_name`: File name to download"] + #[doc = "* `project`: Project ID or project name"] + pub fn download_package( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + group_id: impl Into<String>, + artifact_id: impl Into<String>, + version: impl Into<String>, + file_name: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] + #[doc = "* `feed_id`: Feed which contains the packages to update."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_package_versions( + &self, + organization: impl Into<String>, + body: impl Into<models::MavenPackagesBatchRequest>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get_upstreaming_behavior { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::UpstreamingBehavior> { + let bytes = self.0.into_body().collect().await?; + let body: models::UpstreamingBehavior = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed: String, + pub(crate) group_id: String, + pub(crate) artifact_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/upstreaming", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed, + &this.group_id, + &this.artifact_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::UpstreamingBehavior>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::UpstreamingBehavior>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod set_upstreaming_behavior { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed: String, + pub(crate) group_id: String, + pub(crate) artifact_id: String, + pub(crate) body: models::UpstreamingBehavior, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/upstreaming", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed, + &this.group_id, + &this.artifact_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_package_version { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed: String, + pub(crate) group_id: String, + pub(crate) artifact_id: String, + pub(crate) version: String, + pub(crate) project: String, + pub(crate) show_deleted: Option<bool>, } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed, + &this.group_id, + &this.artifact_id, + &this.version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(show_deleted) = &this.show_deleted { + req + .url_mut() + .query_pairs_mut() + .append_pair("showDeleted", &show_deleted.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) + } + pub mod update_package_version { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PackageVersionDetails, + pub(crate) feed: String, + pub(crate) group_id: String, + pub(crate) artifact_id: String, + pub(crate) version: String, + pub(crate) project: String, } -} -pub mod maven { + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed, + &this.group_id, + &this.artifact_id, + &this.version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod delete_package_version { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed`: The name or id of the feed"] - #[doc = "* `group_id`: The group id of the package"] - #[doc = "* `artifact_id`: The artifact id of the package"] - #[doc = "* `project`: Project ID or project name"] - pub fn get_upstreaming_behavior( - &self, - organization: impl Into<String>, - feed: impl Into<String>, - group_id: impl Into<String>, - artifact_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed`: The name or id of the feed"] - #[doc = "* `body`: The behavior to apply to the package within the scope of the feed"] - #[doc = "* `project`: Project ID or project name"] - pub fn set_upstreaming_behavior( - &self, - organization: impl Into<String>, - feed: impl Into<String>, - group_id: impl Into<String>, - artifact_id: impl Into<String>, - body: impl Into<models::UpstreamingBehavior>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed`: Name or ID of the feed."] - #[doc = "* `group_id`: Group ID of the package."] - #[doc = "* `artifact_id`: Artifact ID of the package."] - #[doc = "* `version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_version( - &self, - organization: impl Into<String>, - feed: impl Into<String>, - group_id: impl Into<String>, - artifact_id: impl Into<String>, - version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Details to be updated."] - #[doc = "* `feed`: Name or ID of the feed."] - #[doc = "* `group_id`: Group ID of the package."] - #[doc = "* `artifact_id`: Artifact ID of the package."] - #[doc = "* `version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_package_version( - &self, - organization: impl Into<String>, - body: impl Into<models::PackageVersionDetails>, - feed: impl Into<String>, - group_id: impl Into<String>, - artifact_id: impl Into<String>, - version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed`: Name or ID of the feed."] - #[doc = "* `group_id`: Group ID of the package."] - #[doc = "* `artifact_id`: Artifact ID of the package."] - #[doc = "* `version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_package_version( - &self, - organization: impl Into<String>, - feed: impl Into<String>, - group_id: impl Into<String>, - artifact_id: impl Into<String>, - version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed`: Name or ID of the feed."] - #[doc = "* `group_id`: Group ID of the package."] - #[doc = "* `artifact_id`: Artifact ID of the package."] - #[doc = "* `version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - feed: impl Into<String>, - group_id: impl Into<String>, - artifact_id: impl Into<String>, - version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Set the 'Deleted' property to false to restore the package."] - #[doc = "* `feed`: Name or ID of the feed."] - #[doc = "* `group_id`: Group ID of the package."] - #[doc = "* `artifact_id`: Artifact ID of the package."] - #[doc = "* `version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn restore_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - body: impl Into<models::MavenRecycleBinPackageVersionDetails>, - feed: impl Into<String>, - group_id: impl Into<String>, - artifact_id: impl Into<String>, - version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed`: Name or ID of the feed."] - #[doc = "* `group_id`: Group ID of the package."] - #[doc = "* `artifact_id`: Artifact ID of the package."] - #[doc = "* `version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - feed: impl Into<String>, - group_id: impl Into<String>, - artifact_id: impl Into<String>, - version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_recycle_bin_packages( - &self, - organization: impl Into<String>, - body: impl Into<models::MavenPackagesBatchRequest>, - feed: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `group_id`: GroupId of the maven package"] - #[doc = "* `artifact_id`: ArtifactId of the maven package"] - #[doc = "* `version`: Version of the package"] - #[doc = "* `file_name`: File name to download"] - #[doc = "* `project`: Project ID or project name"] - pub fn download_package( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - group_id: impl Into<String>, - artifact_id: impl Into<String>, - version: impl Into<String>, - file_name: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] - #[doc = "* `feed_id`: Feed which contains the packages to update."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_package_versions( - &self, - organization: impl Into<String>, - body: impl Into<models::MavenPackagesBatchRequest>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get_upstreaming_behavior { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::UpstreamingBehavior> { - let bytes = self.0.into_body().collect().await?; - let body: models::UpstreamingBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed: String, - pub(crate) group_id: String, - pub(crate) artifact_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/upstreaming" , this . client . endpoint () , & this . organization , & this . project , & this . feed , & this . group_id , & this . artifact_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::UpstreamingBehavior>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::UpstreamingBehavior>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod set_upstreaming_behavior { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed: String, - pub(crate) group_id: String, - pub(crate) artifact_id: String, - pub(crate) body: models::UpstreamingBehavior, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/upstreaming" , this . client . endpoint () , & this . organization , & this . project , & this . feed , & this . group_id , & this . artifact_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_package_version { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed: String, - pub(crate) group_id: String, - pub(crate) artifact_id: String, - pub(crate) version: String, - pub(crate) project: String, - pub(crate) show_deleted: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed , & this . group_id , & this . artifact_id , & this . version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(show_deleted) = &this.show_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("showDeleted", &show_deleted.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_package_version { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PackageVersionDetails, - pub(crate) feed: String, - pub(crate) group_id: String, - pub(crate) artifact_id: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed , & this . group_id , & this . artifact_id , & this . version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete_package_version { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed: String, - pub(crate) group_id: String, - pub(crate) artifact_id: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed , & this . group_id , & this . artifact_id , & this . version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::MavenPackageVersionDeletionState> { - let bytes = self.0.into_body().collect().await?; - let body: models::MavenPackageVersionDeletionState = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed: String, - pub(crate) group_id: String, - pub(crate) artifact_id: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/groups/{}/artifacts/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed , & this . group_id , & this . artifact_id , & this . version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::MavenPackageVersionDeletionState>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::MavenPackageVersionDeletionState>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod restore_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::MavenRecycleBinPackageVersionDetails, - pub(crate) feed: String, - pub(crate) group_id: String, - pub(crate) artifact_id: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/groups/{}/artifacts/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed , & this . group_id , & this . artifact_id , & this . version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed: String, - pub(crate) group_id: String, - pub(crate) artifact_id: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/groups/{}/artifacts/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed , & this . group_id , & this . artifact_id , & this . version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod update_recycle_bin_packages { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::MavenPackagesBatchRequest, - pub(crate) feed: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/packagesBatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod download_package { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) group_id: String, - pub(crate) artifact_id: String, - pub(crate) version: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/maven/{}/{}/{}/{}/content", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.group_id, - &this.artifact_id, - &this.version, - &this.file_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_package_versions { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::MavenPackagesBatchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/maven/packagesbatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed: String, + pub(crate) group_id: String, + pub(crate) artifact_id: String, + pub(crate) version: String, + pub(crate) project: String, } -} -pub mod npm { + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/maven/groups/{}/artifacts/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed, + &this.group_id, + &this.artifact_id, + &this.version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_package_version_from_recycle_bin { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_scope`: Scope of the package (the 'scope' part of @scope/name)."] - #[doc = "* `unscoped_package_name`: Name of the package (the 'name' part of @scope/name)."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_scoped_package_version( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_scope: impl Into<String>, - unscoped_package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_scoped_package( - &self, - organization: impl Into<String>, - body: impl Into<models::PackageVersionDetails>, - feed_id: impl Into<String>, - package_scope: impl Into<String>, - unscoped_package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_scope`: Scope of the package (the 'scope' part of @scope/name)."] - #[doc = "* `unscoped_package_name`: Name of the package (the 'name' part of @scope/name)."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn unpublish_scoped_package( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_scope: impl Into<String>, - unscoped_package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_version( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_package( - &self, - organization: impl Into<String>, - body: impl Into<models::PackageVersionDetails>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn unpublish_package( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: The name or id of the feed"] - #[doc = "* `package_scope`: The scope of the package"] - #[doc = "* `unscoped_package_name`: The name of the scoped package"] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_upstreaming_behavior( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_scope: impl Into<String>, - unscoped_package_name: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: The name or id of the feed"] - #[doc = "* `package_scope`: The scope of the package"] - #[doc = "* `unscoped_package_name`: The name of the scoped package"] - #[doc = "* `body`: The behavior to apply to the scoped package within the scope of the feed"] - #[doc = "* `project`: Project ID or project name"] - pub fn set_scoped_upstreaming_behavior( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_scope: impl Into<String>, - unscoped_package_name: impl Into<String>, - body: impl Into<models::UpstreamingBehavior>, - project: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn download_scoped_package( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_scope: impl Into<String>, - unscoped_package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_scope`: Scope of the package (the 'scope' part of @scope\\name)"] - #[doc = "* `unscoped_package_name`: Name of the package (the 'name' part of @scope\\name)"] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_scoped_package_readme( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_scope: impl Into<String>, - unscoped_package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: The name or id of the feed"] - #[doc = "* `package_name`: The name of the package"] - #[doc = "* `project`: Project ID or project name"] - pub fn get_scoped_package_upstreaming_behavior( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: The name or id of the feed"] - #[doc = "* `package_name`: The name of the package"] - #[doc = "* `body`: The behavior to apply to the scoped package within the scope of the feed"] - #[doc = "* `project`: Project ID or project name"] - pub fn set_upstreaming_behavior( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - body: impl Into<models::UpstreamingBehavior>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn download_package( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_readme( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_packages( - &self, - organization: impl Into<String>, - body: impl Into<models::NpmPackagesBatchRequest>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_scope`: Scope of the package (the 'scope' part of @scope/name)"] - #[doc = "* `unscoped_package_name`: Name of the package (the 'name' part of @scope/name)."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_scoped_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_scope: impl Into<String>, - unscoped_package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_scope`: Scope of the package (the 'scope' part of @scope/name)."] - #[doc = "* `unscoped_package_name`: Name of the package (the 'name' part of @scope/name)."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn restore_scoped_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - body: impl Into<models::NpmRecycleBinPackageVersionDetails>, - feed_id: impl Into<String>, - package_scope: impl Into<String>, - unscoped_package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_scope`: Scope of the package (the 'scope' part of @scope/name)."] - #[doc = "* `unscoped_package_name`: Name of the package (the 'name' part of @scope/name)."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_scoped_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_scope: impl Into<String>, - unscoped_package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn restore_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - body: impl Into<models::NpmRecycleBinPackageVersionDetails>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_recycle_bin_packages( - &self, - organization: impl Into<String>, - body: impl Into<models::NpmPackagesBatchRequest>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get_scoped_package_version { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_scope: String, - pub(crate) unscoped_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_scope, - &this.unscoped_package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_scoped_package { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PackageVersionDetails, - pub(crate) feed_id: String, - pub(crate) package_scope: String, - pub(crate) unscoped_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_scope, - &this.unscoped_package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod unpublish_scoped_package { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_scope: String, - pub(crate) unscoped_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_scope, - &this.unscoped_package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_package_version { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_package { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PackageVersionDetails, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod unpublish_package { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_package_upstreaming_behavior { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::UpstreamingBehavior> { - let bytes = self.0.into_body().collect().await?; - let body: models::UpstreamingBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/upstreaming", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_scope, - &this.unscoped_package_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::UpstreamingBehavior>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::UpstreamingBehavior>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod set_scoped_upstreaming_behavior { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_scope: String, - pub(crate) unscoped_package_name: String, - pub(crate) body: models::UpstreamingBehavior, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/upstreaming", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_scope, - &this.unscoped_package_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod download_scoped_package { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_scope: String, - pub(crate) unscoped_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/versions/{}/content" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_scope , & this . unscoped_package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_scoped_package_readme { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_scope: String, - pub(crate) unscoped_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/versions/{}/readme" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_scope , & this . unscoped_package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_scoped_package_upstreaming_behavior { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::UpstreamingBehavior> { - let bytes = self.0.into_body().collect().await?; - let body: models::UpstreamingBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/upstreaming", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::UpstreamingBehavior>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::UpstreamingBehavior>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod set_upstreaming_behavior { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/upstreaming", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod download_package { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/versions/{}/content", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_package_readme { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/versions/{}/readme", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_packages { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::NpmPackagesBatchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/packagesbatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_scoped_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::NpmPackageVersionDeletionState> { - let bytes = self.0.into_body().collect().await?; - let body: models::NpmPackageVersionDeletionState = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_scope: String, - pub(crate) unscoped_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/@{}/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_scope , & this . unscoped_package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::NpmPackageVersionDeletionState>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::NpmPackageVersionDeletionState>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod restore_scoped_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::NpmRecycleBinPackageVersionDetails, - pub(crate) feed_id: String, - pub(crate) package_scope: String, - pub(crate) unscoped_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/@{}/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_scope , & this . unscoped_package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete_scoped_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_scope: String, - pub(crate) unscoped_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/@{}/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_scope , & this . unscoped_package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::NpmPackageVersionDeletionState> { - let bytes = self.0.into_body().collect().await?; - let body: models::NpmPackageVersionDeletionState = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::NpmPackageVersionDeletionState>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::NpmPackageVersionDeletionState>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod restore_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::NpmRecycleBinPackageVersionDetails, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod update_recycle_bin_packages { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::NpmPackagesBatchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/PackagesBatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::MavenPackageVersionDeletionState> { + let bytes = self.0.into_body().collect().await?; + let body: models::MavenPackageVersionDeletionState = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod nu_get { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed: String, + pub(crate) group_id: String, + pub(crate) artifact_id: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/groups/{}/artifacts/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed , & this . group_id , & this . artifact_id , & this . version)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::MavenPackageVersionDeletionState>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::MavenPackageVersionDeletionState>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod restore_package_version_from_recycle_bin { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: The name or id of the feed"] - #[doc = "* `package_name`: The name of the package"] - #[doc = "* `project`: Project ID or project name"] - pub fn get_upstreaming_behavior( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: The name or id of the feed"] - #[doc = "* `package_name`: The name of the package"] - #[doc = "* `body`: The behavior to apply to the package within the scope of the feed"] - #[doc = "* `project`: Project ID or project name"] - pub fn set_upstreaming_behavior( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - body: impl Into<models::UpstreamingBehavior>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_version( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: New state to apply to the referenced package."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package to update."] - #[doc = "* `package_version`: Version of the package to update."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_package_version( - &self, - organization: impl Into<String>, - body: impl Into<models::PackageVersionDetails>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package to delete."] - #[doc = "* `package_version`: Version of the package to delete."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_package_version( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn download_package( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_package_versions( - &self, - organization: impl Into<String>, - body: impl Into<models::NuGetPackagesBatchRequest>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Set the 'Deleted' member to 'false' to apply the restore operation"] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn restore_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - body: impl Into<models::NuGetRecycleBinPackageVersionDetails>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data. <c>Operation</c> must be <c>PermanentDelete</c> or <c>RestoreToFeed</c>"] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_recycle_bin_package_versions( - &self, - organization: impl Into<String>, - body: impl Into<models::NuGetPackagesBatchRequest>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get_upstreaming_behavior { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::UpstreamingBehavior> { - let bytes = self.0.into_body().collect().await?; - let body: models::UpstreamingBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/upstreaming", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::UpstreamingBehavior>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::UpstreamingBehavior>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod set_upstreaming_behavior { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/upstreaming", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_package_version { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_name: String, - pub(crate) package_version: String, - pub(crate) project: String, - pub(crate) show_deleted: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(show_deleted) = &this.show_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("showDeleted", &show_deleted.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_package_version { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PackageVersionDetails, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete_package_version { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod download_package { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_name: String, - pub(crate) package_version: String, - pub(crate) project: String, - pub(crate) source_protocol_version: Option<String>, - } - impl RequestBuilder { - #[doc = "Unused"] - pub fn source_protocol_version( - mut self, - source_protocol_version: impl Into<String>, - ) -> Self { - self.source_protocol_version = Some(source_protocol_version.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}/content" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(source_protocol_version) = &this.source_protocol_version { - req.url_mut() - .query_pairs_mut() - .append_pair("sourceProtocolVersion", source_protocol_version); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_package_versions { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::NuGetPackagesBatchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packagesbatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::NuGetPackageVersionDeletionState> { - let bytes = self.0.into_body().collect().await?; - let body: models::NuGetPackageVersionDeletionState = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packages/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::NuGetPackageVersionDeletionState>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::NuGetPackageVersionDeletionState>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod restore_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::NuGetRecycleBinPackageVersionDetails, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packages/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packages/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod update_recycle_bin_package_versions { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::NuGetPackagesBatchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packagesBatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::MavenRecycleBinPackageVersionDetails, + pub(crate) feed: String, + pub(crate) group_id: String, + pub(crate) artifact_id: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/groups/{}/artifacts/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed , & this . group_id , & this . artifact_id , & this . version)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod delete_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed: String, + pub(crate) group_id: String, + pub(crate) artifact_id: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/groups/{}/artifacts/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed , & this . group_id , & this . artifact_id , & this . version)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod update_recycle_bin_packages { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::MavenPackagesBatchRequest, + pub(crate) feed: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/packagesBatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod download_package { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) group_id: String, + pub(crate) artifact_id: String, + pub(crate) version: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/maven/{}/{}/{}/{}/content", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.group_id, + &this.artifact_id, + &this.version, + &this.file_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_package_versions { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::MavenPackagesBatchRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/maven/packagesbatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod npm { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_scope`: Scope of the package (the 'scope' part of @scope/name)."] + #[doc = "* `unscoped_package_name`: Name of the package (the 'name' part of @scope/name)."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_scoped_package_version( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_scope: impl Into<String>, + unscoped_package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_scoped_package( + &self, + organization: impl Into<String>, + body: impl Into<models::PackageVersionDetails>, + feed_id: impl Into<String>, + package_scope: impl Into<String>, + unscoped_package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_scope`: Scope of the package (the 'scope' part of @scope/name)."] + #[doc = "* `unscoped_package_name`: Name of the package (the 'name' part of @scope/name)."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn unpublish_scoped_package( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_scope: impl Into<String>, + unscoped_package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_version( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_package( + &self, + organization: impl Into<String>, + body: impl Into<models::PackageVersionDetails>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn unpublish_package( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: The name or id of the feed"] + #[doc = "* `package_scope`: The scope of the package"] + #[doc = "* `unscoped_package_name`: The name of the scoped package"] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_upstreaming_behavior( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_scope: impl Into<String>, + unscoped_package_name: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: The name or id of the feed"] + #[doc = "* `package_scope`: The scope of the package"] + #[doc = "* `unscoped_package_name`: The name of the scoped package"] + #[doc = "* `body`: The behavior to apply to the scoped package within the scope of the feed"] + #[doc = "* `project`: Project ID or project name"] + pub fn set_scoped_upstreaming_behavior( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_scope: impl Into<String>, + unscoped_package_name: impl Into<String>, + body: impl Into<models::UpstreamingBehavior>, + project: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn download_scoped_package( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_scope: impl Into<String>, + unscoped_package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_scope`: Scope of the package (the 'scope' part of @scope\\name)"] + #[doc = "* `unscoped_package_name`: Name of the package (the 'name' part of @scope\\name)"] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_scoped_package_readme( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_scope: impl Into<String>, + unscoped_package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: The name or id of the feed"] + #[doc = "* `package_name`: The name of the package"] + #[doc = "* `project`: Project ID or project name"] + pub fn get_scoped_package_upstreaming_behavior( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: The name or id of the feed"] + #[doc = "* `package_name`: The name of the package"] + #[doc = "* `body`: The behavior to apply to the scoped package within the scope of the feed"] + #[doc = "* `project`: Project ID or project name"] + pub fn set_upstreaming_behavior( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + body: impl Into<models::UpstreamingBehavior>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn download_package( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_readme( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_packages( + &self, + organization: impl Into<String>, + body: impl Into<models::NpmPackagesBatchRequest>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_scope`: Scope of the package (the 'scope' part of @scope/name)"] + #[doc = "* `unscoped_package_name`: Name of the package (the 'name' part of @scope/name)."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_scoped_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_scope: impl Into<String>, + unscoped_package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_scope`: Scope of the package (the 'scope' part of @scope/name)."] + #[doc = "* `unscoped_package_name`: Name of the package (the 'name' part of @scope/name)."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn restore_scoped_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + body: impl Into<models::NpmRecycleBinPackageVersionDetails>, + feed_id: impl Into<String>, + package_scope: impl Into<String>, + unscoped_package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_scope`: Scope of the package (the 'scope' part of @scope/name)."] + #[doc = "* `unscoped_package_name`: Name of the package (the 'name' part of @scope/name)."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_scoped_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_scope: impl Into<String>, + unscoped_package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn restore_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + body: impl Into<models::NpmRecycleBinPackageVersionDetails>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_recycle_bin_packages( + &self, + organization: impl Into<String>, + body: impl Into<models::NpmPackagesBatchRequest>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get_scoped_package_version { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_scope: String, + pub(crate) unscoped_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_scope, + &this.unscoped_package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_scoped_package { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PackageVersionDetails, + pub(crate) feed_id: String, + pub(crate) package_scope: String, + pub(crate) unscoped_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_scope, + &this.unscoped_package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod unpublish_scoped_package { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_scope: String, + pub(crate) unscoped_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_scope, + &this.unscoped_package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_package_version { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_package { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PackageVersionDetails, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod unpublish_package { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_package_upstreaming_behavior { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::UpstreamingBehavior> { + let bytes = self.0.into_body().collect().await?; + let body: models::UpstreamingBehavior = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/upstreaming", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_scope, + &this.unscoped_package_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::UpstreamingBehavior>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::UpstreamingBehavior>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod set_scoped_upstreaming_behavior { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_scope: String, + pub(crate) unscoped_package_name: String, + pub(crate) body: models::UpstreamingBehavior, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/upstreaming", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_scope, + &this.unscoped_package_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod download_scoped_package { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_scope: String, + pub(crate) unscoped_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/versions/{}/content", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_scope, + &this.unscoped_package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_scoped_package_readme { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_scope: String, + pub(crate) unscoped_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/versions/{}/readme", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_scope, + &this.unscoped_package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_scoped_package_upstreaming_behavior { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::UpstreamingBehavior> { + let bytes = self.0.into_body().collect().await?; + let body: models::UpstreamingBehavior = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/upstreaming", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::UpstreamingBehavior>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::UpstreamingBehavior>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod set_upstreaming_behavior { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/upstreaming", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod download_package { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/versions/{}/content", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_package_readme { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/versions/{}/readme", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_packages { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::NpmPackagesBatchRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packagesbatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_scoped_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::NpmPackageVersionDeletionState> { + let bytes = self.0.into_body().collect().await?; + let body: models::NpmPackageVersionDeletionState = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_scope: String, + pub(crate) unscoped_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/@{}/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_scope, + &this.unscoped_package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::NpmPackageVersionDeletionState>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::NpmPackageVersionDeletionState>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod restore_scoped_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::NpmRecycleBinPackageVersionDetails, + pub(crate) feed_id: String, + pub(crate) package_scope: String, + pub(crate) unscoped_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/@{}/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_scope, + &this.unscoped_package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod delete_scoped_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_scope: String, + pub(crate) unscoped_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/@{}/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_scope, + &this.unscoped_package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::NpmPackageVersionDeletionState> { + let bytes = self.0.into_body().collect().await?; + let body: models::NpmPackageVersionDeletionState = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::NpmPackageVersionDeletionState>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::NpmPackageVersionDeletionState>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod restore_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::NpmRecycleBinPackageVersionDetails, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod delete_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod update_recycle_bin_packages { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::NpmPackagesBatchRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/PackagesBatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod nu_get { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: The name or id of the feed"] + #[doc = "* `package_name`: The name of the package"] + #[doc = "* `project`: Project ID or project name"] + pub fn get_upstreaming_behavior( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: The name or id of the feed"] + #[doc = "* `package_name`: The name of the package"] + #[doc = "* `body`: The behavior to apply to the package within the scope of the feed"] + #[doc = "* `project`: Project ID or project name"] + pub fn set_upstreaming_behavior( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + body: impl Into<models::UpstreamingBehavior>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_version( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: New state to apply to the referenced package."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package to update."] + #[doc = "* `package_version`: Version of the package to update."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_package_version( + &self, + organization: impl Into<String>, + body: impl Into<models::PackageVersionDetails>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package to delete."] + #[doc = "* `package_version`: Version of the package to delete."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_package_version( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn download_package( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_package_versions( + &self, + organization: impl Into<String>, + body: impl Into<models::NuGetPackagesBatchRequest>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Set the 'Deleted' member to 'false' to apply the restore operation"] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn restore_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + body: impl Into<models::NuGetRecycleBinPackageVersionDetails>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data. <c>Operation</c> must be <c>PermanentDelete</c> or <c>RestoreToFeed</c>"] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_recycle_bin_package_versions( + &self, + organization: impl Into<String>, + body: impl Into<models::NuGetPackagesBatchRequest>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get_upstreaming_behavior { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::UpstreamingBehavior> { + let bytes = self.0.into_body().collect().await?; + let body: models::UpstreamingBehavior = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/upstreaming", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::UpstreamingBehavior>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::UpstreamingBehavior>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod set_upstreaming_behavior { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/upstreaming", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_package_version { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_name: String, + pub(crate) package_version: String, + pub(crate) project: String, + pub(crate) show_deleted: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(show_deleted) = &this.show_deleted { + req + .url_mut() + .query_pairs_mut() + .append_pair("showDeleted", &show_deleted.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_package_version { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PackageVersionDetails, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod delete_package_version { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod download_package { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_name: String, + pub(crate) package_version: String, + pub(crate) project: String, + pub(crate) source_protocol_version: Option<String>, + } + impl RequestBuilder { + #[doc = "Unused"] + pub fn source_protocol_version(mut self, source_protocol_version: impl Into<String>) -> Self { + self.source_protocol_version = Some(source_protocol_version.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}/content", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(source_protocol_version) = &this.source_protocol_version { + req + .url_mut() + .query_pairs_mut() + .append_pair("sourceProtocolVersion", source_protocol_version); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_package_versions { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::NuGetPackagesBatchRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packagesbatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::NuGetPackageVersionDeletionState> { + let bytes = self.0.into_body().collect().await?; + let body: models::NuGetPackageVersionDeletionState = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::NuGetPackageVersionDeletionState>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::NuGetPackageVersionDeletionState>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod restore_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::NuGetRecycleBinPackageVersionDetails, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod delete_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod update_recycle_bin_package_versions { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::NuGetPackagesBatchRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packagesBatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod python { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: The name or id of the feed"] + #[doc = "* `package_name`: The name of the package"] + #[doc = "* `project`: Project ID or project name"] + pub fn get_upstreaming_behavior( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: The name or id of the feed"] + #[doc = "* `package_name`: The name of the package"] + #[doc = "* `body`: The behavior to apply to the package within the scope of the feed"] + #[doc = "* `project`: Project ID or project name"] + pub fn set_upstreaming_behavior( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + body: impl Into<models::UpstreamingBehavior>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_version( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Details to be updated."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_package_version( + &self, + organization: impl Into<String>, + body: impl Into<models::PackageVersionDetails>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_package_version( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `file_name`: Name of the file in the package"] + #[doc = "* `project`: Project ID or project name"] + pub fn download_package( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + file_name: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_package_versions( + &self, + organization: impl Into<String>, + body: impl Into<models::PyPiPackagesBatchRequest>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Set the 'Deleted' state to 'false' to restore the package to its feed."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn restore_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + body: impl Into<models::PyPiRecycleBinPackageVersionDetails>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data. <c>Operation</c> must be <c>PermanentDelete</c> or <c>RestoreToFeed</c>"] + #[doc = "* `feed_id`: Feed which contains the packages to update."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_recycle_bin_package_versions( + &self, + organization: impl Into<String>, + body: impl Into<models::PyPiPackagesBatchRequest>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get_upstreaming_behavior { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: The name or id of the feed"] - #[doc = "* `package_name`: The name of the package"] - #[doc = "* `project`: Project ID or project name"] - pub fn get_upstreaming_behavior( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: The name or id of the feed"] - #[doc = "* `package_name`: The name of the package"] - #[doc = "* `body`: The behavior to apply to the package within the scope of the feed"] - #[doc = "* `project`: Project ID or project name"] - pub fn set_upstreaming_behavior( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - body: impl Into<models::UpstreamingBehavior>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_version( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Details to be updated."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_package_version( - &self, - organization: impl Into<String>, - body: impl Into<models::PackageVersionDetails>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_package_version( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `file_name`: Name of the file in the package"] - #[doc = "* `project`: Project ID or project name"] - pub fn download_package( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - file_name: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_package_versions( - &self, - organization: impl Into<String>, - body: impl Into<models::PyPiPackagesBatchRequest>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Set the 'Deleted' state to 'false' to restore the package to its feed."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn restore_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - body: impl Into<models::PyPiRecycleBinPackageVersionDetails>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data. <c>Operation</c> must be <c>PermanentDelete</c> or <c>RestoreToFeed</c>"] - #[doc = "* `feed_id`: Feed which contains the packages to update."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_recycle_bin_package_versions( - &self, - organization: impl Into<String>, - body: impl Into<models::PyPiPackagesBatchRequest>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get_upstreaming_behavior { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::UpstreamingBehavior> { - let bytes = self.0.into_body().collect().await?; - let body: models::UpstreamingBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/upstreaming", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::UpstreamingBehavior>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::UpstreamingBehavior>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod set_upstreaming_behavior { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/upstreaming", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_package_version { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_name: String, - pub(crate) package_version: String, - pub(crate) project: String, - pub(crate) show_deleted: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(show_deleted) = &this.show_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("showDeleted", &show_deleted.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_package_version { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PackageVersionDetails, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete_package_version { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod download_package { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_name: String, - pub(crate) package_version: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}/{}/content" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version , & this . file_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_package_versions { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PyPiPackagesBatchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packagesbatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::PyPiPackageVersionDeletionState> { - let bytes = self.0.into_body().collect().await?; - let body: models::PyPiPackageVersionDeletionState = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packages/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PyPiPackageVersionDeletionState>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PyPiPackageVersionDeletionState>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod restore_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PyPiRecycleBinPackageVersionDetails, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packages/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packages/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod update_recycle_bin_package_versions { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PyPiPackagesBatchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packagesBatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::UpstreamingBehavior> { + let bytes = self.0.into_body().collect().await?; + let body: models::UpstreamingBehavior = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/upstreaming", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::UpstreamingBehavior>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::UpstreamingBehavior>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod set_upstreaming_behavior { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/upstreaming", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_package_version { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_name: String, + pub(crate) package_version: String, + pub(crate) project: String, + pub(crate) show_deleted: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(show_deleted) = &this.show_deleted { + req + .url_mut() + .query_pairs_mut() + .append_pair("showDeleted", &show_deleted.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_package_version { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PackageVersionDetails, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod delete_package_version { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod download_package { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_name: String, + pub(crate) package_version: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}/{}/content", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version, + &this.file_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_package_versions { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PyPiPackagesBatchRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packagesbatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PyPiPackageVersionDeletionState> { + let bytes = self.0.into_body().collect().await?; + let body: models::PyPiPackageVersionDeletionState = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PyPiPackageVersionDeletionState>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::PyPiPackageVersionDeletionState>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod restore_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PyPiRecycleBinPackageVersionDetails, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } + pub mod delete_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod update_recycle_bin_package_versions { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PyPiPackagesBatchRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packagesBatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod universal { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_version( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_package_version( + &self, + organization: impl Into<String>, + body: impl Into<models::PackageVersionDetails>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_package_version( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_package_versions( + &self, + organization: impl Into<String>, + body: impl Into<models::UPackPackagesBatchRequest>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Set the 'Deleted' property to 'false' to restore the package."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn restore_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + body: impl Into<models::UPackRecycleBinPackageVersionDetails>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `feed_id`: Name or ID of the feed."] + #[doc = "* `package_name`: Name of the package."] + #[doc = "* `package_version`: Version of the package."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete_package_version_from_recycle_bin( + &self, + organization: impl Into<String>, + feed_id: impl Into<String>, + package_name: impl Into<String>, + package_version: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data. <c>Operation</c> must be <c>PermanentDelete</c> or <c>RestoreToFeed</c>"] + #[doc = "* `feed_id`: Feed which contains the packages to update."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_recycle_bin_package_versions( + &self, + organization: impl Into<String>, + body: impl Into<models::UPackPackagesBatchRequest>, + feed_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get_package_version { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_version( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_package_version( - &self, - organization: impl Into<String>, - body: impl Into<models::PackageVersionDetails>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_package_version( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_package_versions( - &self, - organization: impl Into<String>, - body: impl Into<models::UPackPackagesBatchRequest>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Set the 'Deleted' property to 'false' to restore the package."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn restore_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - body: impl Into<models::UPackRecycleBinPackageVersionDetails>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `feed_id`: Name or ID of the feed."] - #[doc = "* `package_name`: Name of the package."] - #[doc = "* `package_version`: Version of the package."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_package_version_from_recycle_bin( - &self, - organization: impl Into<String>, - feed_id: impl Into<String>, - package_name: impl Into<String>, - package_version: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Information about the packages to update, the operation to perform, and its associated data. <c>Operation</c> must be <c>PermanentDelete</c> or <c>RestoreToFeed</c>"] - #[doc = "* `feed_id`: Feed which contains the packages to update."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_recycle_bin_package_versions( - &self, - organization: impl Into<String>, - body: impl Into<models::UPackPackagesBatchRequest>, - feed_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get_package_version { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) feed_id: String, - pub(crate) package_name: String, - pub(crate) package_version: String, - pub(crate) project: String, - pub(crate) show_deleted: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(show_deleted) = &this.show_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("showDeleted", &show_deleted.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_package_version { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PackageVersionDetails, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete_package_version { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Package> { - let bytes = self.0.into_body().collect().await?; - let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id, - &this.package_name, - &this.package_version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Package>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_package_versions { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::UPackPackagesBatchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/upack/packagesbatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::UPackPackageVersionDeletionState> { - let bytes = self.0.into_body().collect().await?; - let body: models::UPackPackageVersionDeletionState = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packages/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::UPackPackageVersionDeletionState>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::UPackPackageVersionDeletionState>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod restore_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::UPackRecycleBinPackageVersionDetails, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packages/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete_package_version_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packages/{}/versions/{}" , this . client . endpoint () , & this . organization , & this . project , & this . feed_id , & this . package_name , & this . package_version)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod update_recycle_bin_package_versions { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::UPackPackagesBatchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packagesBatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.feed_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) feed_id: String, + pub(crate) package_name: String, + pub(crate) package_version: String, + pub(crate) project: String, + pub(crate) show_deleted: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(show_deleted) = &this.show_deleted { + req + .url_mut() + .query_pairs_mut() + .append_pair("showDeleted", &show_deleted.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_package_version { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PackageVersionDetails, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod delete_package_version { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Package> { + let bytes = self.0.into_body().collect().await?; + let body: models::Package = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Package>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Package>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_package_versions { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UPackPackagesBatchRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/packagesbatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::UPackPackageVersionDeletionState> { + let bytes = self.0.into_body().collect().await?; + let body: models::UPackPackageVersionDeletionState = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::UPackPackageVersionDeletionState>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::UPackPackageVersionDeletionState>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod restore_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UPackRecycleBinPackageVersionDetails, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod delete_package_version_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packages/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id, + &this.package_name, + &this.package_version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod update_recycle_bin_package_versions { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UPackPackagesBatchRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packagesBatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.feed_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } diff --git a/azure_devops_rust_api/src/artifacts_package_types/models.rs b/azure_devops_rust_api/src/artifacts_package_types/models.rs index 50867666..fb165c61 100644 --- a/azure_devops_rust_api/src/artifacts_package_types/models.rs +++ b/azure_devops_rust_api/src/artifacts_package_types/models.rs @@ -8,1151 +8,1150 @@ use std::str::FromStr; #[doc = "Data required to deprecate multiple package versions. Pass this while performing NpmBatchOperationTypes.Deprecate batch operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BatchDeprecateData { - #[serde(flatten)] - pub batch_operation_data: BatchOperationData, - #[doc = "Deprecate message that will be added to packages"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, + #[serde(flatten)] + pub batch_operation_data: BatchOperationData, + #[doc = "Deprecate message that will be added to packages"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, } impl BatchDeprecateData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data required to unlist or relist multiple package versions. Pass this while performing NuGetBatchOperationTypes.List batch operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BatchListData { - #[serde(flatten)] - pub batch_operation_data: BatchOperationData, - #[doc = "The desired listed status for the package versions."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub listed: Option<bool>, + #[serde(flatten)] + pub batch_operation_data: BatchOperationData, + #[doc = "The desired listed status for the package versions."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub listed: Option<bool>, } impl BatchListData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BatchOperationData {} impl BatchOperationData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for a JSON Patch operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchOperation { - #[doc = "The path to copy from for the Move/Copy operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub from: Option<String>, - #[doc = "The patch operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub op: Option<json_patch_operation::Op>, - #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "The value for the operation. This is either a primitive or a JToken."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = "The path to copy from for the Move/Copy operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub from: Option<String>, + #[doc = "The patch operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub op: Option<json_patch_operation::Op>, + #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "The value for the operation. This is either a primitive or a JToken."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl JsonPatchOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod json_patch_operation { - use super::*; - #[doc = "The patch operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Op { - #[serde(rename = "add")] - Add, - #[serde(rename = "remove")] - Remove, - #[serde(rename = "replace")] - Replace, - #[serde(rename = "move")] - Move, - #[serde(rename = "copy")] - Copy, - #[serde(rename = "test")] - Test, - } + use super::*; + #[doc = "The patch operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Op { + #[serde(rename = "add")] + Add, + #[serde(rename = "remove")] + Remove, + #[serde(rename = "replace")] + Replace, + #[serde(rename = "move")] + Move, + #[serde(rename = "copy")] + Copy, + #[serde(rename = "test")] + Test, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenDistributionManagement { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<MavenRepository>, - #[doc = ""] - #[serde( - rename = "snapshotRepository", - default, - skip_serializing_if = "Option::is_none" - )] - pub snapshot_repository: Option<MavenSnapshotRepository>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<MavenRepository>, + #[doc = ""] + #[serde( + rename = "snapshotRepository", + default, + skip_serializing_if = "Option::is_none" + )] + pub snapshot_repository: Option<MavenSnapshotRepository>, } impl MavenDistributionManagement { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Identifies a particular Maven package version"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenMinimalPackageDetails { - #[doc = "Package artifact ID"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub artifact: Option<String>, - #[doc = "Package group ID"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub group: Option<String>, - #[doc = "Package version"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Package artifact ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub artifact: Option<String>, + #[doc = "Package group ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option<String>, + #[doc = "Package version"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl MavenMinimalPackageDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPackage { - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<String>, - #[doc = "The class to represent a REST reference link. RFC:<http://tools>.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them."] - #[serde( - rename = "artifactIndex", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_index: Option<ReferenceLink>, - #[doc = "The class to represent a REST reference link. RFC:<http://tools>.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them."] - #[serde( - rename = "artifactMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_metadata: Option<ReferenceLink>, - #[serde( - rename = "deletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deleted_date: Option<time::OffsetDateTime>, - #[doc = "The class to represent a collection of REST reference links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub files: Option<ReferenceLinks>, - #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] - pub group_id: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pom: Option<MavenPomMetadata>, - #[doc = "The class to represent a REST reference link. RFC:<http://tools>.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them."] - #[serde( - rename = "requestedFile", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_file: Option<ReferenceLink>, - #[doc = "The class to represent a REST reference link. RFC:<http://tools>.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them."] - #[serde( - rename = "snapshotMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub snapshot_metadata: Option<ReferenceLink>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, - #[doc = "The class to represent a collection of REST reference links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub versions: Option<ReferenceLinks>, - #[doc = "The class to represent a REST reference link. RFC:<http://tools>.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them."] - #[serde( - rename = "versionsIndex", - default, - skip_serializing_if = "Option::is_none" - )] - pub versions_index: Option<ReferenceLink>, + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<String>, + #[doc = "The class to represent a REST reference link. RFC:<http://tools>.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them."] + #[serde( + rename = "artifactIndex", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_index: Option<ReferenceLink>, + #[doc = "The class to represent a REST reference link. RFC:<http://tools>.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them."] + #[serde( + rename = "artifactMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_metadata: Option<ReferenceLink>, + #[serde( + rename = "deletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deleted_date: Option<time::OffsetDateTime>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub files: Option<ReferenceLinks>, + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pom: Option<MavenPomMetadata>, + #[doc = "The class to represent a REST reference link. RFC:<http://tools>.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them."] + #[serde( + rename = "requestedFile", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_file: Option<ReferenceLink>, + #[doc = "The class to represent a REST reference link. RFC:<http://tools>.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them."] + #[serde( + rename = "snapshotMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub snapshot_metadata: Option<ReferenceLink>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub versions: Option<ReferenceLinks>, + #[doc = "The class to represent a REST reference link. RFC:<http://tools>.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them."] + #[serde( + rename = "versionsIndex", + default, + skip_serializing_if = "Option::is_none" + )] + pub versions_index: Option<ReferenceLink>, } impl MavenPackage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deletion state of a maven package."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPackageVersionDeletionState { - #[doc = "Artifact Id of the package."] - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<String>, - #[doc = "UTC date the package was deleted."] - #[serde( - rename = "deletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deleted_date: Option<time::OffsetDateTime>, - #[doc = "Group Id of the package."] - #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] - pub group_id: Option<String>, - #[doc = "Version of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Artifact Id of the package."] + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<String>, + #[doc = "UTC date the package was deleted."] + #[serde( + rename = "deletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deleted_date: Option<time::OffsetDateTime>, + #[doc = "Group Id of the package."] + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option<String>, + #[doc = "Version of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl MavenPackageVersionDeletionState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A batch of operations to apply to package versions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPackagesBatchRequest { - #[doc = "Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<BatchOperationData>, - #[doc = "Type of operation that needs to be performed on packages."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option<maven_packages_batch_request::Operation>, - #[doc = "The packages onto which the operation will be performed."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub packages: Vec<MavenMinimalPackageDetails>, + #[doc = "Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<BatchOperationData>, + #[doc = "Type of operation that needs to be performed on packages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option<maven_packages_batch_request::Operation>, + #[doc = "The packages onto which the operation will be performed."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub packages: Vec<MavenMinimalPackageDetails>, } impl MavenPackagesBatchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod maven_packages_batch_request { - use super::*; - #[doc = "Type of operation that needs to be performed on packages."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Operation { - #[serde(rename = "promote")] - Promote, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "permanentDelete")] - PermanentDelete, - #[serde(rename = "restoreToFeed")] - RestoreToFeed, - } + use super::*; + #[doc = "Type of operation that needs to be performed on packages."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Operation { + #[serde(rename = "promote")] + Promote, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "permanentDelete")] + PermanentDelete, + #[serde(rename = "restoreToFeed")] + RestoreToFeed, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomBuild { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub plugins: Vec<Plugin>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub plugins: Vec<Plugin>, } impl MavenPomBuild { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomCi { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub notifiers: Vec<MavenPomCiNotifier>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub system: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub notifiers: Vec<MavenPomCiNotifier>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub system: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl MavenPomCi { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomCiNotifier { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub configuration: Vec<String>, - #[serde( - rename = "sendOnError", - default, - skip_serializing_if = "Option::is_none" - )] - pub send_on_error: Option<String>, - #[serde( - rename = "sendOnFailure", - default, - skip_serializing_if = "Option::is_none" - )] - pub send_on_failure: Option<String>, - #[serde( - rename = "sendOnSuccess", - default, - skip_serializing_if = "Option::is_none" - )] - pub send_on_success: Option<String>, - #[serde( - rename = "sendOnWarning", - default, - skip_serializing_if = "Option::is_none" - )] - pub send_on_warning: Option<String>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub configuration: Vec<String>, + #[serde( + rename = "sendOnError", + default, + skip_serializing_if = "Option::is_none" + )] + pub send_on_error: Option<String>, + #[serde( + rename = "sendOnFailure", + default, + skip_serializing_if = "Option::is_none" + )] + pub send_on_failure: Option<String>, + #[serde( + rename = "sendOnSuccess", + default, + skip_serializing_if = "Option::is_none" + )] + pub send_on_success: Option<String>, + #[serde( + rename = "sendOnWarning", + default, + skip_serializing_if = "Option::is_none" + )] + pub send_on_warning: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl MavenPomCiNotifier { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomDependency { - #[serde(flatten)] - pub maven_pom_gav: MavenPomGav, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub optional: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde(flatten)] + pub maven_pom_gav: MavenPomGav, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub optional: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl MavenPomDependency { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomDependencyManagement { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dependencies: Vec<MavenPomDependency>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dependencies: Vec<MavenPomDependency>, } impl MavenPomDependencyManagement { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomGav { - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<String>, - #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] - pub group_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<String>, + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl MavenPomGav { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomIssueManagement { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub system: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub system: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl MavenPomIssueManagement { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomLicense { - #[serde(flatten)] - pub maven_pom_organization: MavenPomOrganization, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub distribution: Option<String>, + #[serde(flatten)] + pub maven_pom_organization: MavenPomOrganization, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distribution: Option<String>, } impl MavenPomLicense { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomMailingList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub archive: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "otherArchives", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub other_archives: Vec<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub post: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subscribe: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unsubscribe: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub archive: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "otherArchives", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub other_archives: Vec<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub post: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subscribe: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unsubscribe: Option<String>, } impl MavenPomMailingList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomMetadata { - #[serde(flatten)] - pub maven_pom_gav: MavenPomGav, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<MavenPomBuild>, - #[doc = ""] - #[serde( - rename = "ciManagement", - default, - skip_serializing_if = "Option::is_none" - )] - pub ci_management: Option<MavenPomCi>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub contributors: Vec<MavenPomPerson>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dependencies: Vec<MavenPomDependency>, - #[doc = ""] - #[serde( - rename = "dependencyManagement", - default, - skip_serializing_if = "Option::is_none" - )] - pub dependency_management: Option<MavenPomDependencyManagement>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub developers: Vec<MavenPomPerson>, - #[doc = ""] - #[serde( - rename = "distributionManagement", - default, - skip_serializing_if = "Option::is_none" - )] - pub distribution_management: Option<MavenDistributionManagement>, - #[serde( - rename = "inceptionYear", - default, - skip_serializing_if = "Option::is_none" - )] - pub inception_year: Option<String>, - #[doc = ""] - #[serde( - rename = "issueManagement", - default, - skip_serializing_if = "Option::is_none" - )] - pub issue_management: Option<MavenPomIssueManagement>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub licenses: Vec<MavenPomLicense>, - #[serde( - rename = "mailingLists", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mailing_lists: Vec<MavenPomMailingList>, - #[serde( - rename = "modelVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub model_version: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub modules: Vec<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub organization: Option<MavenPomOrganization>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub packaging: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option<MavenPomParent>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub prerequisites: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scm: Option<MavenPomScm>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(flatten)] + pub maven_pom_gav: MavenPomGav, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<MavenPomBuild>, + #[doc = ""] + #[serde( + rename = "ciManagement", + default, + skip_serializing_if = "Option::is_none" + )] + pub ci_management: Option<MavenPomCi>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub contributors: Vec<MavenPomPerson>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dependencies: Vec<MavenPomDependency>, + #[doc = ""] + #[serde( + rename = "dependencyManagement", + default, + skip_serializing_if = "Option::is_none" + )] + pub dependency_management: Option<MavenPomDependencyManagement>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub developers: Vec<MavenPomPerson>, + #[doc = ""] + #[serde( + rename = "distributionManagement", + default, + skip_serializing_if = "Option::is_none" + )] + pub distribution_management: Option<MavenDistributionManagement>, + #[serde( + rename = "inceptionYear", + default, + skip_serializing_if = "Option::is_none" + )] + pub inception_year: Option<String>, + #[doc = ""] + #[serde( + rename = "issueManagement", + default, + skip_serializing_if = "Option::is_none" + )] + pub issue_management: Option<MavenPomIssueManagement>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub licenses: Vec<MavenPomLicense>, + #[serde( + rename = "mailingLists", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mailing_lists: Vec<MavenPomMailingList>, + #[serde( + rename = "modelVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub model_version: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub modules: Vec<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub organization: Option<MavenPomOrganization>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub packaging: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option<MavenPomParent>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub prerequisites: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scm: Option<MavenPomScm>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl MavenPomMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomOrganization { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl MavenPomOrganization { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomParent { - #[serde(flatten)] - pub maven_pom_gav: MavenPomGav, - #[serde( - rename = "relativePath", - default, - skip_serializing_if = "Option::is_none" - )] - pub relative_path: Option<String>, + #[serde(flatten)] + pub maven_pom_gav: MavenPomGav, + #[serde( + rename = "relativePath", + default, + skip_serializing_if = "Option::is_none" + )] + pub relative_path: Option<String>, } impl MavenPomParent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomPerson { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub email: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub organization: Option<String>, - #[serde( - rename = "organizationUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub organization_url: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub roles: Vec<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timezone: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub organization: Option<String>, + #[serde( + rename = "organizationUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub organization_url: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub roles: Vec<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timezone: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl MavenPomPerson { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenPomScm { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub connection: Option<String>, - #[serde( - rename = "developerConnection", - default, - skip_serializing_if = "Option::is_none" - )] - pub developer_connection: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tag: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub connection: Option<String>, + #[serde( + rename = "developerConnection", + default, + skip_serializing_if = "Option::is_none" + )] + pub developer_connection: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tag: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl MavenPomScm { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenRecycleBinPackageVersionDetails { - #[doc = "Setting to false will undo earlier deletion and restore the package to feed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deleted: Option<bool>, + #[doc = "Setting to false will undo earlier deletion and restore the package to feed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deleted: Option<bool>, } impl MavenRecycleBinPackageVersionDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenRepository { - #[serde( - rename = "uniqueVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub unique_version: Option<bool>, + #[serde( + rename = "uniqueVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub unique_version: Option<bool>, } impl MavenRepository { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MavenSnapshotRepository { - #[serde(flatten)] - pub maven_repository: MavenRepository, + #[serde(flatten)] + pub maven_repository: MavenRepository, } impl MavenSnapshotRepository { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Minimal package details required to identify a package within a protocol."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MinimalPackageDetails { - #[doc = "Package name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Package version."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Package name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Package version."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl MinimalPackageDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deletion state of an npm package."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NpmPackageVersionDeletionState { - #[doc = "Name of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "UTC date the package was unpublished."] - #[serde( - rename = "unpublishedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub unpublished_date: Option<time::OffsetDateTime>, - #[doc = "Version of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Name of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "UTC date the package was unpublished."] + #[serde( + rename = "unpublishedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub unpublished_date: Option<time::OffsetDateTime>, + #[doc = "Version of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl NpmPackageVersionDeletionState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A batch of operations to apply to package versions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NpmPackagesBatchRequest { - #[doc = "Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<BatchOperationData>, - #[doc = "Type of operation that needs to be performed on packages."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option<npm_packages_batch_request::Operation>, - #[doc = "The packages onto which the operation will be performed."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub packages: Vec<MinimalPackageDetails>, + #[doc = "Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<BatchOperationData>, + #[doc = "Type of operation that needs to be performed on packages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option<npm_packages_batch_request::Operation>, + #[doc = "The packages onto which the operation will be performed."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub packages: Vec<MinimalPackageDetails>, } impl NpmPackagesBatchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod npm_packages_batch_request { - use super::*; - #[doc = "Type of operation that needs to be performed on packages."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Operation { - #[serde(rename = "promote")] - Promote, - #[serde(rename = "deprecate")] - Deprecate, - #[serde(rename = "unpublish")] - Unpublish, - #[serde(rename = "permanentDelete")] - PermanentDelete, - #[serde(rename = "restoreToFeed")] - RestoreToFeed, - #[serde(rename = "delete")] - Delete, - } + use super::*; + #[doc = "Type of operation that needs to be performed on packages."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Operation { + #[serde(rename = "promote")] + Promote, + #[serde(rename = "deprecate")] + Deprecate, + #[serde(rename = "unpublish")] + Unpublish, + #[serde(rename = "permanentDelete")] + PermanentDelete, + #[serde(rename = "restoreToFeed")] + RestoreToFeed, + #[serde(rename = "delete")] + Delete, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NpmRecycleBinPackageVersionDetails { - #[doc = "Setting to false will undo earlier deletion and restore the package to feed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deleted: Option<bool>, + #[doc = "Setting to false will undo earlier deletion and restore the package to feed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deleted: Option<bool>, } impl NpmRecycleBinPackageVersionDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deletion state of a NuGet package."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NuGetPackageVersionDeletionState { - #[doc = "Utc date the package was deleted."] - #[serde( - rename = "deletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deleted_date: Option<time::OffsetDateTime>, - #[doc = "Name of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Version of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Utc date the package was deleted."] + #[serde( + rename = "deletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deleted_date: Option<time::OffsetDateTime>, + #[doc = "Name of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Version of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl NuGetPackageVersionDeletionState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A batch of operations to apply to package versions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NuGetPackagesBatchRequest { - #[doc = "Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<BatchOperationData>, - #[doc = "Type of operation that needs to be performed on packages."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option<nu_get_packages_batch_request::Operation>, - #[doc = "The packages onto which the operation will be performed."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub packages: Vec<MinimalPackageDetails>, + #[doc = "Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<BatchOperationData>, + #[doc = "Type of operation that needs to be performed on packages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option<nu_get_packages_batch_request::Operation>, + #[doc = "The packages onto which the operation will be performed."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub packages: Vec<MinimalPackageDetails>, } impl NuGetPackagesBatchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod nu_get_packages_batch_request { - use super::*; - #[doc = "Type of operation that needs to be performed on packages."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Operation { - #[serde(rename = "promote")] - Promote, - #[serde(rename = "list")] - List, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "permanentDelete")] - PermanentDelete, - #[serde(rename = "restoreToFeed")] - RestoreToFeed, - } + use super::*; + #[doc = "Type of operation that needs to be performed on packages."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Operation { + #[serde(rename = "promote")] + Promote, + #[serde(rename = "list")] + List, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "permanentDelete")] + PermanentDelete, + #[serde(rename = "restoreToFeed")] + RestoreToFeed, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NuGetRecycleBinPackageVersionDetails { - #[doc = "Setting to false will undo earlier deletion and restore the package to feed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deleted: Option<bool>, + #[doc = "Setting to false will undo earlier deletion and restore the package to feed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deleted: Option<bool>, } impl NuGetRecycleBinPackageVersionDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Package version metadata for a Maven package"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Package { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "If and when the package was deleted."] - #[serde( - rename = "deletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deleted_date: Option<time::OffsetDateTime>, - #[doc = "Package Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The display name of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "If and when the package was permanently deleted."] - #[serde( - rename = "permanentlyDeletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub permanently_deleted_date: Option<time::OffsetDateTime>, - #[doc = "The history of upstream sources for this package. The first source in the list is the immediate source from which this package was saved."] - #[serde( - rename = "sourceChain", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub source_chain: Vec<UpstreamSourceInfo>, - #[doc = "The version of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "If and when the package was deleted."] + #[serde( + rename = "deletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deleted_date: Option<time::OffsetDateTime>, + #[doc = "Package Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The display name of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "If and when the package was permanently deleted."] + #[serde( + rename = "permanentlyDeletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub permanently_deleted_date: Option<time::OffsetDateTime>, + #[doc = "The history of upstream sources for this package. The first source in the list is the immediate source from which this package was saved."] + #[serde( + rename = "sourceChain", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub source_chain: Vec<UpstreamSourceInfo>, + #[doc = "The version of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl Package { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageVersionDetails { - #[doc = "The JSON model for a JSON Patch operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub views: Option<JsonPatchOperation>, + #[doc = "The JSON model for a JSON Patch operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub views: Option<JsonPatchOperation>, } impl PackageVersionDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Plugin { - #[serde(flatten)] - pub maven_pom_gav: MavenPomGav, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<PluginConfiguration>, + #[serde(flatten)] + pub maven_pom_gav: MavenPomGav, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<PluginConfiguration>, } impl Plugin { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PluginConfiguration { - #[serde( - rename = "goalPrefix", - default, - skip_serializing_if = "Option::is_none" - )] - pub goal_prefix: Option<String>, + #[serde( + rename = "goalPrefix", + default, + skip_serializing_if = "Option::is_none" + )] + pub goal_prefix: Option<String>, } impl PluginConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deletion state of a Python package."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PyPiPackageVersionDeletionState { - #[doc = "UTC date the package was deleted."] - #[serde( - rename = "deletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deleted_date: Option<time::OffsetDateTime>, - #[doc = "Name of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Version of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "UTC date the package was deleted."] + #[serde( + rename = "deletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deleted_date: Option<time::OffsetDateTime>, + #[doc = "Name of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Version of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl PyPiPackageVersionDeletionState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A batch of operations to apply to package versions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PyPiPackagesBatchRequest { - #[doc = "Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<BatchOperationData>, - #[doc = "Type of operation that needs to be performed on packages."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option<py_pi_packages_batch_request::Operation>, - #[doc = "The packages onto which the operation will be performed."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub packages: Vec<MinimalPackageDetails>, + #[doc = "Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<BatchOperationData>, + #[doc = "Type of operation that needs to be performed on packages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option<py_pi_packages_batch_request::Operation>, + #[doc = "The packages onto which the operation will be performed."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub packages: Vec<MinimalPackageDetails>, } impl PyPiPackagesBatchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod py_pi_packages_batch_request { - use super::*; - #[doc = "Type of operation that needs to be performed on packages."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Operation { - #[serde(rename = "promote")] - Promote, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "permanentDelete")] - PermanentDelete, - #[serde(rename = "restoreToFeed")] - RestoreToFeed, - } + use super::*; + #[doc = "Type of operation that needs to be performed on packages."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Operation { + #[serde(rename = "promote")] + Promote, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "permanentDelete")] + PermanentDelete, + #[serde(rename = "restoreToFeed")] + RestoreToFeed, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PyPiRecycleBinPackageVersionDetails { - #[doc = "Setting to false will undo earlier deletion and restore the package to feed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deleted: Option<bool>, + #[doc = "Setting to false will undo earlier deletion and restore the package to feed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deleted: Option<bool>, } impl PyPiRecycleBinPackageVersionDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a REST reference link. RFC:<http://tools>.ietf.org/html/draft-kelly-json-hal-06 The RFC is not fully implemented, additional properties are allowed on the reference link but as of yet we don't have a need for them."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLink { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub href: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub href: Option<String>, } impl ReferenceLink { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deletion state of a Universal package."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UPackPackageVersionDeletionState { - #[doc = "UTC date the package was deleted."] - #[serde( - rename = "deletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deleted_date: Option<time::OffsetDateTime>, - #[doc = "Name of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Version of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "UTC date the package was deleted."] + #[serde( + rename = "deletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deleted_date: Option<time::OffsetDateTime>, + #[doc = "Name of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Version of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl UPackPackageVersionDeletionState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A batch of operations to apply to package versions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UPackPackagesBatchRequest { - #[doc = "Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<BatchOperationData>, - #[doc = "Type of operation that needs to be performed on packages."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option<u_pack_packages_batch_request::Operation>, - #[doc = "The packages onto which the operation will be performed."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub packages: Vec<MinimalPackageDetails>, + #[doc = "Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<BatchOperationData>, + #[doc = "Type of operation that needs to be performed on packages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option<u_pack_packages_batch_request::Operation>, + #[doc = "The packages onto which the operation will be performed."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub packages: Vec<MinimalPackageDetails>, } impl UPackPackagesBatchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod u_pack_packages_batch_request { - use super::*; - #[doc = "Type of operation that needs to be performed on packages."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Operation { - #[serde(rename = "promote")] - Promote, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "permanentDelete")] - PermanentDelete, - #[serde(rename = "restoreToFeed")] - RestoreToFeed, - } + use super::*; + #[doc = "Type of operation that needs to be performed on packages."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Operation { + #[serde(rename = "promote")] + Promote, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "permanentDelete")] + PermanentDelete, + #[serde(rename = "restoreToFeed")] + RestoreToFeed, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UPackRecycleBinPackageVersionDetails { - #[doc = "Setting to false will undo earlier deletion and restore the package to feed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deleted: Option<bool>, + #[doc = "Setting to false will undo earlier deletion and restore the package to feed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deleted: Option<bool>, } impl UPackRecycleBinPackageVersionDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Upstream source definition, including its Identity, package type, and other associated information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpstreamSourceInfo { - #[doc = "Locator for connecting to the upstream source in a user friendly format, that may potentially change over time"] - #[serde( - rename = "displayLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_location: Option<String>, - #[doc = "Identity of the upstream source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Locator for connecting to the upstream source"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option<String>, - #[doc = "Display name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Source type, such as Public or Internal."] - #[serde( - rename = "sourceType", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_type: Option<upstream_source_info::SourceType>, + #[doc = "Locator for connecting to the upstream source in a user friendly format, that may potentially change over time"] + #[serde( + rename = "displayLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_location: Option<String>, + #[doc = "Identity of the upstream source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Locator for connecting to the upstream source"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option<String>, + #[doc = "Display name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Source type, such as Public or Internal."] + #[serde( + rename = "sourceType", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_type: Option<upstream_source_info::SourceType>, } impl UpstreamSourceInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod upstream_source_info { - use super::*; - #[doc = "Source type, such as Public or Internal."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SourceType { - #[serde(rename = "public")] - Public, - #[serde(rename = "internal")] - Internal, - } + use super::*; + #[doc = "Source type, such as Public or Internal."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SourceType { + #[serde(rename = "public")] + Public, + #[serde(rename = "internal")] + Internal, + } } #[doc = "Describes upstreaming behavior for a given feed/protocol/package"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpstreamingBehavior { - #[doc = "Indicates whether external upstream versions should be considered for this package"] - #[serde( - rename = "versionsFromExternalUpstreams", - default, - skip_serializing_if = "Option::is_none" - )] - pub versions_from_external_upstreams: - Option<upstreaming_behavior::VersionsFromExternalUpstreams>, + #[doc = "Indicates whether external upstream versions should be considered for this package"] + #[serde( + rename = "versionsFromExternalUpstreams", + default, + skip_serializing_if = "Option::is_none" + )] + pub versions_from_external_upstreams: Option<upstreaming_behavior::VersionsFromExternalUpstreams>, } impl UpstreamingBehavior { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod upstreaming_behavior { - use super::*; - #[doc = "Indicates whether external upstream versions should be considered for this package"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionsFromExternalUpstreams { - #[serde(rename = "auto")] - Auto, - #[serde(rename = "allowExternalVersions")] - AllowExternalVersions, - } + use super::*; + #[doc = "Indicates whether external upstream versions should be considered for this package"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionsFromExternalUpstreams { + #[serde(rename = "auto")] + Auto, + #[serde(rename = "allowExternalVersions")] + AllowExternalVersions, + } } diff --git a/azure_devops_rust_api/src/audit/mod.rs b/azure_devops_rust_api/src/audit/mod.rs index be0a765e..23891d43 100644 --- a/azure_devops_rust_api/src/audit/mod.rs +++ b/azure_devops_rust_api/src/audit/mod.rs @@ -9,1300 +9,1311 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://auditservice.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + 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()) + } +} +pub mod actions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all auditable actions filterable by area."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + area_name: None, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AuditActionInfoList> { + let bytes = self.0.into_body().collect().await?; + let body: models::AuditActionInfoList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) area_name: Option<String>, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); + impl RequestBuilder { + #[doc = "Optional. Get actions scoped to area"] + pub fn area_name(mut self, area_name: impl Into<String>) -> Self { + self.area_name = Some(area_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/audit/actions", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(area_name) = &this.area_name { + req + .url_mut() + .query_pairs_mut() + .append_pair("areaName", area_name); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AuditActionInfoList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AuditActionInfoList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod audit_log { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Queries audit log entries"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn query(&self, organization: impl Into<String>) -> 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 query { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AuditLogQueryResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::AuditLogQueryResult = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) start_time: Option<time::OffsetDateTime>, + pub(crate) end_time: Option<time::OffsetDateTime>, + pub(crate) batch_size: Option<i32>, + pub(crate) continuation_token: Option<String>, + pub(crate) skip_aggregation: Option<bool>, + } + impl RequestBuilder { + #[doc = "Start time of download window. Optional"] + pub fn start_time(mut self, start_time: impl Into<time::OffsetDateTime>) -> Self { + self.start_time = Some(start_time.into()); self + } + #[doc = "End time of download window. Optional"] + pub fn end_time(mut self, end_time: impl Into<time::OffsetDateTime>) -> Self { + self.end_time = Some(end_time.into()); + self + } + #[doc = "Max number of results to return. Optional"] + pub fn batch_size(mut self, batch_size: i32) -> Self { + self.batch_size = Some(batch_size); + self + } + #[doc = "Token used for returning next set of results from previous query. Optional"] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "Skips aggregating events and leaves them as individual entries instead. By default events are aggregated. Event types that are aggregated: AuditLog.AccessLog."] + pub fn skip_aggregation(mut self, skip_aggregation: bool) -> Self { + self.skip_aggregation = Some(skip_aggregation); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/audit/auditlog", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AuditLogQueryResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AuditLogQueryResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod download_log { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Downloads audit log entries."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `format`: File format for download. Can be \"json\" or \"csv\"."] + pub fn download_log( + &self, + organization: impl Into<String>, + format: impl Into<String>, + ) -> download_log::RequestBuilder { + download_log::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + format: format.into(), + start_time: None, + end_time: None, + } + } + } + pub mod download_log { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) format: String, + pub(crate) start_time: Option<time::OffsetDateTime>, + pub(crate) end_time: Option<time::OffsetDateTime>, + } + impl RequestBuilder { + #[doc = "Start time of download window. Optional"] + pub fn start_time(mut self, start_time: impl Into<time::OffsetDateTime>) -> Self { + self.start_time = Some(start_time.into()); + self + } + #[doc = "End time of download window. Optional"] + pub fn end_time(mut self, end_time: impl Into<time::OffsetDateTime>) -> Self { + self.end_time = Some(end_time.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/audit/downloadlog", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() +pub mod streams { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Return all Audit Streams scoped to an organization"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn query_all_streams( + &self, + organization: impl Into<String>, + ) -> query_all_streams::RequestBuilder { + query_all_streams::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential + #[doc = "Create new Audit Stream"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Stream entry"] + #[doc = "* `days_to_backfill`: The number of days of previously recorded audit data that will be replayed into the stream. A value of zero will result in only new events being streamed."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::AuditStream>, + days_to_backfill: i32, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + days_to_backfill, + } } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() + #[doc = "Update existing Audit Stream"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Stream entry"] + pub fn update_stream( + &self, + organization: impl Into<String>, + body: impl Into<models::AuditStream>, + ) -> update_stream::RequestBuilder { + update_stream::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await + #[doc = "Return Audit Stream with id of streamId if one exists otherwise throw"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `stream_id`: Id of stream entry to retrieve"] + pub fn query_stream_by_id( + &self, + organization: impl Into<String>, + stream_id: i32, + ) -> query_stream_by_id::RequestBuilder { + query_stream_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + stream_id, + } } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) + #[doc = "Update existing Audit Stream status"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `stream_id`: Id of stream entry to be updated"] + #[doc = "* `status`: Status of the stream"] + pub fn update_status( + &self, + organization: impl Into<String>, + stream_id: i32, + status: impl Into<String>, + ) -> update_status::RequestBuilder { + update_status::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + stream_id, + status: status.into(), + } } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } + #[doc = "Delete Audit Stream"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `stream_id`: Id of stream entry to delete"] + pub fn delete( + &self, + organization: impl Into<String>, + stream_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + stream_id, + } } - pub fn actions_client(&self) -> actions::Client { - actions::Client(self.clone()) + } + pub mod query_all_streams { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AuditStreamList> { + let bytes = self.0.into_body().collect().await?; + let body: models::AuditStreamList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub fn audit_log_client(&self) -> audit_log::Client { - audit_log::Client(self.clone()) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn download_log_client(&self) -> download_log::Client { - download_log::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub fn streams_client(&self) -> streams::Client { - streams::Client(self.clone()) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, } -} -pub mod actions { + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/audit/streams", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AuditStreamList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AuditStreamList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get all auditable actions filterable by area."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - area_name: None, - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AuditStream> { + let bytes = self.0.into_body().collect().await?; + let body: models::AuditStream = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AuditActionInfoList> { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditActionInfoList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) area_name: Option<String>, - } - impl RequestBuilder { - #[doc = "Optional. Get actions scoped to area"] - pub fn area_name(mut self, area_name: impl Into<String>) -> Self { - self.area_name = Some(area_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/audit/actions", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(area_name) = &this.area_name { - req.url_mut() - .query_pairs_mut() - .append_pair("areaName", area_name); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AuditActionInfoList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::AuditActionInfoList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } -} -pub mod audit_log { + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::AuditStream, + pub(crate) days_to_backfill: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/audit/streams", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AuditStream>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AuditStream>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_stream { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Queries audit log entries"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn query(&self, organization: impl Into<String>) -> 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 struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AuditStream> { + let bytes = self.0.into_body().collect().await?; + let body: models::AuditStream = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub mod query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AuditLogQueryResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditLogQueryResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) start_time: Option<time::OffsetDateTime>, - pub(crate) end_time: Option<time::OffsetDateTime>, - pub(crate) batch_size: Option<i32>, - pub(crate) continuation_token: Option<String>, - pub(crate) skip_aggregation: Option<bool>, - } - impl RequestBuilder { - #[doc = "Start time of download window. Optional"] - pub fn start_time(mut self, start_time: impl Into<time::OffsetDateTime>) -> Self { - self.start_time = Some(start_time.into()); - self - } - #[doc = "End time of download window. Optional"] - pub fn end_time(mut self, end_time: impl Into<time::OffsetDateTime>) -> Self { - self.end_time = Some(end_time.into()); - self - } - #[doc = "Max number of results to return. Optional"] - pub fn batch_size(mut self, batch_size: i32) -> Self { - self.batch_size = Some(batch_size); - self - } - #[doc = "Token used for returning next set of results from previous query. Optional"] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Skips aggregating events and leaves them as individual entries instead. By default events are aggregated. Event types that are aggregated: AuditLog.AccessLog."] - pub fn skip_aggregation(mut self, skip_aggregation: bool) -> Self { - self.skip_aggregation = Some(skip_aggregation); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/audit/auditlog", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AuditLogQueryResult>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::AuditLogQueryResult>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } -} -pub mod download_log { + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::AuditStream, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/audit/streams", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AuditStream>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AuditStream>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod query_stream_by_id { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Downloads audit log entries."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `format`: File format for download. Can be \"json\" or \"csv\"."] - pub fn download_log( - &self, - organization: impl Into<String>, - format: impl Into<String>, - ) -> download_log::RequestBuilder { - download_log::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - format: format.into(), - start_time: None, - end_time: None, - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AuditStream> { + let bytes = self.0.into_body().collect().await?; + let body: models::AuditStream = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub mod download_log { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) format: String, - pub(crate) start_time: Option<time::OffsetDateTime>, - pub(crate) end_time: Option<time::OffsetDateTime>, - } - impl RequestBuilder { - #[doc = "Start time of download window. Optional"] - pub fn start_time(mut self, start_time: impl Into<time::OffsetDateTime>) -> Self { - self.start_time = Some(start_time.into()); - self - } - #[doc = "End time of download window. Optional"] - pub fn end_time(mut self, end_time: impl Into<time::OffsetDateTime>) -> Self { - self.end_time = Some(end_time.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/audit/downloadlog", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } -} -pub mod streams { + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) stream_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/audit/streams/{}", + this.client.endpoint(), + &this.organization, + &this.stream_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AuditStream>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AuditStream>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_status { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Return all Audit Streams scoped to an organization"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn query_all_streams( - &self, - organization: impl Into<String>, - ) -> query_all_streams::RequestBuilder { - query_all_streams::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - #[doc = "Create new Audit Stream"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Stream entry"] - #[doc = "* `days_to_backfill`: The number of days of previously recorded audit data that will be replayed into the stream. A value of zero will result in only new events being streamed."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::AuditStream>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Stream entry"] - pub fn update_stream( - &self, - organization: impl Into<String>, - body: impl Into<models::AuditStream>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `stream_id`: Id of stream entry to retrieve"] - pub fn query_stream_by_id( - &self, - organization: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `stream_id`: Id of stream entry to be updated"] - #[doc = "* `status`: Status of the stream"] - pub fn update_status( - &self, - organization: impl Into<String>, - stream_id: i32, - status: impl Into<String>, - ) -> update_status::RequestBuilder { - update_status::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - stream_id, - status: status.into(), - } - } - #[doc = "Delete Audit Stream"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `stream_id`: Id of stream entry to delete"] - pub fn delete( - &self, - organization: impl Into<String>, - stream_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - stream_id, - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AuditStream> { + let bytes = self.0.into_body().collect().await?; + let body: models::AuditStream = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub mod query_all_streams { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AuditStreamList> { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditStreamList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/audit/streams", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AuditStreamList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::AuditStreamList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AuditStream> { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditStream = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::AuditStream, - pub(crate) days_to_backfill: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/audit/streams", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AuditStream>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::AuditStream>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub mod update_stream { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AuditStream> { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditStream = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::AuditStream, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/audit/streams", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AuditStream>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::AuditStream>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) stream_id: i32, + pub(crate) status: String, } - pub mod query_stream_by_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AuditStream> { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditStream = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) stream_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/audit/streams/{}", - this.client.endpoint(), - &this.organization, - &this.stream_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AuditStream>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::AuditStream>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/audit/streams/{}", + this.client.endpoint(), + &this.organization, + &this.stream_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let status = &this.status; + req + .url_mut() + .query_pairs_mut() + .append_pair("status", status); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub mod update_status { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AuditStream> { - let bytes = self.0.into_body().collect().await?; - let body: models::AuditStream = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) stream_id: i32, - pub(crate) status: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/audit/streams/{}", - this.client.endpoint(), - &this.organization, - &this.stream_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let status = &this.status; - req.url_mut() - .query_pairs_mut() - .append_pair("status", status); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AuditStream>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::AuditStream>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AuditStream>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AuditStream>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) stream_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/audit/streams/{}", - this.client.endpoint(), - &this.organization, - &this.stream_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) stream_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/audit/streams/{}", + this.client.endpoint(), + &this.organization, + &this.stream_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } diff --git a/azure_devops_rust_api/src/audit/models.rs b/azure_devops_rust_api/src/audit/models.rs index 05c54396..92076547 100644 --- a/azure_devops_rust_api/src/audit/models.rs +++ b/azure_devops_rust_api/src/audit/models.rs @@ -8,458 +8,442 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuditActionInfo { - #[doc = "The action id for the event, i.e Git.CreateRepo, Project.RenameProject"] - #[serde(rename = "actionId", default, skip_serializing_if = "Option::is_none")] - pub action_id: Option<String>, - #[doc = "Area of Azure DevOps the action occurred"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub area: Option<String>, - #[doc = "Type of action executed"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option<audit_action_info::Category>, + #[doc = "The action id for the event, i.e Git.CreateRepo, Project.RenameProject"] + #[serde(rename = "actionId", default, skip_serializing_if = "Option::is_none")] + pub action_id: Option<String>, + #[doc = "Area of Azure DevOps the action occurred"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub area: Option<String>, + #[doc = "Type of action executed"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option<audit_action_info::Category>, } impl AuditActionInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod audit_action_info { - use super::*; - #[doc = "Type of action executed"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Category { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "modify")] - Modify, - #[serde(rename = "remove")] - Remove, - #[serde(rename = "create")] - Create, - #[serde(rename = "access")] - Access, - #[serde(rename = "execute")] - Execute, - } + use super::*; + #[doc = "Type of action executed"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Category { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "modify")] + Modify, + #[serde(rename = "remove")] + Remove, + #[serde(rename = "create")] + Create, + #[serde(rename = "access")] + Access, + #[serde(rename = "execute")] + Execute, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuditActionInfoList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<AuditActionInfo>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<AuditActionInfo>, } impl AuditActionInfoList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuditLogEntry { - #[doc = "The action if for the event, i.e Git.CreateRepo, Project.RenameProject"] - #[serde(rename = "actionId", default, skip_serializing_if = "Option::is_none")] - pub action_id: Option<String>, - #[doc = "ActivityId"] - #[serde( - rename = "activityId", - default, - skip_serializing_if = "Option::is_none" - )] - pub activity_id: Option<String>, - #[doc = "The Actor's Client Id (if actor is a service principal)"] - #[serde( - rename = "actorClientId", - default, - skip_serializing_if = "Option::is_none" - )] - pub actor_client_id: Option<String>, - #[doc = "The Actor's CUID"] - #[serde(rename = "actorCUID", default, skip_serializing_if = "Option::is_none")] - pub actor_cuid: Option<String>, - #[doc = "The Actor's UPN"] - #[serde(rename = "actorUPN", default, skip_serializing_if = "Option::is_none")] - pub actor_upn: Option<String>, - #[doc = "The Actor's User Id (if actor is a user)"] - #[serde( - rename = "actorUserId", - default, - skip_serializing_if = "Option::is_none" - )] - pub actor_user_id: Option<String>, - #[doc = "Type of authentication used by the author"] - #[serde( - rename = "authenticationMechanism", - default, - skip_serializing_if = "Option::is_none" - )] - pub authentication_mechanism: Option<String>, - #[doc = "This allows us to group things together, like one user action that caused a cascade of event entries (project creation)."] - #[serde( - rename = "correlationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub correlation_id: Option<String>, - #[doc = "External data such as CUIDs, item names, etc."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "EventId, should be unique"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "IP Address where the event was originated"] - #[serde(rename = "ipAddress", default, skip_serializing_if = "Option::is_none")] - pub ip_address: Option<String>, - #[doc = "When specified, the id of the project this event is associated to"] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "The organization Id (Organization is the only scope currently supported)"] - #[serde(rename = "scopeId", default, skip_serializing_if = "Option::is_none")] - pub scope_id: Option<String>, - #[doc = "The type of the scope (Organization is only scope currently supported)"] - #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] - pub scope_type: Option<audit_log_entry::ScopeType>, - #[doc = "The time when the event occurred in UTC"] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub timestamp: Option<time::OffsetDateTime>, - #[doc = "The user agent from the request"] - #[serde(rename = "userAgent", default, skip_serializing_if = "Option::is_none")] - pub user_agent: Option<String>, + #[doc = "The action if for the event, i.e Git.CreateRepo, Project.RenameProject"] + #[serde(rename = "actionId", default, skip_serializing_if = "Option::is_none")] + pub action_id: Option<String>, + #[doc = "ActivityId"] + #[serde( + rename = "activityId", + default, + skip_serializing_if = "Option::is_none" + )] + pub activity_id: Option<String>, + #[doc = "The Actor's CUID"] + #[serde(rename = "actorCUID", default, skip_serializing_if = "Option::is_none")] + pub actor_cuid: Option<String>, + #[doc = "The Actor's UPN"] + #[serde(rename = "actorUPN", default, skip_serializing_if = "Option::is_none")] + pub actor_upn: Option<String>, + #[doc = "The Actor's User Id"] + #[serde( + rename = "actorUserId", + default, + skip_serializing_if = "Option::is_none" + )] + pub actor_user_id: Option<String>, + #[doc = "Type of authentication used by the author"] + #[serde( + rename = "authenticationMechanism", + default, + skip_serializing_if = "Option::is_none" + )] + pub authentication_mechanism: Option<String>, + #[doc = "This allows us to group things together, like one user action that caused a cascade of event entries (project creation)."] + #[serde( + rename = "correlationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub correlation_id: Option<String>, + #[doc = "External data such as CUIDs, item names, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "EventId, should be unique"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "IP Address where the event was originated"] + #[serde(rename = "ipAddress", default, skip_serializing_if = "Option::is_none")] + pub ip_address: Option<String>, + #[doc = "When specified, the id of the project this event is associated to"] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "The organization Id (Organization is the only scope currently supported)"] + #[serde(rename = "scopeId", default, skip_serializing_if = "Option::is_none")] + pub scope_id: Option<String>, + #[doc = "The type of the scope (Organization is only scope currently supported)"] + #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] + pub scope_type: Option<audit_log_entry::ScopeType>, + #[doc = "The time when the event occurred in UTC"] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub timestamp: Option<time::OffsetDateTime>, + #[doc = "The user agent from the request"] + #[serde(rename = "userAgent", default, skip_serializing_if = "Option::is_none")] + pub user_agent: Option<String>, } impl AuditLogEntry { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod audit_log_entry { - use super::*; - #[doc = "The type of the scope (Organization is only scope currently supported)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ScopeType { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "deployment")] - Deployment, - #[serde(rename = "enterprise")] - Enterprise, - #[serde(rename = "organization")] - Organization, - #[serde(rename = "project")] - Project, - } + use super::*; + #[doc = "The type of the scope (Organization is only scope currently supported)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ScopeType { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "deployment")] + Deployment, + #[serde(rename = "enterprise")] + Enterprise, + #[serde(rename = "organization")] + Organization, + #[serde(rename = "project")] + Project, + } } #[doc = "The object returned when the audit log is queried. It contains the log and the information needed to query more audit entries."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuditLogQueryResult { - #[doc = "The continuation token to pass to get the next set of results"] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[doc = "The list of audit log entries"] - #[serde( - rename = "decoratedAuditLogEntries", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub decorated_audit_log_entries: Vec<DecoratedAuditLogEntry>, - #[doc = "True when there are more matching results to be fetched, false otherwise."] - #[serde(rename = "hasMore", default, skip_serializing_if = "Option::is_none")] - pub has_more: Option<bool>, + #[doc = "The continuation token to pass to get the next set of results"] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[doc = "The list of audit log entries"] + #[serde( + rename = "decoratedAuditLogEntries", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub decorated_audit_log_entries: Vec<DecoratedAuditLogEntry>, + #[doc = "True when there are more matching results to be fetched, false otherwise."] + #[serde(rename = "hasMore", default, skip_serializing_if = "Option::is_none")] + pub has_more: Option<bool>, } impl AuditLogQueryResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This class represents an audit stream"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuditStream { - #[doc = "Inputs used to communicate with external service. Inputs could be url, a connection string, a token, etc."] - #[serde( - rename = "consumerInputs", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_inputs: Option<serde_json::Value>, - #[doc = "Type of the consumer, i.e. splunk, azureEventHub, etc."] - #[serde( - rename = "consumerType", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_type: Option<String>, - #[doc = "The time when the stream was created"] - #[serde( - rename = "createdTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_time: Option<time::OffsetDateTime>, - #[doc = "Used to identify individual streams"] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Unique stream identifier"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Status of the stream, Enabled, Disabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<audit_stream::Status>, - #[doc = "Reason for the current stream status, i.e. Disabled by the system, Invalid credentials, etc."] - #[serde( - rename = "statusReason", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_reason: Option<String>, - #[doc = "The time when the stream was last updated"] - #[serde( - rename = "updatedTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub updated_time: Option<time::OffsetDateTime>, + #[doc = "Inputs used to communicate with external service. Inputs could be url, a connection string, a token, etc."] + #[serde( + rename = "consumerInputs", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_inputs: Option<serde_json::Value>, + #[doc = "Type of the consumer, i.e. splunk, azureEventHub, etc."] + #[serde( + rename = "consumerType", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_type: Option<String>, + #[doc = "The time when the stream was created"] + #[serde( + rename = "createdTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_time: Option<time::OffsetDateTime>, + #[doc = "Used to identify individual streams"] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Unique stream identifier"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Status of the stream, Enabled, Disabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<audit_stream::Status>, + #[doc = "Reason for the current stream status, i.e. Disabled by the system, Invalid credentials, etc."] + #[serde( + rename = "statusReason", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_reason: Option<String>, + #[doc = "The time when the stream was last updated"] + #[serde( + rename = "updatedTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub updated_time: Option<time::OffsetDateTime>, } impl AuditStream { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod audit_stream { - use super::*; - #[doc = "Status of the stream, Enabled, Disabled"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "enabled")] - Enabled, - #[serde(rename = "disabledByUser")] - DisabledByUser, - #[serde(rename = "disabledBySystem")] - DisabledBySystem, - #[serde(rename = "deleted")] - Deleted, - #[serde(rename = "backfilling")] - Backfilling, - } + use super::*; + #[doc = "Status of the stream, Enabled, Disabled"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "enabled")] + Enabled, + #[serde(rename = "disabledByUser")] + DisabledByUser, + #[serde(rename = "disabledBySystem")] + DisabledBySystem, + #[serde(rename = "deleted")] + Deleted, + #[serde(rename = "backfilling")] + Backfilling, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuditStreamList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<AuditStream>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<AuditStream>, } impl AuditStreamList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DecoratedAuditLogEntry { - #[doc = "The action id for the event, i.e Git.CreateRepo, Project.RenameProject"] - #[serde(rename = "actionId", default, skip_serializing_if = "Option::is_none")] - pub action_id: Option<String>, - #[doc = "ActivityId"] - #[serde( - rename = "activityId", - default, - skip_serializing_if = "Option::is_none" - )] - pub activity_id: Option<String>, - #[doc = "The Actor's Client Id (if actor is a service principal)"] - #[serde( - rename = "actorClientId", - default, - skip_serializing_if = "Option::is_none" - )] - pub actor_client_id: Option<String>, - #[doc = "The Actor's CUID"] - #[serde(rename = "actorCUID", default, skip_serializing_if = "Option::is_none")] - pub actor_cuid: Option<String>, - #[doc = "DisplayName of the user who initiated the action"] - #[serde( - rename = "actorDisplayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub actor_display_name: Option<String>, - #[doc = "URL of Actor's Profile image"] - #[serde( - rename = "actorImageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub actor_image_url: Option<String>, - #[doc = "The Actor's UPN"] - #[serde(rename = "actorUPN", default, skip_serializing_if = "Option::is_none")] - pub actor_upn: Option<String>, - #[doc = "The Actor's User Id (if actor is a user)"] - #[serde( - rename = "actorUserId", - default, - skip_serializing_if = "Option::is_none" - )] - pub actor_user_id: Option<String>, - #[doc = "Area of Azure DevOps the action occurred"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub area: Option<String>, - #[doc = "Type of authentication used by the actor"] - #[serde( - rename = "authenticationMechanism", - default, - skip_serializing_if = "Option::is_none" - )] - pub authentication_mechanism: Option<String>, - #[doc = "Type of action executed"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option<decorated_audit_log_entry::Category>, - #[doc = "DisplayName of the category"] - #[serde( - rename = "categoryDisplayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub category_display_name: Option<String>, - #[doc = "This allows related audit entries to be grouped together. Generally this occurs when a single action causes a cascade of audit entries. For example, project creation."] - #[serde( - rename = "correlationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub correlation_id: Option<String>, - #[doc = "External data such as CUIDs, item names, etc."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "Decorated details"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub details: Option<String>, - #[doc = "EventId - Needs to be unique per service"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "IP Address where the event was originated"] - #[serde(rename = "ipAddress", default, skip_serializing_if = "Option::is_none")] - pub ip_address: Option<String>, - #[doc = "When specified, the id of the project this event is associated to"] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "When specified, the name of the project this event is associated to"] - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[doc = "DisplayName of the scope"] - #[serde( - rename = "scopeDisplayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub scope_display_name: Option<String>, - #[doc = "The organization Id (Organization is the only scope currently supported)"] - #[serde(rename = "scopeId", default, skip_serializing_if = "Option::is_none")] - pub scope_id: Option<String>, - #[doc = "The type of the scope (Organization is only scope currently supported)"] - #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] - pub scope_type: Option<decorated_audit_log_entry::ScopeType>, - #[doc = "The time when the event occurred in UTC"] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub timestamp: Option<time::OffsetDateTime>, - #[doc = "The user agent from the request"] - #[serde(rename = "userAgent", default, skip_serializing_if = "Option::is_none")] - pub user_agent: Option<String>, + #[doc = "The action id for the event, i.e Git.CreateRepo, Project.RenameProject"] + #[serde(rename = "actionId", default, skip_serializing_if = "Option::is_none")] + pub action_id: Option<String>, + #[doc = "ActivityId"] + #[serde( + rename = "activityId", + default, + skip_serializing_if = "Option::is_none" + )] + pub activity_id: Option<String>, + #[doc = "The Actor's CUID"] + #[serde(rename = "actorCUID", default, skip_serializing_if = "Option::is_none")] + pub actor_cuid: Option<String>, + #[doc = "DisplayName of the user who initiated the action"] + #[serde( + rename = "actorDisplayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub actor_display_name: Option<String>, + #[doc = "URL of Actor's Profile image"] + #[serde( + rename = "actorImageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub actor_image_url: Option<String>, + #[doc = "The Actor's UPN"] + #[serde(rename = "actorUPN", default, skip_serializing_if = "Option::is_none")] + pub actor_upn: Option<String>, + #[doc = "The Actor's User Id"] + #[serde( + rename = "actorUserId", + default, + skip_serializing_if = "Option::is_none" + )] + pub actor_user_id: Option<String>, + #[doc = "Area of Azure DevOps the action occurred"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub area: Option<String>, + #[doc = "Type of authentication used by the actor"] + #[serde( + rename = "authenticationMechanism", + default, + skip_serializing_if = "Option::is_none" + )] + pub authentication_mechanism: Option<String>, + #[doc = "Type of action executed"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option<decorated_audit_log_entry::Category>, + #[doc = "DisplayName of the category"] + #[serde( + rename = "categoryDisplayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub category_display_name: Option<String>, + #[doc = "This allows related audit entries to be grouped together. Generally this occurs when a single action causes a cascade of audit entries. For example, project creation."] + #[serde( + rename = "correlationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub correlation_id: Option<String>, + #[doc = "External data such as CUIDs, item names, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "Decorated details"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub details: Option<String>, + #[doc = "EventId - Needs to be unique per service"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "IP Address where the event was originated"] + #[serde(rename = "ipAddress", default, skip_serializing_if = "Option::is_none")] + pub ip_address: Option<String>, + #[doc = "When specified, the id of the project this event is associated to"] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "When specified, the name of the project this event is associated to"] + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[doc = "DisplayName of the scope"] + #[serde( + rename = "scopeDisplayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub scope_display_name: Option<String>, + #[doc = "The organization Id (Organization is the only scope currently supported)"] + #[serde(rename = "scopeId", default, skip_serializing_if = "Option::is_none")] + pub scope_id: Option<String>, + #[doc = "The type of the scope (Organization is only scope currently supported)"] + #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] + pub scope_type: Option<decorated_audit_log_entry::ScopeType>, + #[doc = "The time when the event occurred in UTC"] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub timestamp: Option<time::OffsetDateTime>, + #[doc = "The user agent from the request"] + #[serde(rename = "userAgent", default, skip_serializing_if = "Option::is_none")] + pub user_agent: Option<String>, } impl DecoratedAuditLogEntry { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod decorated_audit_log_entry { - use super::*; - #[doc = "Type of action executed"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Category { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "modify")] - Modify, - #[serde(rename = "remove")] - Remove, - #[serde(rename = "create")] - Create, - #[serde(rename = "access")] - Access, - #[serde(rename = "execute")] - Execute, - } - #[doc = "The type of the scope (Organization is only scope currently supported)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ScopeType { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "deployment")] - Deployment, - #[serde(rename = "enterprise")] - Enterprise, - #[serde(rename = "organization")] - Organization, - #[serde(rename = "project")] - Project, - } + use super::*; + #[doc = "Type of action executed"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Category { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "modify")] + Modify, + #[serde(rename = "remove")] + Remove, + #[serde(rename = "create")] + Create, + #[serde(rename = "access")] + Access, + #[serde(rename = "execute")] + Execute, + } + #[doc = "The type of the scope (Organization is only scope currently supported)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ScopeType { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "deployment")] + Deployment, + #[serde(rename = "enterprise")] + Enterprise, + #[serde(rename = "organization")] + Organization, + #[serde(rename = "project")] + Project, + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/auth.rs b/azure_devops_rust_api/src/auth.rs index 3a42b37d..b37f2091 100644 --- a/azure_devops_rust_api/src/auth.rs +++ b/azure_devops_rust_api/src/auth.rs @@ -17,55 +17,55 @@ use std::sync::Arc; /// - OAuth token credential obtained via the [`azure_identity`](https://crates.io/crates/azure_identity) crate. #[derive(Clone)] pub enum Credential { - Unauthenticated, - Pat(String), - TokenCredential(Arc<dyn TokenCredential>), + Unauthenticated, + Pat(String), + TokenCredential(Arc<dyn TokenCredential>), } impl Credential { - /// Creates a new `Credential` for unauthenticated operations. - pub fn unauthenticated() -> Self { - Credential::Unauthenticated - } + /// Creates a new `Credential` for unauthenticated operations. + pub fn unauthenticated() -> Self { + Credential::Unauthenticated + } - /// Creates a new `Credential` using the supplied PAT token. - pub fn from_pat(pat: impl Into<String>) -> Self { - let pat = pat.into(); - Credential::Pat(pat) - } + /// Creates a new `Credential` using the supplied PAT token. + pub fn from_pat(pat: impl Into<String>) -> Self { + let pat = pat.into(); + Credential::Pat(pat) + } - /// Creates a new `Credential` using the supplied object that implements [`TokenCredential`](https://docs.rs/azure_core/latest/azure_core/auth/trait.TokenCredential.html). - /// - /// Note that the supplied object must be wrapped in an `Arc<...>`. - pub fn from_token_credential<T>(token_credential: Arc<T>) -> Self - where - T: TokenCredential + 'static, - { - let token_credential = token_credential as Arc<dyn TokenCredential>; - Credential::TokenCredential(token_credential) - } + /// Creates a new `Credential` using the supplied object that implements [`TokenCredential`](https://docs.rs/azure_core/latest/azure_core/auth/trait.TokenCredential.html). + /// + /// Note that the supplied object must be wrapped in an `Arc<...>`. + pub fn from_token_credential<T>(token_credential: Arc<T>) -> Self + where + T: TokenCredential + 'static, + { + let token_credential = token_credential as Arc<dyn TokenCredential>; + Credential::TokenCredential(token_credential) + } - /// Returns the HTTP authorization header value containing the credential. - #[allow(dead_code)] - pub(crate) async fn http_authorization_header( - &self, - scopes: &[String], - ) -> Result<Option<String>> { - 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)) - ))), - // OAuth tokens are passed using Bearer authentication. - Credential::TokenCredential(token_credential) => { - let token_response = token_credential - .get_token(&scopes.join(" ")) - .await - .context(azure_core::error::ErrorKind::Other, "get bearer token")?; - Ok(Some(format!("Bearer {}", token_response.token.secret()))) - } - } + /// Returns the HTTP authorization header value containing the credential. + #[allow(dead_code)] + pub(crate) async fn http_authorization_header( + &self, + scopes: &[String], + ) -> Result<Option<String>> { + 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)) + ))), + // OAuth tokens are passed using Bearer authentication. + Credential::TokenCredential(token_credential) => { + let token_response = token_credential + .get_token(&scopes.join(" ")) + .await + .context(azure_core::error::ErrorKind::Other, "get bearer token")?; + Ok(Some(format!("Bearer {}", token_response.token.secret()))) + } } + } } diff --git a/azure_devops_rust_api/src/build/mod.rs b/azure_devops_rust_api/src/build/mod.rs index 77d89472..546ec3d8 100644 --- a/azure_devops_rust_api/src/build/mod.rs +++ b/azure_devops_rust_api/src/build/mod.rs @@ -9,12989 +9,13067 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self - } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self - } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self - } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self - } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) - } + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } } impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) - } + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + 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()) + } } pub mod artifacts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a specific artifact for a build."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + #[doc = "* `artifact_name`: The name of the artifact."] + pub fn get_artifact( + &self, + organization: impl Into<String>, + project: impl Into<String>, + build_id: i32, + artifact_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + #[doc = "* `artifact_name`: The name of the artifact."] + #[doc = "* `file_id`: The primary key for the file."] + #[doc = "* `file_name`: The name that the file will be set to."] + pub fn get_file( + &self, + organization: impl Into<String>, + project: impl Into<String>, + build_id: i32, + artifact_name: impl Into<String>, + file_id: impl Into<String>, + file_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The artifact."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::BuildArtifact>, + project: impl Into<String>, + build_id: i32, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + build_id, + } + } + } + pub mod get_artifact { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets a specific artifact for a build."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - #[doc = "* `artifact_name`: The name of the artifact."] - pub fn get_artifact( - &self, - organization: impl Into<String>, - project: impl Into<String>, - build_id: i32, - artifact_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - #[doc = "* `artifact_name`: The name of the artifact."] - #[doc = "* `file_id`: The primary key for the file."] - #[doc = "* `file_name`: The name that the file will be set to."] - pub fn get_file( - &self, - organization: impl Into<String>, - project: impl Into<String>, - build_id: i32, - artifact_name: impl Into<String>, - file_id: impl Into<String>, - file_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The artifact."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::BuildArtifact>, - project: impl Into<String>, - build_id: i32, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - build_id, - } - } - } - pub mod get_artifact { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildArtifact> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildArtifact = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) artifact_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/artifacts?artifactName={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id, - &this.artifact_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let artifact_name = &this.artifact_name; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactName", artifact_name); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildArtifact>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildArtifact>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_file { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) artifact_name: String, - pub(crate) file_id: String, - pub(crate) file_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/build/builds/{}/artifacts?artifactName={}&fileId={}&fileName={}" , this . client . endpoint () , & this . organization , & this . project , & this . build_id , & this . artifact_name , & this . file_id , & this . file_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildArtifactList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildArtifactList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/artifacts", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildArtifactList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildArtifactList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildArtifact> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildArtifact = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::BuildArtifact, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/artifacts", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildArtifact>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildArtifact>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildArtifact> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildArtifact = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) artifact_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/artifacts?artifactName={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id, + &this.artifact_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let artifact_name = &this.artifact_name; + req + .url_mut() + .query_pairs_mut() + .append_pair("artifactName", artifact_name); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildArtifact>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildArtifact>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_file { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) artifact_name: String, + pub(crate) file_id: String, + pub(crate) file_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/artifacts?artifactName={}&fileId={}&fileName={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id, + &this.artifact_name, + &this.file_id, + &this.file_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildArtifactList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildArtifactList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/artifacts", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildArtifactList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildArtifactList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildArtifact> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildArtifact = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::BuildArtifact, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/artifacts", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildArtifact>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildArtifact>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod leases { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `user_owner_id`: The user id to search for."] + pub fn get_retention_leases_by_user_id( + &self, + organization: impl Into<String>, + project: impl Into<String>, + user_owner_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_retention_leases_by_owner_id( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `leases_to_fetch`: List of JSON-serialized MinimalRetentionLeases separated by '|'"] + pub fn get_retention_leases_by_minimal_retention_leases( + &self, + organization: impl Into<String>, + project: impl Into<String>, + leases_to_fetch: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn add( + &self, + organization: impl Into<String>, + body: Vec<models::NewRetentionLease>, + project: impl Into<String>, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + } + } + #[doc = "Removes specific retention leases."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The new data for the retention lease."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `lease_id`: The ID of the lease to update."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::RetentionLeaseUpdate>, + project: impl Into<String>, + lease_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + lease_id, + } + } + } + pub mod get_retention_leases_by_user_id { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `user_owner_id`: The user id to search for."] - pub fn get_retention_leases_by_user_id( - &self, - organization: impl Into<String>, - project: impl Into<String>, - user_owner_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_retention_leases_by_owner_id( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `leases_to_fetch`: List of JSON-serialized MinimalRetentionLeases separated by '|'"] - pub fn get_retention_leases_by_minimal_retention_leases( - &self, - organization: impl Into<String>, - project: impl Into<String>, - leases_to_fetch: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn add( - &self, - organization: impl Into<String>, - body: Vec<models::NewRetentionLease>, - project: impl Into<String>, - ) -> add::RequestBuilder { - add::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body, - project: project.into(), - } - } - #[doc = "Removes specific retention leases."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The new data for the retention lease."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `lease_id`: The ID of the lease to update."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::RetentionLeaseUpdate>, - project: impl Into<String>, - lease_id: i32, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - lease_id, - } - } - } - pub mod get_retention_leases_by_user_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLeaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) user_owner_id: String, - pub(crate) definition_id: Option<i32>, - pub(crate) run_id: Option<i32>, - } - 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); - self - } - #[doc = "An optional parameter to limit the search to a single pipeline run. Requires definition_id."] - pub fn run_id(mut self, run_id: i32) -> Self { - self.run_id = Some(run_id); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases?userOwnerId={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.user_owner_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RetentionLeaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_retention_leases_by_owner_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLeaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) owner_id: Option<String>, - pub(crate) definition_id: Option<i32>, - pub(crate) run_id: Option<i32>, - } - impl RequestBuilder { - pub fn owner_id(mut self, owner_id: impl Into<String>) -> Self { - self.owner_id = Some(owner_id.into()); - self - } - #[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); - self - } - #[doc = "An optional parameter to limit the search to a single pipeline run. Requires definition_id."] - pub fn run_id(mut self, run_id: i32) -> Self { - self.run_id = Some(run_id); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases?", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RetentionLeaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_retention_leases_by_minimal_retention_leases { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLeaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) leases_to_fetch: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let leases_to_fetch = &this.leases_to_fetch; - req.url_mut() - .query_pairs_mut() - .append_pair("leasesToFetch", leases_to_fetch); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RetentionLeaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLeaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::NewRetentionLease>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RetentionLeaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) ids: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let ids = &this.ids; - req.url_mut().query_pairs_mut().append_pair("ids", ids); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RetentionLease> { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLease = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) lease_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.lease_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RetentionLease>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLease>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RetentionLease> { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLease = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::RetentionLeaseUpdate, - pub(crate) project: String, - pub(crate) lease_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.lease_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RetentionLease>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLease>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::RetentionLeaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) user_owner_id: String, + pub(crate) definition_id: Option<i32>, + pub(crate) run_id: Option<i32>, + } + 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); + self + } + #[doc = "An optional parameter to limit the search to a single pipeline run. Requires definition_id."] + pub fn run_id(mut self, run_id: i32) -> Self { + self.run_id = Some(run_id); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases?userOwnerId={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.user_owner_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RetentionLeaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_retention_leases_by_owner_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::RetentionLeaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) owner_id: Option<String>, + pub(crate) definition_id: Option<i32>, + pub(crate) run_id: Option<i32>, + } + impl RequestBuilder { + pub fn owner_id(mut self, owner_id: impl Into<String>) -> Self { + self.owner_id = Some(owner_id.into()); + self + } + #[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); + self + } + #[doc = "An optional parameter to limit the search to a single pipeline run. Requires definition_id."] + pub fn run_id(mut self, run_id: i32) -> Self { + self.run_id = Some(run_id); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases?", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RetentionLeaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_retention_leases_by_minimal_retention_leases { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::RetentionLeaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) leases_to_fetch: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let leases_to_fetch = &this.leases_to_fetch; + req + .url_mut() + .query_pairs_mut() + .append_pair("leasesToFetch", leases_to_fetch); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RetentionLeaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::RetentionLeaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::NewRetentionLease>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RetentionLeaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) ids: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let ids = &this.ids; + req.url_mut().query_pairs_mut().append_pair("ids", ids); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RetentionLease> { + let bytes = self.0.into_body().collect().await?; + let body: models::RetentionLease = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) lease_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.lease_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RetentionLease>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLease>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RetentionLease> { + let bytes = self.0.into_body().collect().await?; + let body: models::RetentionLease = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::RetentionLeaseUpdate, + pub(crate) project: String, + pub(crate) lease_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.lease_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RetentionLease>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLease>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod controllers { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets controller, optionally filtered by name"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + name: None, + } + } + #[doc = "Gets a controller"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get(&self, organization: impl Into<String>, controller_id: i32) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + controller_id, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets controller, optionally filtered by name"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - name: None, - } - } - #[doc = "Gets a controller"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get( - &self, - organization: impl Into<String>, - controller_id: i32, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - controller_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildControllerList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildControllerList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) name: Option<String>, - } - impl RequestBuilder { - pub fn name(mut self, name: impl Into<String>) -> Self { - self.name = Some(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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/build/controllers", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildControllerList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BuildControllerList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildController> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildController = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) controller_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/build/controllers/{}", - this.client.endpoint(), - &this.organization, - &this.controller_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildController>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildController>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildControllerList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildControllerList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) name: Option<String>, + } + impl RequestBuilder { + pub fn name(mut self, name: impl Into<String>) -> Self { + self.name = Some(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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/build/controllers", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(name) = &this.name { + req.url_mut().query_pairs_mut().append_pair("name", name); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildControllerList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildControllerList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildController> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildController = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) controller_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/build/controllers/{}", + this.client.endpoint(), + &this.organization, + &this.controller_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildController>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildController>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod resource_usage { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets information about build resources in the system."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get(&self, organization: impl Into<String>) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets information about build resources in the system."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get(&self, organization: impl Into<String>) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildResourceUsage> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildResourceUsage = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/build/resourceusage", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildResourceUsage>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildResourceUsage>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildResourceUsage> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildResourceUsage = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/build/resourceusage", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildResourceUsage>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildResourceUsage>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod history { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get(&self, organization: impl Into<String>) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + days_to_lookback: None, + } + } + } + pub mod get { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get(&self, organization: impl Into<String>) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - days_to_lookback: None, - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildRetentionHistory> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildRetentionHistory = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) days_to_lookback: Option<i32>, - } - impl RequestBuilder { - pub fn days_to_lookback(mut self, days_to_lookback: i32) -> Self { - self.days_to_lookback = Some(days_to_lookback); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/build/retention/history", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(days_to_lookback) = &this.days_to_lookback { - req.url_mut() - .query_pairs_mut() - .append_pair("daysToLookback", &days_to_lookback.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildRetentionHistory>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BuildRetentionHistory>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildRetentionHistory> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildRetentionHistory = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) days_to_lookback: Option<i32>, + } + impl RequestBuilder { + pub fn days_to_lookback(mut self, days_to_lookback: i32) -> Self { + self.days_to_lookback = Some(days_to_lookback); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/build/retention/history", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(days_to_lookback) = &this.days_to_lookback { + req + .url_mut() + .query_pairs_mut() + .append_pair("daysToLookback", &days_to_lookback.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildRetentionHistory>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildRetentionHistory>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod badge { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: The project ID or name."] + #[doc = "* `definition_id`: The ID of the definition."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repo_type`: The repository type."] + pub fn get_build_badge_data( + &self, + organization: impl Into<String>, + project: impl Into<String>, + repo_type: impl Into<String>, + ) -> 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 get { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: The project ID or name."] - #[doc = "* `definition_id`: The ID of the definition."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repo_type`: The repository type."] - pub fn get_build_badge_data( - &self, - organization: impl Into<String>, - project: impl Into<String>, - repo_type: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_id: i32, - pub(crate) branch_name: Option<String>, - } - impl RequestBuilder { - #[doc = "The name of the branch."] - pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/public/build/definitions/{}/{}/badge", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(branch_name) = &this.branch_name { - req.url_mut() - .query_pairs_mut() - .append_pair("branchName", branch_name); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_build_badge_data { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) repo_type: String, - pub(crate) repo_id: Option<String>, - pub(crate) branch_name: Option<String>, - } - impl RequestBuilder { - #[doc = "The repository ID."] - pub fn repo_id(mut self, repo_id: impl Into<String>) -> Self { - self.repo_id = Some(repo_id.into()); - self - } - #[doc = "The branch name."] - pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/repos/{}/badge", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repo_type - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_id: i32, + pub(crate) branch_name: Option<String>, + } + impl RequestBuilder { + #[doc = "The name of the branch."] + pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/public/build/definitions/{}/{}/badge", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(branch_name) = &this.branch_name { + req + .url_mut() + .query_pairs_mut() + .append_pair("branchName", branch_name); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_build_badge_data { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) repo_type: String, + pub(crate) repo_id: Option<String>, + pub(crate) branch_name: Option<String>, + } + impl RequestBuilder { + #[doc = "The repository ID."] + pub fn repo_id(mut self, repo_id: impl Into<String>) -> Self { + self.repo_id = Some(repo_id.into()); + self + } + #[doc = "The branch name."] + pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/repos/{}/badge", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repo_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod authorizedresources { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_: None, + id: None, + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn authorize_project_resources( + &self, + organization: impl Into<String>, + body: Vec<models::DefinitionResourceReference>, + project: impl Into<String>, + ) -> authorize_project_resources::RequestBuilder { + authorize_project_resources::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - type_: None, - id: None, - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn authorize_project_resources( - &self, - organization: impl Into<String>, - body: Vec<models::DefinitionResourceReference>, - project: impl Into<String>, - ) -> authorize_project_resources::RequestBuilder { - authorize_project_resources::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body, - project: project.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::DefinitionResourceReferenceList> { - let bytes = self.0.into_body().collect().await?; - let body: models::DefinitionResourceReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) type_: Option<String>, - pub(crate) id: Option<String>, - } - impl RequestBuilder { - pub fn type_(mut self, type_: impl Into<String>) -> Self { - self.type_ = Some(type_.into()); - self - } - pub fn id(mut self, id: impl Into<String>) -> Self { - self.id = Some(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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/authorizedresources", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DefinitionResourceReferenceList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::DefinitionResourceReferenceList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod authorize_project_resources { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::DefinitionResourceReferenceList> { - let bytes = self.0.into_body().collect().await?; - let body: models::DefinitionResourceReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::DefinitionResourceReference>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/authorizedresources", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DefinitionResourceReferenceList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::DefinitionResourceReferenceList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DefinitionResourceReferenceList> { + let bytes = self.0.into_body().collect().await?; + let body: models::DefinitionResourceReferenceList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) type_: Option<String>, + pub(crate) id: Option<String>, + } + impl RequestBuilder { + pub fn type_(mut self, type_: impl Into<String>) -> Self { + self.type_ = Some(type_.into()); + self + } + pub fn id(mut self, id: impl Into<String>) -> Self { + self.id = Some(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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/authorizedresources", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DefinitionResourceReferenceList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::DefinitionResourceReferenceList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod authorize_project_resources { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DefinitionResourceReferenceList> { + let bytes = self.0.into_body().collect().await?; + let body: models::DefinitionResourceReferenceList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::DefinitionResourceReference>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/authorizedresources", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DefinitionResourceReferenceList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::DefinitionResourceReferenceList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod builds { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of builds."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn queue( + &self, + organization: impl Into<String>, + body: impl Into<models::Build>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The builds to update."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_builds( + &self, + organization: impl Into<String>, + body: Vec<models::Build>, + project: impl Into<String>, + ) -> update_builds::RequestBuilder { + update_builds::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + } + } + #[doc = "Gets a build"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The build."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn update_build( + &self, + organization: impl Into<String>, + body: impl Into<models::Build>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_build_changes( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn get_retention_leases_for_build( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn get_build_logs( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + #[doc = "* `log_id`: The ID of the log file."] + pub fn get_build_log( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn get_build_work_items_refs( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A comma-delimited list of commit IDs."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn get_build_work_items_refs_from_commits( + &self, + organization: impl Into<String>, + body: Vec<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_changes_between_builds( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `from_build_id`: The ID of the first build."] + #[doc = "* `to_build_id`: The ID of the last build."] + pub fn get_work_items_between_builds( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets a list of builds."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn queue( - &self, - organization: impl Into<String>, - body: impl Into<models::Build>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The builds to update."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_builds( - &self, - organization: impl Into<String>, - body: Vec<models::Build>, - project: impl Into<String>, - ) -> update_builds::RequestBuilder { - update_builds::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body, - project: project.into(), - } - } - #[doc = "Gets a build"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The build."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn update_build( - &self, - organization: impl Into<String>, - body: impl Into<models::Build>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_build_changes( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn get_retention_leases_for_build( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn get_build_logs( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - #[doc = "* `log_id`: The ID of the log file."] - pub fn get_build_log( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn get_build_work_items_refs( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A comma-delimited list of commit IDs."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn get_build_work_items_refs_from_commits( - &self, - organization: impl Into<String>, - body: Vec<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_changes_between_builds( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `from_build_id`: The ID of the first build."] - #[doc = "* `to_build_id`: The ID of the last build."] - pub fn get_work_items_between_builds( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definitions: Option<String>, - pub(crate) queues: Option<String>, - pub(crate) build_number: Option<String>, - pub(crate) min_time: Option<time::OffsetDateTime>, - pub(crate) max_time: Option<time::OffsetDateTime>, - pub(crate) requested_for: Option<String>, - pub(crate) reason_filter: Option<String>, - pub(crate) status_filter: Option<String>, - pub(crate) result_filter: Option<String>, - pub(crate) tag_filters: Option<String>, - pub(crate) properties: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - pub(crate) max_builds_per_definition: Option<i32>, - pub(crate) deleted_filter: Option<String>, - pub(crate) query_order: Option<String>, - pub(crate) branch_name: Option<String>, - pub(crate) build_ids: Option<String>, - pub(crate) repository_id: Option<String>, - pub(crate) repository_type: Option<String>, - } - 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<String>) -> Self { - self.definitions = Some(definitions.into()); - self - } - #[doc = "A comma-delimited list of queue IDs. If specified, filters to builds that ran against these queues."] - pub fn queues(mut self, queues: impl Into<String>) -> Self { - self.queues = Some(queues.into()); - self - } - #[doc = "If specified, filters to builds that match this build number. Append * to do a prefix search."] - pub fn build_number(mut self, build_number: impl Into<String>) -> Self { - self.build_number = Some(build_number.into()); - self - } - #[doc = "If specified, filters to builds that finished/started/queued after this date based on the queryOrder specified."] - pub fn min_time(mut self, min_time: impl Into<time::OffsetDateTime>) -> Self { - self.min_time = Some(min_time.into()); - self - } - #[doc = "If specified, filters to builds that finished/started/queued before this date based on the queryOrder specified."] - pub fn max_time(mut self, max_time: impl Into<time::OffsetDateTime>) -> Self { - self.max_time = Some(max_time.into()); - self - } - #[doc = "If specified, filters to builds requested for the specified user."] - pub fn requested_for(mut self, requested_for: impl Into<String>) -> Self { - self.requested_for = Some(requested_for.into()); - self - } - #[doc = "If specified, filters to builds that match this reason."] - pub fn reason_filter(mut self, reason_filter: impl Into<String>) -> Self { - self.reason_filter = Some(reason_filter.into()); - self - } - #[doc = "If specified, filters to builds that match this status."] - pub fn status_filter(mut self, status_filter: impl Into<String>) -> Self { - self.status_filter = Some(status_filter.into()); - self - } - #[doc = "If specified, filters to builds that match this result."] - pub fn result_filter(mut self, result_filter: impl Into<String>) -> Self { - self.result_filter = Some(result_filter.into()); - self - } - #[doc = "A comma-delimited list of tags. If specified, filters to builds that have the specified tags."] - pub fn tag_filters(mut self, tag_filters: impl Into<String>) -> Self { - self.tag_filters = Some(tag_filters.into()); - self - } - #[doc = "A comma-delimited list of properties to retrieve."] - pub fn properties(mut self, properties: impl Into<String>) -> Self { - self.properties = Some(properties.into()); - self - } - #[doc = "The maximum number of builds to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "A continuation token, returned by a previous call to this method, that can be used to return the next set of builds."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "The maximum number of builds to return per definition."] - pub fn max_builds_per_definition(mut self, max_builds_per_definition: i32) -> Self { - self.max_builds_per_definition = Some(max_builds_per_definition); - self - } - #[doc = "Indicates whether to exclude, include, or only return deleted builds."] - pub fn deleted_filter(mut self, deleted_filter: impl Into<String>) -> Self { - self.deleted_filter = Some(deleted_filter.into()); - self - } - #[doc = "The order in which builds should be returned."] - pub fn query_order(mut self, query_order: impl Into<String>) -> Self { - self.query_order = Some(query_order.into()); - self - } - #[doc = "If specified, filters to builds that built branches that built this branch."] - pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self { - self.branch_name = Some(branch_name.into()); - self - } - #[doc = "A comma-delimited list that specifies the IDs of builds to retrieve."] - pub fn build_ids(mut self, build_ids: impl Into<String>) -> Self { - self.build_ids = Some(build_ids.into()); - self - } - #[doc = "If specified, filters to builds that built from this repository."] - pub fn repository_id(mut self, repository_id: impl Into<String>) -> Self { - self.repository_id = Some(repository_id.into()); - self - } - #[doc = "If specified, filters to builds that built from repositories of this type."] - pub fn repository_type(mut self, repository_type: impl Into<String>) -> Self { - self.repository_type = Some(repository_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - if let Some(status_filter) = &this.status_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("statusFilter", status_filter); - } - if let Some(result_filter) = &this.result_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("resultFilter", result_filter); - } - 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); - } - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", query_order); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod queue { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Build> { - let bytes = self.0.into_body().collect().await?; - let body: models::Build = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Build, - pub(crate) project: String, - pub(crate) ignore_warnings: Option<bool>, - pub(crate) check_in_ticket: Option<String>, - pub(crate) source_build_id: Option<i32>, - pub(crate) definition_id: Option<i32>, - } - impl RequestBuilder { - pub fn ignore_warnings(mut self, ignore_warnings: bool) -> Self { - self.ignore_warnings = Some(ignore_warnings); - self - } - pub fn check_in_ticket(mut self, check_in_ticket: impl Into<String>) -> Self { - self.check_in_ticket = Some(check_in_ticket.into()); - self - } - pub fn source_build_id(mut self, source_build_id: i32) -> Self { - self.source_build_id = Some(source_build_id); - self - } - #[doc = "Optional definition id to queue a build without a body. Ignored if there's a valid body"] - pub fn definition_id(mut self, definition_id: i32) -> Self { - self.definition_id = Some(definition_id); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Build>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Build>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_builds { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::Build>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Build> { - let bytes = self.0.into_body().collect().await?; - let body: models::Build = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) property_filters: Option<String>, - } - impl RequestBuilder { - pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { - self.property_filters = Some(property_filters.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(property_filters) = &this.property_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("propertyFilters", property_filters); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Build>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Build>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_build { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Build> { - let bytes = self.0.into_body().collect().await?; - let body: models::Build = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Build, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) retry: Option<bool>, - } - impl RequestBuilder { - pub fn retry(mut self, retry: bool) -> Self { - self.retry = Some(retry); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Build>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Build>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_build_changes { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ChangeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ChangeList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) continuation_token: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) include_source_change: Option<bool>, - } - impl RequestBuilder { - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "The maximum number of changes to return"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - pub fn include_source_change(mut self, include_source_change: bool) -> Self { - self.include_source_change = Some(include_source_change); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/changes", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ChangeList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ChangeList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_retention_leases_for_build { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::RetentionLeaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/leases", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RetentionLeaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_build_logs { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildLogList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildLogList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/logs", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildLogList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildLogList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_build_log { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) log_id: i32, - pub(crate) start_line: Option<i64>, - pub(crate) end_line: Option<i64>, - } - impl RequestBuilder { - #[doc = "The start line."] - pub fn start_line(mut self, start_line: i64) -> Self { - self.start_line = Some(start_line); - self - } - #[doc = "The end line."] - pub fn end_line(mut self, end_line: i64) -> Self { - self.end_line = Some(end_line); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/logs/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id, - &this.log_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_build_work_items_refs { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ResourceRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) top: Option<i32>, - } - impl RequestBuilder { - #[doc = "The maximum number of work items to return."] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/workitems", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ResourceRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ResourceRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_build_work_items_refs_from_commits { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ResourceRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<String>, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) top: Option<i32>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/workitems", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ResourceRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ResourceRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_changes_between_builds { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ChangeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ChangeList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) from_build_id: Option<i32>, - pub(crate) to_build_id: Option<i32>, - pub(crate) top: Option<i32>, - } - 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); - self - } - #[doc = "The ID of the last build."] - pub fn to_build_id(mut self, to_build_id: i32) -> Self { - self.to_build_id = Some(to_build_id); - self - } - #[doc = "The maximum number of changes to return."] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/changes", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ChangeList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ChangeList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_work_items_between_builds { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ResourceRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) from_build_id: i32, - pub(crate) to_build_id: i32, - pub(crate) top: Option<i32>, - } - impl RequestBuilder { - #[doc = "The maximum number of work items to return."] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/workitems", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ResourceRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ResourceRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definitions: Option<String>, + pub(crate) queues: Option<String>, + pub(crate) build_number: Option<String>, + pub(crate) min_time: Option<time::OffsetDateTime>, + pub(crate) max_time: Option<time::OffsetDateTime>, + pub(crate) requested_for: Option<String>, + pub(crate) reason_filter: Option<String>, + pub(crate) status_filter: Option<String>, + pub(crate) result_filter: Option<String>, + pub(crate) tag_filters: Option<String>, + pub(crate) properties: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + pub(crate) max_builds_per_definition: Option<i32>, + pub(crate) deleted_filter: Option<String>, + pub(crate) query_order: Option<String>, + pub(crate) branch_name: Option<String>, + pub(crate) build_ids: Option<String>, + pub(crate) repository_id: Option<String>, + pub(crate) repository_type: Option<String>, + } + 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<String>) -> Self { + self.definitions = Some(definitions.into()); + self + } + #[doc = "A comma-delimited list of queue IDs. If specified, filters to builds that ran against these queues."] + pub fn queues(mut self, queues: impl Into<String>) -> Self { + self.queues = Some(queues.into()); + self + } + #[doc = "If specified, filters to builds that match this build number. Append * to do a prefix search."] + pub fn build_number(mut self, build_number: impl Into<String>) -> Self { + self.build_number = Some(build_number.into()); + self + } + #[doc = "If specified, filters to builds that finished/started/queued after this date based on the queryOrder specified."] + pub fn min_time(mut self, min_time: impl Into<time::OffsetDateTime>) -> Self { + self.min_time = Some(min_time.into()); + self + } + #[doc = "If specified, filters to builds that finished/started/queued before this date based on the queryOrder specified."] + pub fn max_time(mut self, max_time: impl Into<time::OffsetDateTime>) -> Self { + self.max_time = Some(max_time.into()); + self + } + #[doc = "If specified, filters to builds requested for the specified user."] + pub fn requested_for(mut self, requested_for: impl Into<String>) -> Self { + self.requested_for = Some(requested_for.into()); + self + } + #[doc = "If specified, filters to builds that match this reason."] + pub fn reason_filter(mut self, reason_filter: impl Into<String>) -> Self { + self.reason_filter = Some(reason_filter.into()); + self + } + #[doc = "If specified, filters to builds that match this status."] + pub fn status_filter(mut self, status_filter: impl Into<String>) -> Self { + self.status_filter = Some(status_filter.into()); + self + } + #[doc = "If specified, filters to builds that match this result."] + pub fn result_filter(mut self, result_filter: impl Into<String>) -> Self { + self.result_filter = Some(result_filter.into()); + self + } + #[doc = "A comma-delimited list of tags. If specified, filters to builds that have the specified tags."] + pub fn tag_filters(mut self, tag_filters: impl Into<String>) -> Self { + self.tag_filters = Some(tag_filters.into()); + self + } + #[doc = "A comma-delimited list of properties to retrieve."] + pub fn properties(mut self, properties: impl Into<String>) -> Self { + self.properties = Some(properties.into()); + self + } + #[doc = "The maximum number of builds to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "A continuation token, returned by a previous call to this method, that can be used to return the next set of builds."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "The maximum number of builds to return per definition."] + pub fn max_builds_per_definition(mut self, max_builds_per_definition: i32) -> Self { + self.max_builds_per_definition = Some(max_builds_per_definition); + self + } + #[doc = "Indicates whether to exclude, include, or only return deleted builds."] + pub fn deleted_filter(mut self, deleted_filter: impl Into<String>) -> Self { + self.deleted_filter = Some(deleted_filter.into()); + self + } + #[doc = "The order in which builds should be returned."] + pub fn query_order(mut self, query_order: impl Into<String>) -> Self { + self.query_order = Some(query_order.into()); + self + } + #[doc = "If specified, filters to builds that built branches that built this branch."] + pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self { + self.branch_name = Some(branch_name.into()); + self + } + #[doc = "A comma-delimited list that specifies the IDs of builds to retrieve."] + pub fn build_ids(mut self, build_ids: impl Into<String>) -> Self { + self.build_ids = Some(build_ids.into()); + self + } + #[doc = "If specified, filters to builds that built from this repository."] + pub fn repository_id(mut self, repository_id: impl Into<String>) -> Self { + self.repository_id = Some(repository_id.into()); + self + } + #[doc = "If specified, filters to builds that built from repositories of this type."] + pub fn repository_type(mut self, repository_type: impl Into<String>) -> Self { + self.repository_type = Some(repository_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + if let Some(status_filter) = &this.status_filter { + req + .url_mut() + .query_pairs_mut() + .append_pair("statusFilter", status_filter); + } + if let Some(result_filter) = &this.result_filter { + req + .url_mut() + .query_pairs_mut() + .append_pair("resultFilter", result_filter); + } + 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); + } + if let Some(query_order) = &this.query_order { + req + .url_mut() + .query_pairs_mut() + .append_pair("queryOrder", query_order); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::BuildList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod queue { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Build> { + let bytes = self.0.into_body().collect().await?; + let body: models::Build = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Build, + pub(crate) project: String, + pub(crate) ignore_warnings: Option<bool>, + pub(crate) check_in_ticket: Option<String>, + pub(crate) source_build_id: Option<i32>, + pub(crate) definition_id: Option<i32>, + } + impl RequestBuilder { + pub fn ignore_warnings(mut self, ignore_warnings: bool) -> Self { + self.ignore_warnings = Some(ignore_warnings); + self + } + pub fn check_in_ticket(mut self, check_in_ticket: impl Into<String>) -> Self { + self.check_in_ticket = Some(check_in_ticket.into()); + self + } + pub fn source_build_id(mut self, source_build_id: i32) -> Self { + self.source_build_id = Some(source_build_id); + self + } + #[doc = "Optional definition id to queue a build without a body. Ignored if there's a valid body"] + pub fn definition_id(mut self, definition_id: i32) -> Self { + self.definition_id = Some(definition_id); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Build>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Build>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_builds { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::Build>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::BuildList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Build> { + let bytes = self.0.into_body().collect().await?; + let body: models::Build = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) property_filters: Option<String>, + } + impl RequestBuilder { + pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { + self.property_filters = Some(property_filters.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(property_filters) = &this.property_filters { + req + .url_mut() + .query_pairs_mut() + .append_pair("propertyFilters", property_filters); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Build>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Build>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_build { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Build> { + let bytes = self.0.into_body().collect().await?; + let body: models::Build = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Build, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) retry: Option<bool>, + } + impl RequestBuilder { + pub fn retry(mut self, retry: bool) -> Self { + self.retry = Some(retry); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Build>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Build>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_build_changes { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ChangeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ChangeList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) continuation_token: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) include_source_change: Option<bool>, + } + impl RequestBuilder { + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "The maximum number of changes to return"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn include_source_change(mut self, include_source_change: bool) -> Self { + self.include_source_change = Some(include_source_change); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/changes", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ChangeList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::ChangeList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_retention_leases_for_build { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::RetentionLeaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/leases", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RetentionLeaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_build_logs { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildLogList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildLogList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/logs", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildLogList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildLogList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_build_log { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) log_id: i32, + pub(crate) start_line: Option<i64>, + pub(crate) end_line: Option<i64>, + } + impl RequestBuilder { + #[doc = "The start line."] + pub fn start_line(mut self, start_line: i64) -> Self { + self.start_line = Some(start_line); + self + } + #[doc = "The end line."] + pub fn end_line(mut self, end_line: i64) -> Self { + self.end_line = Some(end_line); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/logs/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id, + &this.log_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_build_work_items_refs { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ResourceRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ResourceRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) top: Option<i32>, + } + impl RequestBuilder { + #[doc = "The maximum number of work items to return."] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/workitems", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(top) = &this.top { + req + .url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ResourceRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ResourceRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_build_work_items_refs_from_commits { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ResourceRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ResourceRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<String>, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) top: Option<i32>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/workitems", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ResourceRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ResourceRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_changes_between_builds { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ChangeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ChangeList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) from_build_id: Option<i32>, + pub(crate) to_build_id: Option<i32>, + pub(crate) top: Option<i32>, + } + 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); + self + } + #[doc = "The ID of the last build."] + pub fn to_build_id(mut self, to_build_id: i32) -> Self { + self.to_build_id = Some(to_build_id); + self + } + #[doc = "The maximum number of changes to return."] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/changes", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ChangeList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::ChangeList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_work_items_between_builds { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ResourceRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ResourceRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) from_build_id: i32, + pub(crate) to_build_id: i32, + pub(crate) top: Option<i32>, + } + impl RequestBuilder { + #[doc = "The maximum number of work items to return."] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/workitems", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ResourceRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ResourceRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod attachments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a specific attachment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + #[doc = "* `timeline_id`: The ID of the timeline."] + #[doc = "* `record_id`: The ID of the timeline record."] + #[doc = "* `type_`: The type of the attachment."] + #[doc = "* `name`: The name of the attachment."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + build_id: i32, + timeline_id: impl Into<String>, + record_id: impl Into<String>, + type_: impl Into<String>, + name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + #[doc = "* `type_`: The type of attachment."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + build_id: i32, + type_: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + type_: type_.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets a specific attachment."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - #[doc = "* `timeline_id`: The ID of the timeline."] - #[doc = "* `record_id`: The ID of the timeline record."] - #[doc = "* `type_`: The type of the attachment."] - #[doc = "* `name`: The name of the attachment."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - build_id: i32, - timeline_id: impl Into<String>, - record_id: impl Into<String>, - type_: impl Into<String>, - name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - #[doc = "* `type_`: The type of attachment."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - build_id: i32, - type_: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - build_id, - type_: type_.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) timeline_id: String, - pub(crate) record_id: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/{}/{}/attachments/{}/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id, - &this.timeline_id, - &this.record_id, - &this.type_, - &this.name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AttachmentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::AttachmentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/attachments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id, - &this.type_ - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AttachmentList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::AttachmentList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) timeline_id: String, + pub(crate) record_id: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/{}/{}/attachments/{}/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id, + &this.timeline_id, + &this.record_id, + &this.type_, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AttachmentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::AttachmentList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/attachments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id, + &this.type_ + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AttachmentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AttachmentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod properties { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets properties for a build."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn get_build_properties( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A json-patch document describing the properties to update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn update_build_properties( + &self, + organization: impl Into<String>, + body: impl Into<models::JsonPatchDocument>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + pub fn get_definition_properties( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A json-patch document describing the properties to update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + pub fn update_definition_properties( + &self, + organization: impl Into<String>, + body: impl Into<models::JsonPatchDocument>, + project: impl Into<String>, + 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 get_build_properties { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets properties for a build."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn get_build_properties( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A json-patch document describing the properties to update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn update_build_properties( - &self, - organization: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - pub fn get_definition_properties( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A json-patch document describing the properties to update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - pub fn update_definition_properties( - &self, - organization: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - project: impl Into<String>, - 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 get_build_properties { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> { - let bytes = self.0.into_body().collect().await?; - let body: models::PropertiesCollection = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) filter: Option<String>, - } - impl RequestBuilder { - #[doc = "A comma-delimited list of properties. If specified, filters to these specific properties."] - pub fn filter(mut self, filter: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/properties", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(filter) = &this.filter { - req.url_mut() - .query_pairs_mut() - .append_pair("filter", filter); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PropertiesCollection>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PropertiesCollection>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_build_properties { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> { - let bytes = self.0.into_body().collect().await?; - let body: models::PropertiesCollection = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::JsonPatchDocument, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/properties", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PropertiesCollection>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PropertiesCollection>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_definition_properties { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> { - let bytes = self.0.into_body().collect().await?; - let body: models::PropertiesCollection = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_id: i32, - pub(crate) filter: Option<String>, - } - impl RequestBuilder { - #[doc = "A comma-delimited list of properties. If specified, filters to these specific properties."] - pub fn filter(mut self, filter: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/properties", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(filter) = &this.filter { - req.url_mut() - .query_pairs_mut() - .append_pair("filter", filter); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PropertiesCollection>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PropertiesCollection>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_definition_properties { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> { - let bytes = self.0.into_body().collect().await?; - let body: models::PropertiesCollection = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::JsonPatchDocument, - pub(crate) project: String, - pub(crate) definition_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/properties", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PropertiesCollection>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PropertiesCollection>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> { + let bytes = self.0.into_body().collect().await?; + let body: models::PropertiesCollection = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) filter: Option<String>, + } + impl RequestBuilder { + #[doc = "A comma-delimited list of properties. If specified, filters to these specific properties."] + pub fn filter(mut self, filter: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/properties", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(filter) = &this.filter { + req + .url_mut() + .query_pairs_mut() + .append_pair("filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PropertiesCollection>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PropertiesCollection>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_build_properties { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> { + let bytes = self.0.into_body().collect().await?; + let body: models::PropertiesCollection = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::JsonPatchDocument, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/properties", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PropertiesCollection>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PropertiesCollection>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_definition_properties { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> { + let bytes = self.0.into_body().collect().await?; + let body: models::PropertiesCollection = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_id: i32, + pub(crate) filter: Option<String>, + } + impl RequestBuilder { + #[doc = "A comma-delimited list of properties. If specified, filters to these specific properties."] + pub fn filter(mut self, filter: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/properties", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(filter) = &this.filter { + req + .url_mut() + .query_pairs_mut() + .append_pair("filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PropertiesCollection>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PropertiesCollection>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_definition_properties { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> { + let bytes = self.0.into_body().collect().await?; + let body: models::PropertiesCollection = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::JsonPatchDocument, + pub(crate) project: String, + pub(crate) definition_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/properties", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PropertiesCollection>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PropertiesCollection>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod report { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a build report."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + build_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + type_: None, + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets a build report."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - build_id: i32, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - build_id, - type_: None, - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildReportMetadata> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildReportMetadata = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) type_: Option<String>, - } - impl RequestBuilder { - pub fn type_(mut self, type_: impl Into<String>) -> Self { - self.type_ = Some(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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/report", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(type_) = &this.type_ { - req.url_mut().query_pairs_mut().append_pair("type", type_); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildReportMetadata>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BuildReportMetadata>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildReportMetadata> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildReportMetadata = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) type_: Option<String>, + } + impl RequestBuilder { + pub fn type_(mut self, type_: impl Into<String>) -> Self { + self.type_ = Some(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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/report", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(type_) = &this.type_ { + req.url_mut().query_pairs_mut().append_pair("type", type_); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildReportMetadata>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildReportMetadata>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod stages { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Update a build stage"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::UpdateStageParameters>, + build_id: i32, + stage_ref_name: impl Into<String>, + project: impl Into<String>, + ) -> 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 update { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Update a build stage"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::UpdateStageParameters>, - build_id: i32, - stage_ref_name: impl Into<String>, - project: impl Into<String>, - ) -> 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 update { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/stages/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id, - &this.stage_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/stages/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id, + &this.stage_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod tags { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the tags for a build."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn get_build_tags( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The tags to add."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn add_build_tags( + &self, + organization: impl Into<String>, + body: Vec<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The tags to add/remove."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + pub fn update_build_tags( + &self, + organization: impl Into<String>, + body: impl Into<models::UpdateTagParameters>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + #[doc = "* `tag`: The tag to add."] + pub fn add_build_tag( + &self, + organization: impl Into<String>, + project: impl Into<String>, + build_id: i32, + tag: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: The ID of the build."] + #[doc = "* `tag`: The tag to remove."] + pub fn delete_build_tag( + &self, + organization: impl Into<String>, + project: impl Into<String>, + build_id: i32, + tag: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + pub fn get_definition_tags( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The tags to add."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + pub fn add_definition_tags( + &self, + organization: impl Into<String>, + body: Vec<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The tags to add/remove."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + pub fn update_definition_tags( + &self, + organization: impl Into<String>, + body: impl Into<models::UpdateTagParameters>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + #[doc = "* `tag`: The tag to add."] + pub fn add_definition_tag( + &self, + organization: impl Into<String>, + project: impl Into<String>, + definition_id: i32, + tag: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + #[doc = "* `tag`: The tag to remove."] + pub fn delete_definition_tag( + &self, + organization: impl Into<String>, + project: impl Into<String>, + definition_id: i32, + tag: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_tags( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `tag`: The tag to remove."] + pub fn delete_tag( + &self, + organization: impl Into<String>, + project: impl Into<String>, + tag: impl Into<String>, + ) -> delete_tag::RequestBuilder { + delete_tag::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + tag: tag.into(), + } + } + } + pub mod get_build_tags { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the tags for a build."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn get_build_tags( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The tags to add. Request body is composed directly from listed tags."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn add_build_tags( - &self, - organization: impl Into<String>, - body: Vec<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The tags to add/remove."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - pub fn update_build_tags( - &self, - organization: impl Into<String>, - body: impl Into<models::UpdateTagParameters>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - #[doc = "* `tag`: The tag to add."] - pub fn add_build_tag( - &self, - organization: impl Into<String>, - project: impl Into<String>, - build_id: i32, - tag: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: The ID of the build."] - #[doc = "* `tag`: The tag to remove."] - pub fn delete_build_tag( - &self, - organization: impl Into<String>, - project: impl Into<String>, - build_id: i32, - tag: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - pub fn get_definition_tags( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The tags to add."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - pub fn add_definition_tags( - &self, - organization: impl Into<String>, - body: Vec<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The tags to add/remove."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - pub fn update_definition_tags( - &self, - organization: impl Into<String>, - body: impl Into<models::UpdateTagParameters>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - #[doc = "* `tag`: The tag to add."] - pub fn add_definition_tag( - &self, - organization: impl Into<String>, - project: impl Into<String>, - definition_id: i32, - tag: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - #[doc = "* `tag`: The tag to remove."] - pub fn delete_definition_tag( - &self, - organization: impl Into<String>, - project: impl Into<String>, - definition_id: i32, - tag: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_tags( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `tag`: The tag to remove."] - pub fn delete_tag( - &self, - organization: impl Into<String>, - project: impl Into<String>, - tag: impl Into<String>, - ) -> delete_tag::RequestBuilder { - delete_tag::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - tag: tag.into(), - } - } - } - pub mod get_build_tags { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/tags", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add_build_tags { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<String>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/tags", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_build_tags { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::UpdateTagParameters, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/tags", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add_build_tag { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/tags/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id, - &this.tag - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_build_tag { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/tags/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id, - &this.tag - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_definition_tags { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_id: i32, - pub(crate) revision: Option<i32>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/tags", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(revision) = &this.revision { - req.url_mut() - .query_pairs_mut() - .append_pair("revision", &revision.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add_definition_tags { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<String>, - pub(crate) project: String, - pub(crate) definition_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/tags", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_definition_tags { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::UpdateTagParameters, - pub(crate) project: String, - pub(crate) definition_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/tags", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add_definition_tag { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/tags/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id, - &this.tag - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_definition_tag { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/tags/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id, - &this.tag - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_tags { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/tags", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_tag { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/tags/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.tag - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/tags", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add_build_tags { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<String>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/tags", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_build_tags { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UpdateTagParameters, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/tags", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add_build_tag { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/tags/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id, + &this.tag + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_build_tag { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/tags/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id, + &this.tag + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_definition_tags { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_id: i32, + pub(crate) revision: Option<i32>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/tags", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(revision) = &this.revision { + req + .url_mut() + .query_pairs_mut() + .append_pair("revision", &revision.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add_definition_tags { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<String>, + pub(crate) project: String, + pub(crate) definition_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/tags", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_definition_tags { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UpdateTagParameters, + pub(crate) project: String, + pub(crate) definition_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/tags", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add_definition_tag { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/tags/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id, + &this.tag + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_definition_tag { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/tags/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id, + &this.tag + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_tags { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/tags", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_tag { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/tags/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.tag + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod timeline { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets details for a build"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + build_id: i32, + timeline_id: impl Into<String>, + ) -> 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 get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets details for a build"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - build_id: i32, - timeline_id: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Timeline> { - let bytes = self.0.into_body().collect().await?; - let body: models::Timeline = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) timeline_id: String, - pub(crate) change_id: Option<i32>, - pub(crate) plan_id: Option<String>, - } - impl RequestBuilder { - pub fn change_id(mut self, change_id: i32) -> Self { - self.change_id = Some(change_id); - self - } - pub fn plan_id(mut self, plan_id: impl Into<String>) -> Self { - self.plan_id = Some(plan_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/timeline/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id, - &this.timeline_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Timeline>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Timeline>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Timeline> { + let bytes = self.0.into_body().collect().await?; + let body: models::Timeline = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) timeline_id: String, + pub(crate) change_id: Option<i32>, + pub(crate) plan_id: Option<String>, + } + impl RequestBuilder { + pub fn change_id(mut self, change_id: i32) -> Self { + self.change_id = Some(change_id); + self + } + pub fn plan_id(mut self, plan_id: impl Into<String>) -> Self { + self.plan_id = Some(plan_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/timeline/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.build_id, + &this.timeline_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Timeline>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Timeline>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod definitions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of definitions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The definition."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::BuildDefinition>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The new version of the definition. Its \"Revision\" property must match the existing definition for the update to be accepted."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::BuildDefinition>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The identifier of the definition to restore."] + #[doc = "* `deleted`: When false, restores a deleted definition."] + pub fn restore_definition( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + pub fn get_definition_revisions( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets a list of definitions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The definition."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::BuildDefinition>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The new version of the definition. Its \"Revision\" property must match the existing definition for the update to be accepted."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::BuildDefinition>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The identifier of the definition to restore."] - #[doc = "* `deleted`: When false, restores a deleted definition."] - pub fn restore_definition( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - pub fn get_definition_revisions( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::BuildDefinitionReferenceList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinitionReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) name: Option<String>, - pub(crate) repository_id: Option<String>, - pub(crate) repository_type: Option<String>, - pub(crate) query_order: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - pub(crate) min_metrics_time: Option<time::OffsetDateTime>, - pub(crate) definition_ids: Option<String>, - pub(crate) path: Option<String>, - pub(crate) built_after: Option<time::OffsetDateTime>, - pub(crate) not_built_after: Option<time::OffsetDateTime>, - pub(crate) include_all_properties: Option<bool>, - pub(crate) include_latest_builds: Option<bool>, - pub(crate) task_id_filter: Option<String>, - pub(crate) process_type: Option<i32>, - pub(crate) yaml_filename: Option<String>, - } - impl RequestBuilder { - #[doc = "If specified, filters to definitions whose names match this pattern."] - pub fn name(mut self, name: impl Into<String>) -> Self { - self.name = Some(name.into()); - self - } - #[doc = "A repository ID. If specified, filters to definitions that use this repository."] - pub fn repository_id(mut self, repository_id: impl Into<String>) -> Self { - self.repository_id = Some(repository_id.into()); - self - } - #[doc = "If specified, filters to definitions that have a repository of this type."] - pub fn repository_type(mut self, repository_type: impl Into<String>) -> Self { - self.repository_type = Some(repository_type.into()); - self - } - #[doc = "Indicates the order in which definitions should be returned."] - pub fn query_order(mut self, query_order: impl Into<String>) -> Self { - self.query_order = Some(query_order.into()); - self - } - #[doc = "The maximum number of definitions to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "A continuation token, returned by a previous call to this method, that can be used to return the next set of definitions."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "If specified, indicates the date from which metrics should be included."] - pub fn min_metrics_time( - mut self, - min_metrics_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.min_metrics_time = Some(min_metrics_time.into()); - self - } - #[doc = "A comma-delimited list that specifies the IDs of definitions to retrieve."] - pub fn definition_ids(mut self, definition_ids: impl Into<String>) -> Self { - self.definition_ids = Some(definition_ids.into()); - self - } - #[doc = "If specified, filters to definitions under this folder."] - pub fn path(mut self, path: impl Into<String>) -> Self { - self.path = Some(path.into()); - self - } - #[doc = "If specified, filters to definitions that have builds after this date."] - pub fn built_after(mut self, built_after: impl Into<time::OffsetDateTime>) -> Self { - self.built_after = Some(built_after.into()); - self - } - #[doc = "If specified, filters to definitions that do not have builds after this date."] - pub fn not_built_after( - mut self, - not_built_after: impl Into<time::OffsetDateTime>, - ) -> Self { - self.not_built_after = Some(not_built_after.into()); - self - } - #[doc = "Indicates whether the full definitions should be returned. By default, shallow representations of the definitions are returned."] - pub fn include_all_properties(mut self, include_all_properties: bool) -> Self { - self.include_all_properties = Some(include_all_properties); - self - } - #[doc = "Indicates whether to return the latest and latest completed builds for this definition."] - pub fn include_latest_builds(mut self, include_latest_builds: bool) -> Self { - self.include_latest_builds = Some(include_latest_builds); - self - } - #[doc = "If specified, filters to definitions that use the specified task."] - pub fn task_id_filter(mut self, task_id_filter: impl Into<String>) -> Self { - self.task_id_filter = Some(task_id_filter.into()); - self - } - #[doc = "If specified, filters to definitions with the given process type."] - pub fn process_type(mut self, process_type: i32) -> Self { - self.process_type = Some(process_type); - self - } - #[doc = "If specified, filters to YAML definitions that match the given filename. To use this filter includeAllProperties should be set to true"] - pub fn yaml_filename(mut self, yaml_filename: impl Into<String>) -> Self { - self.yaml_filename = Some(yaml_filename.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildDefinitionReferenceList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BuildDefinitionReferenceList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildDefinition> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::BuildDefinition, - pub(crate) project: String, - pub(crate) definition_to_clone_id: Option<i32>, - pub(crate) definition_to_clone_revision: Option<i32>, - } - 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 - } - pub fn definition_to_clone_revision( - mut self, - definition_to_clone_revision: i32, - ) -> Self { - 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()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildDefinition>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildDefinition>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildDefinition> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_id: i32, - pub(crate) revision: Option<i32>, - pub(crate) min_metrics_time: Option<time::OffsetDateTime>, - pub(crate) property_filters: Option<String>, - pub(crate) include_latest_builds: Option<bool>, - } - 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); - self - } - #[doc = "If specified, indicates the date from which metrics should be included."] - pub fn min_metrics_time( - mut self, - min_metrics_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.min_metrics_time = Some(min_metrics_time.into()); - self - } - #[doc = "A comma-delimited list of properties to include in the results."] - pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { - self.property_filters = Some(property_filters.into()); - self - } - pub fn include_latest_builds(mut self, include_latest_builds: bool) -> Self { - self.include_latest_builds = Some(include_latest_builds); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildDefinition>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildDefinition>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildDefinition> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::BuildDefinition, - pub(crate) project: String, - pub(crate) definition_id: i32, - pub(crate) secrets_source_definition_id: Option<i32>, - pub(crate) secrets_source_definition_revision: Option<i32>, - } - impl RequestBuilder { - pub fn secrets_source_definition_id( - mut self, - secrets_source_definition_id: i32, - ) -> Self { - self.secrets_source_definition_id = Some(secrets_source_definition_id); - self - } - pub fn secrets_source_definition_revision( - mut self, - secrets_source_definition_revision: i32, - ) -> Self { - self.secrets_source_definition_revision = Some(secrets_source_definition_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()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildDefinition>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildDefinition>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod restore_definition { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildDefinition> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_id: i32, - pub(crate) deleted: bool, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let deleted = &this.deleted; - req.url_mut() - .query_pairs_mut() - .append_pair("deleted", &deleted.to_string()); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildDefinition>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildDefinition>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_definition_revisions { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::BuildDefinitionRevisionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinitionRevisionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/revisions", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildDefinitionRevisionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BuildDefinitionRevisionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildDefinitionReferenceList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildDefinitionReferenceList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) name: Option<String>, + pub(crate) repository_id: Option<String>, + pub(crate) repository_type: Option<String>, + pub(crate) query_order: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + pub(crate) min_metrics_time: Option<time::OffsetDateTime>, + pub(crate) definition_ids: Option<String>, + pub(crate) path: Option<String>, + pub(crate) built_after: Option<time::OffsetDateTime>, + pub(crate) not_built_after: Option<time::OffsetDateTime>, + pub(crate) include_all_properties: Option<bool>, + pub(crate) include_latest_builds: Option<bool>, + pub(crate) task_id_filter: Option<String>, + pub(crate) process_type: Option<i32>, + pub(crate) yaml_filename: Option<String>, + } + impl RequestBuilder { + #[doc = "If specified, filters to definitions whose names match this pattern."] + pub fn name(mut self, name: impl Into<String>) -> Self { + self.name = Some(name.into()); + self + } + #[doc = "A repository ID. If specified, filters to definitions that use this repository."] + pub fn repository_id(mut self, repository_id: impl Into<String>) -> Self { + self.repository_id = Some(repository_id.into()); + self + } + #[doc = "If specified, filters to definitions that have a repository of this type."] + pub fn repository_type(mut self, repository_type: impl Into<String>) -> Self { + self.repository_type = Some(repository_type.into()); + self + } + #[doc = "Indicates the order in which definitions should be returned."] + pub fn query_order(mut self, query_order: impl Into<String>) -> Self { + self.query_order = Some(query_order.into()); + self + } + #[doc = "The maximum number of definitions to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "A continuation token, returned by a previous call to this method, that can be used to return the next set of definitions."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "If specified, indicates the date from which metrics should be included."] + pub fn min_metrics_time(mut self, min_metrics_time: impl Into<time::OffsetDateTime>) -> Self { + self.min_metrics_time = Some(min_metrics_time.into()); + self + } + #[doc = "A comma-delimited list that specifies the IDs of definitions to retrieve."] + pub fn definition_ids(mut self, definition_ids: impl Into<String>) -> Self { + self.definition_ids = Some(definition_ids.into()); + self + } + #[doc = "If specified, filters to definitions under this folder."] + pub fn path(mut self, path: impl Into<String>) -> Self { + self.path = Some(path.into()); + self + } + #[doc = "If specified, filters to definitions that have builds after this date."] + pub fn built_after(mut self, built_after: impl Into<time::OffsetDateTime>) -> Self { + self.built_after = Some(built_after.into()); + self + } + #[doc = "If specified, filters to definitions that do not have builds after this date."] + pub fn not_built_after(mut self, not_built_after: impl Into<time::OffsetDateTime>) -> Self { + self.not_built_after = Some(not_built_after.into()); + self + } + #[doc = "Indicates whether the full definitions should be returned. By default, shallow representations of the definitions are returned."] + pub fn include_all_properties(mut self, include_all_properties: bool) -> Self { + self.include_all_properties = Some(include_all_properties); + self + } + #[doc = "Indicates whether to return the latest and latest completed builds for this definition."] + pub fn include_latest_builds(mut self, include_latest_builds: bool) -> Self { + self.include_latest_builds = Some(include_latest_builds); + self + } + #[doc = "If specified, filters to definitions that use the specified task."] + pub fn task_id_filter(mut self, task_id_filter: impl Into<String>) -> Self { + self.task_id_filter = Some(task_id_filter.into()); + self + } + #[doc = "If specified, filters to definitions with the given process type."] + pub fn process_type(mut self, process_type: i32) -> Self { + self.process_type = Some(process_type); + self + } + #[doc = "If specified, filters to YAML definitions that match the given filename."] + pub fn yaml_filename(mut self, yaml_filename: impl Into<String>) -> Self { + self.yaml_filename = Some(yaml_filename.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildDefinitionReferenceList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::BuildDefinitionReferenceList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildDefinition> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildDefinition = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::BuildDefinition, + pub(crate) project: String, + pub(crate) definition_to_clone_id: Option<i32>, + pub(crate) definition_to_clone_revision: Option<i32>, + } + 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 + } + pub fn definition_to_clone_revision(mut self, definition_to_clone_revision: i32) -> Self { + 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()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildDefinition>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildDefinition>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildDefinition> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildDefinition = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_id: i32, + pub(crate) revision: Option<i32>, + pub(crate) min_metrics_time: Option<time::OffsetDateTime>, + pub(crate) property_filters: Option<String>, + pub(crate) include_latest_builds: Option<bool>, + } + 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); + self + } + #[doc = "If specified, indicates the date from which metrics should be included."] + pub fn min_metrics_time(mut self, min_metrics_time: impl Into<time::OffsetDateTime>) -> Self { + self.min_metrics_time = Some(min_metrics_time.into()); + self + } + #[doc = "A comma-delimited list of properties to include in the results."] + pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { + self.property_filters = Some(property_filters.into()); + self + } + pub fn include_latest_builds(mut self, include_latest_builds: bool) -> Self { + self.include_latest_builds = Some(include_latest_builds); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildDefinition>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildDefinition>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildDefinition> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildDefinition = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::BuildDefinition, + pub(crate) project: String, + pub(crate) definition_id: i32, + pub(crate) secrets_source_definition_id: Option<i32>, + pub(crate) secrets_source_definition_revision: Option<i32>, + } + impl RequestBuilder { + pub fn secrets_source_definition_id(mut self, secrets_source_definition_id: i32) -> Self { + self.secrets_source_definition_id = Some(secrets_source_definition_id); + self + } + pub fn secrets_source_definition_revision( + mut self, + secrets_source_definition_revision: i32, + ) -> Self { + self.secrets_source_definition_revision = Some(secrets_source_definition_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()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildDefinition>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildDefinition>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod restore_definition { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildDefinition> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildDefinition = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_id: i32, + pub(crate) deleted: bool, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let deleted = &this.deleted; + req + .url_mut() + .query_pairs_mut() + .append_pair("deleted", &deleted.to_string()); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildDefinition>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildDefinition>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_definition_revisions { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildDefinitionRevisionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildDefinitionRevisionList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/revisions", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildDefinitionRevisionList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::BuildDefinitionRevisionList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod metrics { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets build metrics for a definition."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + pub fn get_definition_metrics( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `metric_aggregation_type`: The aggregation type to use (hourly, daily)."] + pub fn get_project_metrics( + &self, + organization: impl Into<String>, + project: impl Into<String>, + metric_aggregation_type: impl Into<String>, + ) -> 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 get_definition_metrics { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets build metrics for a definition."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - pub fn get_definition_metrics( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `metric_aggregation_type`: The aggregation type to use (hourly, daily)."] - pub fn get_project_metrics( - &self, - organization: impl Into<String>, - project: impl Into<String>, - metric_aggregation_type: impl Into<String>, - ) -> 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 get_definition_metrics { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildMetricList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildMetricList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_id: i32, - pub(crate) min_metrics_time: Option<time::OffsetDateTime>, - } - impl RequestBuilder { - #[doc = "The date from which to calculate metrics."] - pub fn min_metrics_time( - mut self, - min_metrics_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.min_metrics_time = Some(min_metrics_time.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/metrics", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildMetricList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildMetricList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_project_metrics { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildMetricList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildMetricList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) metric_aggregation_type: String, - pub(crate) min_metrics_time: Option<time::OffsetDateTime>, - } - impl RequestBuilder { - #[doc = "The date from which to calculate metrics."] - pub fn min_metrics_time( - mut self, - min_metrics_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.min_metrics_time = Some(min_metrics_time.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/metrics/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.metric_aggregation_type - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildMetricList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildMetricList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildMetricList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildMetricList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_id: i32, + pub(crate) min_metrics_time: Option<time::OffsetDateTime>, + } + impl RequestBuilder { + #[doc = "The date from which to calculate metrics."] + pub fn min_metrics_time(mut self, min_metrics_time: impl Into<time::OffsetDateTime>) -> Self { + self.min_metrics_time = Some(min_metrics_time.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/metrics", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildMetricList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildMetricList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_project_metrics { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildMetricList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildMetricList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) metric_aggregation_type: String, + pub(crate) min_metrics_time: Option<time::OffsetDateTime>, + } + impl RequestBuilder { + #[doc = "The date from which to calculate metrics."] + pub fn min_metrics_time(mut self, min_metrics_time: impl Into<time::OffsetDateTime>) -> Self { + self.min_metrics_time = Some(min_metrics_time.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/metrics/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.metric_aggregation_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildMetricList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildMetricList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod resources { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + definition_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn authorize_definition_resources( + &self, + organization: impl Into<String>, + body: Vec<models::DefinitionResourceReference>, + project: impl Into<String>, + 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - definition_id: i32, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - definition_id, - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn authorize_definition_resources( - &self, - organization: impl Into<String>, - body: Vec<models::DefinitionResourceReference>, - project: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::DefinitionResourceReferenceList> { - let bytes = self.0.into_body().collect().await?; - let body: models::DefinitionResourceReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/resources", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DefinitionResourceReferenceList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::DefinitionResourceReferenceList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod authorize_definition_resources { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::DefinitionResourceReferenceList> { - let bytes = self.0.into_body().collect().await?; - let body: models::DefinitionResourceReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::DefinitionResourceReference>, - pub(crate) project: String, - pub(crate) definition_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/resources", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DefinitionResourceReferenceList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::DefinitionResourceReferenceList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DefinitionResourceReferenceList> { + let bytes = self.0.into_body().collect().await?; + let body: models::DefinitionResourceReferenceList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/resources", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DefinitionResourceReferenceList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::DefinitionResourceReferenceList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod authorize_definition_resources { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DefinitionResourceReferenceList> { + let bytes = self.0.into_body().collect().await?; + let body: models::DefinitionResourceReferenceList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::DefinitionResourceReference>, + pub(crate) project: String, + pub(crate) definition_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/resources", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DefinitionResourceReferenceList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::DefinitionResourceReferenceList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod yaml { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Converts a definition to YAML, optionally at a specific revision."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: The ID of the definition."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Converts a definition to YAML, optionally at a specific revision."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: The ID of the definition."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::YamlBuild> { - let bytes = self.0.into_body().collect().await?; - let body: models::YamlBuild = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_id: i32, - pub(crate) revision: Option<i32>, - pub(crate) min_metrics_time: Option<time::OffsetDateTime>, - pub(crate) property_filters: Option<String>, - pub(crate) include_latest_builds: Option<bool>, - } - 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); - self - } - #[doc = "If specified, indicates the date from which metrics should be included."] - pub fn min_metrics_time( - mut self, - min_metrics_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.min_metrics_time = Some(min_metrics_time.into()); - self - } - #[doc = "A comma-delimited list of properties to include in the results."] - pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { - self.property_filters = Some(property_filters.into()); - self - } - pub fn include_latest_builds(mut self, include_latest_builds: bool) -> Self { - self.include_latest_builds = Some(include_latest_builds); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/yaml", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::YamlBuild>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::YamlBuild>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::YamlBuild> { + let bytes = self.0.into_body().collect().await?; + let body: models::YamlBuild = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_id: i32, + pub(crate) revision: Option<i32>, + pub(crate) min_metrics_time: Option<time::OffsetDateTime>, + pub(crate) property_filters: Option<String>, + pub(crate) include_latest_builds: Option<bool>, + } + 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); + self + } + #[doc = "If specified, indicates the date from which metrics should be included."] + pub fn min_metrics_time(mut self, min_metrics_time: impl Into<time::OffsetDateTime>) -> Self { + self.min_metrics_time = Some(min_metrics_time.into()); + self + } + #[doc = "A comma-delimited list of properties to include in the results."] + pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { + self.property_filters = Some(property_filters.into()); + self + } + pub fn include_latest_builds(mut self, include_latest_builds: bool) -> Self { + self.include_latest_builds = Some(include_latest_builds); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/yaml", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::YamlBuild>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::YamlBuild>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod templates { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all definition templates."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Gets a specific build definition template."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `template_id`: The ID of the requested template."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + template_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The new version of the template."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `template_id`: The ID of the template."] + pub fn save_template( + &self, + organization: impl Into<String>, + body: impl Into<models::BuildDefinitionTemplate>, + project: impl Into<String>, + template_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `template_id`: The ID of the template."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + template_id: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + template_id: template_id.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets all definition templates."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - #[doc = "Gets a specific build definition template."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `template_id`: The ID of the requested template."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - template_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The new version of the template."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `template_id`: The ID of the template."] - pub fn save_template( - &self, - organization: impl Into<String>, - body: impl Into<models::BuildDefinitionTemplate>, - project: impl Into<String>, - template_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `template_id`: The ID of the template."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - template_id: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - template_id: template_id.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::BuildDefinitionTemplateList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinitionTemplateList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/templates", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildDefinitionTemplateList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BuildDefinitionTemplateList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildDefinitionTemplate> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinitionTemplate = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) template_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/templates/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.template_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildDefinitionTemplate>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BuildDefinitionTemplate>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod save_template { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildDefinitionTemplate> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildDefinitionTemplate = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::BuildDefinitionTemplate, - pub(crate) project: String, - pub(crate) template_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/templates/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.template_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildDefinitionTemplate>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BuildDefinitionTemplate>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) template_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/templates/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.template_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildDefinitionTemplateList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildDefinitionTemplateList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/templates", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildDefinitionTemplateList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::BuildDefinitionTemplateList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildDefinitionTemplate> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildDefinitionTemplate = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) template_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/templates/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.template_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildDefinitionTemplate>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildDefinitionTemplate>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod save_template { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildDefinitionTemplate> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildDefinitionTemplate = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::BuildDefinitionTemplate, + pub(crate) project: String, + pub(crate) template_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/templates/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.template_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildDefinitionTemplate>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildDefinitionTemplate>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) template_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/templates/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.template_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod folders { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Updates an existing folder at given existing path"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The new version of the folder."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `path`: The full path to the folder."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::Folder>, + project: impl Into<String>, + path: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The folder."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `path`: The full path of the folder."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::Folder>, + project: impl Into<String>, + path: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `path`: The full path to the folder."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + path: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `path`: The path to start with."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + path: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + path: path.into(), + query_order: None, + } + } + } + pub mod update { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Updates an existing folder at given existing path"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The new version of the folder."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `path`: The full path to the folder."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::Folder>, - project: impl Into<String>, - path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The folder."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `path`: The full path of the folder."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::Folder>, - project: impl Into<String>, - path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `path`: The full path to the folder."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `path`: The path to start with."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - path: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - path: path.into(), - query_order: None, - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Folder> { - let bytes = self.0.into_body().collect().await?; - let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Folder, - pub(crate) project: String, - pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/folders", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Folder>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Folder>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Folder> { - let bytes = self.0.into_body().collect().await?; - let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Folder, - pub(crate) project: String, - pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/folders", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Folder>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Folder>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/folders", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let path = &this.path; - req.url_mut().query_pairs_mut().append_pair("path", path); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FolderList> { - let bytes = self.0.into_body().collect().await?; - let body: models::FolderList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) path: String, - pub(crate) query_order: Option<String>, - } - impl RequestBuilder { - #[doc = "The order in which folders should be returned."] - pub fn query_order(mut self, query_order: impl Into<String>) -> Self { - self.query_order = Some(query_order.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/folders/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.path - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", query_order); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FolderList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FolderList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Folder> { + let bytes = self.0.into_body().collect().await?; + let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Folder, + pub(crate) project: String, + pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/folders", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Folder>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Folder>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Folder> { + let bytes = self.0.into_body().collect().await?; + let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Folder, + pub(crate) project: String, + pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/folders", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Folder>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Folder>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/folders", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let path = &this.path; + req.url_mut().query_pairs_mut().append_pair("path", path); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FolderList> { + let bytes = self.0.into_body().collect().await?; + let body: models::FolderList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) path: String, + pub(crate) query_order: Option<String>, + } + impl RequestBuilder { + #[doc = "The order in which folders should be returned."] + pub fn query_order(mut self, query_order: impl Into<String>) -> Self { + self.query_order = Some(query_order.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/folders/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.path + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(query_order) = &this.query_order { + req + .url_mut() + .query_pairs_mut() + .append_pair("queryOrder", query_order); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FolderList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::FolderList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod general_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets pipeline general settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Updates pipeline general settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::PipelineGeneralSettings>, + project: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets pipeline general settings."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - #[doc = "Updates pipeline general settings."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::PipelineGeneralSettings>, - project: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PipelineGeneralSettings> { - let bytes = self.0.into_body().collect().await?; - let body: models::PipelineGeneralSettings = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/generalsettings", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PipelineGeneralSettings>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PipelineGeneralSettings>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PipelineGeneralSettings> { - let bytes = self.0.into_body().collect().await?; - let body: models::PipelineGeneralSettings = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PipelineGeneralSettings, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/generalsettings", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PipelineGeneralSettings>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PipelineGeneralSettings>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PipelineGeneralSettings> { + let bytes = self.0.into_body().collect().await?; + let body: models::PipelineGeneralSettings = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/generalsettings", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PipelineGeneralSettings>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PipelineGeneralSettings>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PipelineGeneralSettings> { + let bytes = self.0.into_body().collect().await?; + let body: models::PipelineGeneralSettings = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PipelineGeneralSettings, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/generalsettings", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PipelineGeneralSettings>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PipelineGeneralSettings>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod latest { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition`: definition name with optional leading folder path, or the definition id"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + definition: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition: definition.into(), + branch_name: None, + } + } + } + pub mod get { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition`: definition name with optional leading folder path, or the definition id"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - definition: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - definition: definition.into(), - branch_name: None, - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Build> { - let bytes = self.0.into_body().collect().await?; - let body: models::Build = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition: String, - pub(crate) branch_name: Option<String>, - } - 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<String>) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/latest/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(branch_name) = &this.branch_name { - req.url_mut() - .query_pairs_mut() - .append_pair("branchName", branch_name); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Build>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Build>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Build> { + let bytes = self.0.into_body().collect().await?; + let body: models::Build = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition: String, + pub(crate) branch_name: Option<String>, + } + 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<String>) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/latest/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(branch_name) = &this.branch_name { + req + .url_mut() + .query_pairs_mut() + .append_pair("branchName", branch_name); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Build>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Build>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod options { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all build definition options supported by the system."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets all build definition options supported by the system."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildOptionDefinitionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildOptionDefinitionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/options", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildOptionDefinitionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BuildOptionDefinitionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildOptionDefinitionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildOptionDefinitionList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/options", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildOptionDefinitionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildOptionDefinitionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod retention { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the project's retention settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Updates the project's retention settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::UpdateProjectRetentionSettingModel>, + project: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the project's retention settings."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - #[doc = "Updates the project's retention settings."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::UpdateProjectRetentionSettingModel>, - project: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProjectRetentionSetting> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProjectRetentionSetting = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProjectRetentionSetting>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProjectRetentionSetting>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProjectRetentionSetting> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProjectRetentionSetting = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::UpdateProjectRetentionSettingModel, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProjectRetentionSetting>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProjectRetentionSetting>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProjectRetentionSetting> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProjectRetentionSetting = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProjectRetentionSetting>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProjectRetentionSetting>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProjectRetentionSetting> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProjectRetentionSetting = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UpdateProjectRetentionSettingModel, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProjectRetentionSetting>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProjectRetentionSetting>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the build settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Updates the build settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The new settings."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::BuildSettings>, + project: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the build settings."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - #[doc = "Updates the build settings."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The new settings."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::BuildSettings>, - project: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildSettings> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildSettings = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/settings", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildSettings>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildSettings>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildSettings> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildSettings = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::BuildSettings, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/settings", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildSettings>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildSettings>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildSettings> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildSettings = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/settings", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildSettings>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildSettings>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildSettings> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildSettings = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::BuildSettings, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/settings", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildSettings>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildSettings>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod status { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "<p>Gets the build status for a definition, optionally scoped to a specific branch, stage, job, and configuration.</p> <p>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.</p>"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition`: Either the definition name with optional leading folder path, or the definition id."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + definition: impl Into<String>, + ) -> 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 get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "<p>Gets the build status for a definition, optionally scoped to a specific branch, stage, job, and configuration.</p> <p>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.</p>"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition`: Either the definition name with optional leading folder path, or the definition id."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - definition: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition: String, - pub(crate) branch_name: Option<String>, - pub(crate) stage_name: Option<String>, - pub(crate) job_name: Option<String>, - pub(crate) configuration: Option<String>, - pub(crate) label: Option<String>, - } - 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<String>) -> Self { - self.branch_name = Some(branch_name.into()); - self - } - #[doc = "Use this stage within the pipeline to render the status."] - pub fn stage_name(mut self, stage_name: impl Into<String>) -> Self { - self.stage_name = Some(stage_name.into()); - self - } - #[doc = "Use this job within a stage of the pipeline to render the status."] - pub fn job_name(mut self, job_name: impl Into<String>) -> Self { - self.job_name = Some(job_name.into()); - self - } - #[doc = "Use this job configuration to render the status"] - pub fn configuration(mut self, configuration: impl Into<String>) -> Self { - self.configuration = Some(configuration.into()); - self - } - #[doc = "Replaces the default text on the left side of the badge."] - pub fn label(mut self, label: impl Into<String>) -> Self { - self.label = Some(label.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/build/status/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition: String, + pub(crate) branch_name: Option<String>, + pub(crate) stage_name: Option<String>, + pub(crate) job_name: Option<String>, + pub(crate) configuration: Option<String>, + pub(crate) label: Option<String>, + } + 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<String>) -> Self { + self.branch_name = Some(branch_name.into()); + self + } + #[doc = "Use this stage within the pipeline to render the status."] + pub fn stage_name(mut self, stage_name: impl Into<String>) -> Self { + self.stage_name = Some(stage_name.into()); + self + } + #[doc = "Use this job within a stage of the pipeline to render the status."] + pub fn job_name(mut self, job_name: impl Into<String>) -> Self { + self.job_name = Some(job_name.into()); + self + } + #[doc = "Use this job configuration to render the status"] + pub fn configuration(mut self, configuration: impl Into<String>) -> Self { + self.configuration = Some(configuration.into()); + self + } + #[doc = "Replaces the default text on the left side of the badge."] + pub fn label(mut self, label: impl Into<String>) -> Self { + self.label = Some(label.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/build/status/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod source_providers { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of source providers and their capabilities."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `provider_name`: The name of the source provider."] + pub fn list_branches( + &self, + organization: impl Into<String>, + project: impl Into<String>, + provider_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `provider_name`: The name of the source provider."] + pub fn get_file_contents( + &self, + organization: impl Into<String>, + project: impl Into<String>, + provider_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `provider_name`: The name of the source provider."] + pub fn get_path_contents( + &self, + organization: impl Into<String>, + project: impl Into<String>, + provider_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `provider_name`: The name of the source provider."] + #[doc = "* `pull_request_id`: Vendor-specific id of the pull request."] + pub fn get_pull_request( + &self, + organization: impl Into<String>, + project: impl Into<String>, + provider_name: impl Into<String>, + pull_request_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `provider_name`: The name of the source provider."] + pub fn list_repositories( + &self, + organization: impl Into<String>, + project: impl Into<String>, + provider_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `provider_name`: The name of the source provider."] + pub fn list_webhooks( + &self, + organization: impl Into<String>, + project: impl Into<String>, + provider_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The types of triggers to restore webhooks for."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `provider_name`: The name of the source provider."] + pub fn restore_webhooks( + &self, + organization: impl Into<String>, + body: Vec<String>, + project: impl Into<String>, + provider_name: impl Into<String>, + ) -> 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, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of source providers and their capabilities."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `provider_name`: The name of the source provider."] - pub fn list_branches( - &self, - organization: impl Into<String>, - project: impl Into<String>, - provider_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `provider_name`: The name of the source provider."] - pub fn get_file_contents( - &self, - organization: impl Into<String>, - project: impl Into<String>, - provider_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `provider_name`: The name of the source provider."] - pub fn get_path_contents( - &self, - organization: impl Into<String>, - project: impl Into<String>, - provider_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `provider_name`: The name of the source provider."] - #[doc = "* `pull_request_id`: Vendor-specific id of the pull request."] - pub fn get_pull_request( - &self, - organization: impl Into<String>, - project: impl Into<String>, - provider_name: impl Into<String>, - pull_request_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `provider_name`: The name of the source provider."] - pub fn list_repositories( - &self, - organization: impl Into<String>, - project: impl Into<String>, - provider_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `provider_name`: The name of the source provider."] - pub fn list_webhooks( - &self, - organization: impl Into<String>, - project: impl Into<String>, - provider_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The types of triggers to restore webhooks for."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `provider_name`: The name of the source provider."] - pub fn restore_webhooks( - &self, - organization: impl Into<String>, - body: Vec<String>, - project: impl Into<String>, - provider_name: impl Into<String>, - ) -> 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, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::SourceProviderAttributesList> { - let bytes = self.0.into_body().collect().await?; - let body: models::SourceProviderAttributesList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/sourceproviders", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SourceProviderAttributesList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::SourceProviderAttributesList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_branches { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) provider_name: String, - pub(crate) service_endpoint_id: Option<String>, - pub(crate) repository: Option<String>, - pub(crate) branch_name: Option<String>, - } - 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<String>) -> Self { - self.service_endpoint_id = Some(service_endpoint_id.into()); - self - } - #[doc = "The vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories."] - pub fn repository(mut self, repository: impl Into<String>) -> Self { - self.repository = Some(repository.into()); - self - } - #[doc = "If supplied, the name of the branch to check for specifically."] - pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/branches", - this.client.endpoint(), - &this.organization, - &this.project, - &this.provider_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_file_contents { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) provider_name: String, - pub(crate) service_endpoint_id: Option<String>, - pub(crate) repository: Option<String>, - pub(crate) commit_or_branch: Option<String>, - pub(crate) path: Option<String>, - } - 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<String>) -> Self { - self.service_endpoint_id = Some(service_endpoint_id.into()); - self - } - #[doc = "If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories."] - pub fn repository(mut self, repository: impl Into<String>) -> Self { - self.repository = Some(repository.into()); - self - } - #[doc = "The identifier of the commit or branch from which a file's contents are retrieved."] - pub fn commit_or_branch(mut self, commit_or_branch: impl Into<String>) -> Self { - self.commit_or_branch = Some(commit_or_branch.into()); - self - } - #[doc = "The path to the file to retrieve, relative to the root of the repository."] - pub fn path(mut self, path: impl Into<String>) -> Self { - self.path = Some(path.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/filecontents", - this.client.endpoint(), - &this.organization, - &this.project, - &this.provider_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_path_contents { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SourceRepositoryItemList> { - let bytes = self.0.into_body().collect().await?; - let body: models::SourceRepositoryItemList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) provider_name: String, - pub(crate) service_endpoint_id: Option<String>, - pub(crate) repository: Option<String>, - pub(crate) commit_or_branch: Option<String>, - pub(crate) path: Option<String>, - } - 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<String>) -> Self { - self.service_endpoint_id = Some(service_endpoint_id.into()); - self - } - #[doc = "If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories."] - pub fn repository(mut self, repository: impl Into<String>) -> Self { - self.repository = Some(repository.into()); - self - } - #[doc = "The identifier of the commit or branch from which a file's contents are retrieved."] - pub fn commit_or_branch(mut self, commit_or_branch: impl Into<String>) -> Self { - self.commit_or_branch = Some(commit_or_branch.into()); - self - } - #[doc = "The path contents to list, relative to the root of the repository."] - pub fn path(mut self, path: impl Into<String>) -> Self { - self.path = Some(path.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/pathcontents", - this.client.endpoint(), - &this.organization, - &this.project, - &this.provider_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SourceRepositoryItemList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::SourceRepositoryItemList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_pull_request { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PullRequest> { - let bytes = self.0.into_body().collect().await?; - let body: models::PullRequest = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) provider_name: String, - pub(crate) pull_request_id: String, - pub(crate) repository_id: Option<String>, - pub(crate) service_endpoint_id: Option<String>, - } - 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<String>) -> Self { - self.repository_id = Some(repository_id.into()); - self - } - #[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<String>) -> Self { - self.service_endpoint_id = Some(service_endpoint_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/pullrequests/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.provider_name, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PullRequest>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PullRequest>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_repositories { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SourceRepositories> { - let bytes = self.0.into_body().collect().await?; - let body: models::SourceRepositories = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) provider_name: String, - pub(crate) service_endpoint_id: Option<String>, - pub(crate) repository: Option<String>, - pub(crate) result_set: Option<String>, - pub(crate) page_results: Option<bool>, - pub(crate) continuation_token: Option<String>, - } - 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<String>) -> Self { - self.service_endpoint_id = Some(service_endpoint_id.into()); - self - } - #[doc = "If specified, the vendor-specific identifier or the name of a single repository to get."] - pub fn repository(mut self, repository: impl Into<String>) -> Self { - self.repository = Some(repository.into()); - self - } - #[doc = "'top' for the repositories most relevant for the endpoint. If not set, all repositories are returned. Ignored if 'repository' is set."] - pub fn result_set(mut self, result_set: impl Into<String>) -> Self { - self.result_set = Some(result_set.into()); - self - } - #[doc = "If set to true, this will limit the set of results and will return a continuation token to continue the query."] - pub fn page_results(mut self, page_results: bool) -> Self { - self.page_results = Some(page_results); - self - } - #[doc = "When paging results, this is a continuation token, returned by a previous call to this method, that can be used to return the next set of repositories."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/repositories", - this.client.endpoint(), - &this.organization, - &this.project, - &this.provider_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SourceRepositories>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::SourceRepositories>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_webhooks { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RepositoryWebhookList> { - let bytes = self.0.into_body().collect().await?; - let body: models::RepositoryWebhookList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) provider_name: String, - pub(crate) service_endpoint_id: Option<String>, - pub(crate) repository: Option<String>, - } - 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<String>) -> Self { - self.service_endpoint_id = Some(service_endpoint_id.into()); - self - } - #[doc = "If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories."] - pub fn repository(mut self, repository: impl Into<String>) -> Self { - self.repository = Some(repository.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/webhooks", - this.client.endpoint(), - &this.organization, - &this.project, - &this.provider_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RepositoryWebhookList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::RepositoryWebhookList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod restore_webhooks { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<String>, - pub(crate) project: String, - pub(crate) provider_name: String, - pub(crate) service_endpoint_id: Option<String>, - pub(crate) repository: Option<String>, - } - 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<String>) -> Self { - self.service_endpoint_id = Some(service_endpoint_id.into()); - self - } - #[doc = "If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories."] - pub fn repository(mut self, repository: impl Into<String>) -> Self { - self.repository = Some(repository.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/webhooks", - this.client.endpoint(), - &this.organization, - &this.project, - &this.provider_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SourceProviderAttributesList> { + let bytes = self.0.into_body().collect().await?; + let body: models::SourceProviderAttributesList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/sourceproviders", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SourceProviderAttributesList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::SourceProviderAttributesList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_branches { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) provider_name: String, + pub(crate) service_endpoint_id: Option<String>, + pub(crate) repository: Option<String>, + pub(crate) branch_name: Option<String>, + } + 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<String>) -> Self { + self.service_endpoint_id = Some(service_endpoint_id.into()); + self + } + #[doc = "The vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories."] + pub fn repository(mut self, repository: impl Into<String>) -> Self { + self.repository = Some(repository.into()); + self + } + #[doc = "If supplied, the name of the branch to check for specifically."] + pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/branches", + this.client.endpoint(), + &this.organization, + &this.project, + &this.provider_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_file_contents { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) provider_name: String, + pub(crate) service_endpoint_id: Option<String>, + pub(crate) repository: Option<String>, + pub(crate) commit_or_branch: Option<String>, + pub(crate) path: Option<String>, + } + 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<String>) -> Self { + self.service_endpoint_id = Some(service_endpoint_id.into()); + self + } + #[doc = "If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories."] + pub fn repository(mut self, repository: impl Into<String>) -> Self { + self.repository = Some(repository.into()); + self + } + #[doc = "The identifier of the commit or branch from which a file's contents are retrieved."] + pub fn commit_or_branch(mut self, commit_or_branch: impl Into<String>) -> Self { + self.commit_or_branch = Some(commit_or_branch.into()); + self + } + #[doc = "The path to the file to retrieve, relative to the root of the repository."] + pub fn path(mut self, path: impl Into<String>) -> Self { + self.path = Some(path.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/filecontents", + this.client.endpoint(), + &this.organization, + &this.project, + &this.provider_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_path_contents { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SourceRepositoryItemList> { + let bytes = self.0.into_body().collect().await?; + let body: models::SourceRepositoryItemList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) provider_name: String, + pub(crate) service_endpoint_id: Option<String>, + pub(crate) repository: Option<String>, + pub(crate) commit_or_branch: Option<String>, + pub(crate) path: Option<String>, + } + 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<String>) -> Self { + self.service_endpoint_id = Some(service_endpoint_id.into()); + self + } + #[doc = "If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories."] + pub fn repository(mut self, repository: impl Into<String>) -> Self { + self.repository = Some(repository.into()); + self + } + #[doc = "The identifier of the commit or branch from which a file's contents are retrieved."] + pub fn commit_or_branch(mut self, commit_or_branch: impl Into<String>) -> Self { + self.commit_or_branch = Some(commit_or_branch.into()); + self + } + #[doc = "The path contents to list, relative to the root of the repository."] + pub fn path(mut self, path: impl Into<String>) -> Self { + self.path = Some(path.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/pathcontents", + this.client.endpoint(), + &this.organization, + &this.project, + &this.provider_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SourceRepositoryItemList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SourceRepositoryItemList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_pull_request { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PullRequest> { + let bytes = self.0.into_body().collect().await?; + let body: models::PullRequest = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) provider_name: String, + pub(crate) pull_request_id: String, + pub(crate) repository_id: Option<String>, + pub(crate) service_endpoint_id: Option<String>, + } + 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<String>) -> Self { + self.repository_id = Some(repository_id.into()); + self + } + #[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<String>) -> Self { + self.service_endpoint_id = Some(service_endpoint_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/pullrequests/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.provider_name, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PullRequest>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PullRequest>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_repositories { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SourceRepositories> { + let bytes = self.0.into_body().collect().await?; + let body: models::SourceRepositories = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) provider_name: String, + pub(crate) service_endpoint_id: Option<String>, + pub(crate) repository: Option<String>, + pub(crate) result_set: Option<String>, + pub(crate) page_results: Option<bool>, + pub(crate) continuation_token: Option<String>, + } + 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<String>) -> Self { + self.service_endpoint_id = Some(service_endpoint_id.into()); + self + } + #[doc = "If specified, the vendor-specific identifier or the name of a single repository to get."] + pub fn repository(mut self, repository: impl Into<String>) -> Self { + self.repository = Some(repository.into()); + self + } + #[doc = "'top' for the repositories most relevant for the endpoint. If not set, all repositories are returned. Ignored if 'repository' is set."] + pub fn result_set(mut self, result_set: impl Into<String>) -> Self { + self.result_set = Some(result_set.into()); + self + } + #[doc = "If set to true, this will limit the set of results and will return a continuation token to continue the query."] + pub fn page_results(mut self, page_results: bool) -> Self { + self.page_results = Some(page_results); + self + } + #[doc = "When paging results, this is a continuation token, returned by a previous call to this method, that can be used to return the next set of repositories."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/repositories", + this.client.endpoint(), + &this.organization, + &this.project, + &this.provider_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SourceRepositories>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SourceRepositories>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_webhooks { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RepositoryWebhookList> { + let bytes = self.0.into_body().collect().await?; + let body: models::RepositoryWebhookList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) provider_name: String, + pub(crate) service_endpoint_id: Option<String>, + pub(crate) repository: Option<String>, + } + 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<String>) -> Self { + self.service_endpoint_id = Some(service_endpoint_id.into()); + self + } + #[doc = "If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories."] + pub fn repository(mut self, repository: impl Into<String>) -> Self { + self.repository = Some(repository.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/webhooks", + this.client.endpoint(), + &this.organization, + &this.project, + &this.provider_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RepositoryWebhookList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RepositoryWebhookList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod restore_webhooks { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<String>, + pub(crate) project: String, + pub(crate) provider_name: String, + pub(crate) service_endpoint_id: Option<String>, + pub(crate) repository: Option<String>, + } + 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<String>) -> Self { + self.service_endpoint_id = Some(service_endpoint_id.into()); + self + } + #[doc = "If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories."] + pub fn repository(mut self, repository: impl Into<String>) -> Self { + self.repository = Some(repository.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/webhooks", + this.client.endpoint(), + &this.organization, + &this.project, + &this.provider_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } diff --git a/azure_devops_rust_api/src/build/models.rs b/azure_devops_rust_api/src/build/models.rs index c0972608..2e3aeb4c 100644 --- a/azure_devops_rust_api/src/build/models.rs +++ b/azure_devops_rust_api/src/build/models.rs @@ -8,6457 +8,6419 @@ use std::str::FromStr; #[doc = "Represents a queue for running builds."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AgentPoolQueue { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "The ID of the queue."] - pub id: i32, - #[doc = "The name of the queue."] - pub name: String, - #[doc = "Represents a reference to an agent pool."] - pub pool: TaskAgentPoolReference, - #[doc = "The full http link to the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "The ID of the queue."] + pub id: i32, + #[doc = "The name of the queue."] + pub name: String, + #[doc = "Represents a reference to an agent pool."] + pub pool: TaskAgentPoolReference, + #[doc = "The full http link to the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl AgentPoolQueue { - pub fn new(id: i32, name: String, pool: TaskAgentPoolReference) -> Self { - Self { - links: None, - id, - name, - pool, - url: None, - } + pub fn new(id: i32, name: String, pool: TaskAgentPoolReference) -> Self { + Self { + links: None, + id, + name, + pool, + url: None, } + } } #[doc = "Represents a reference to an agent queue."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentPoolQueueReference { - #[serde(flatten)] - pub resource_reference: ResourceReference, - #[doc = "The ID of the queue."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, + #[serde(flatten)] + pub resource_reference: ResourceReference, + #[doc = "The ID of the queue."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, } impl AgentPoolQueueReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes how a phase should run against an agent queue."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentPoolQueueTarget { - #[serde(flatten)] - pub phase_target: PhaseTarget, - #[doc = "Specification of the agent defined by the pool provider."] - #[serde( - rename = "agentSpecification", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_specification: Option<AgentSpecification>, - #[doc = "Enables scripts and other processes launched while executing phase to access the OAuth token"] - #[serde( - rename = "allowScriptsAuthAccessOption", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_scripts_auth_access_option: Option<bool>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub demands: Vec<Demand>, - #[doc = "Additional options for running phases against an agent queue."] - #[serde( - rename = "executionOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub execution_options: Option<AgentTargetExecutionOptions>, - #[doc = "Represents a queue for running builds."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub queue: Option<AgentPoolQueue>, + #[serde(flatten)] + pub phase_target: PhaseTarget, + #[doc = "Specification of the agent defined by the pool provider."] + #[serde( + rename = "agentSpecification", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_specification: Option<AgentSpecification>, + #[doc = "Enables scripts and other processes launched while executing phase to access the OAuth token"] + #[serde( + rename = "allowScriptsAuthAccessOption", + default, + skip_serializing_if = "Option::is_none" + )] + pub allow_scripts_auth_access_option: Option<bool>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub demands: Vec<Demand>, + #[doc = "Additional options for running phases against an agent queue."] + #[serde( + rename = "executionOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub execution_options: Option<AgentTargetExecutionOptions>, + #[doc = "Represents a queue for running builds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub queue: Option<AgentPoolQueue>, } impl AgentPoolQueueTarget { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Specification of the agent defined by the pool provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentSpecification { - #[doc = "Agent specification unique identifier."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, + #[doc = "Agent specification unique identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, } impl AgentSpecification { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Additional options for running phases against an agent queue."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentTargetExecutionOptions { - #[doc = "Indicates the type of execution options."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<i32>, + #[doc = "Indicates the type of execution options."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<i32>, } impl AgentTargetExecutionOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedResultsAnalysis { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[serde( - rename = "notReportedResultsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub not_reported_results_by_outcome: Option<serde_json::Value>, - #[doc = ""] - #[serde( - rename = "previousContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub previous_context: Option<TestResultsContext>, - #[serde( - rename = "resultsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_by_outcome: Option<serde_json::Value>, - #[doc = ""] - #[serde( - rename = "resultsDifference", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_difference: Option<AggregatedResultsDifference>, - #[serde( - rename = "runSummaryByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary_by_outcome: Option<serde_json::Value>, - #[serde( - rename = "runSummaryByState", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary_by_state: Option<serde_json::Value>, - #[serde( - rename = "totalTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_tests: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[serde( + rename = "notReportedResultsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub not_reported_results_by_outcome: Option<serde_json::Value>, + #[doc = ""] + #[serde( + rename = "previousContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub previous_context: Option<TestResultsContext>, + #[serde( + rename = "resultsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_by_outcome: Option<serde_json::Value>, + #[doc = ""] + #[serde( + rename = "resultsDifference", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_difference: Option<AggregatedResultsDifference>, + #[serde( + rename = "runSummaryByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary_by_outcome: Option<serde_json::Value>, + #[serde( + rename = "runSummaryByState", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary_by_state: Option<serde_json::Value>, + #[serde( + rename = "totalTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_tests: Option<i32>, } impl AggregatedResultsAnalysis { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedResultsByOutcome { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[serde( - rename = "groupByField", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_field: Option<String>, - #[serde( - rename = "groupByValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_value: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<aggregated_results_by_outcome::Outcome>, - #[serde( - rename = "rerunResultCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub rerun_result_count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[serde( + rename = "groupByField", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_field: Option<String>, + #[serde( + rename = "groupByValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_value: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<aggregated_results_by_outcome::Outcome>, + #[serde( + rename = "rerunResultCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub rerun_result_count: Option<i32>, } impl AggregatedResultsByOutcome { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod aggregated_results_by_outcome { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Outcome { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "none")] - None, - #[serde(rename = "passed")] - Passed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "inconclusive")] - Inconclusive, - #[serde(rename = "timeout")] - Timeout, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "blocked")] - Blocked, - #[serde(rename = "notExecuted")] - NotExecuted, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - #[serde(rename = "notApplicable")] - NotApplicable, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "notImpacted")] - NotImpacted, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Outcome { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "none")] + None, + #[serde(rename = "passed")] + Passed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "inconclusive")] + Inconclusive, + #[serde(rename = "timeout")] + Timeout, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "blocked")] + Blocked, + #[serde(rename = "notExecuted")] + NotExecuted, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + #[serde(rename = "notApplicable")] + NotApplicable, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "notImpacted")] + NotImpacted, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedResultsDifference { - #[serde( - rename = "increaseInDuration", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_duration: Option<String>, - #[serde( - rename = "increaseInFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_failures: Option<i32>, - #[serde( - rename = "increaseInNonImpactedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_non_impacted_tests: Option<i32>, - #[serde( - rename = "increaseInOtherTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_other_tests: Option<i32>, - #[serde( - rename = "increaseInPassedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_passed_tests: Option<i32>, - #[serde( - rename = "increaseInTotalTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_total_tests: Option<i32>, + #[serde( + rename = "increaseInDuration", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_duration: Option<String>, + #[serde( + rename = "increaseInFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_failures: Option<i32>, + #[serde( + rename = "increaseInNonImpactedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_non_impacted_tests: Option<i32>, + #[serde( + rename = "increaseInOtherTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_other_tests: Option<i32>, + #[serde( + rename = "increaseInPassedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_passed_tests: Option<i32>, + #[serde( + rename = "increaseInTotalTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_total_tests: Option<i32>, } impl AggregatedResultsDifference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedRunsByOutcome { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<aggregated_runs_by_outcome::Outcome>, - #[serde(rename = "runsCount", default, skip_serializing_if = "Option::is_none")] - pub runs_count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<aggregated_runs_by_outcome::Outcome>, + #[serde(rename = "runsCount", default, skip_serializing_if = "Option::is_none")] + pub runs_count: Option<i32>, } impl AggregatedRunsByOutcome { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod aggregated_runs_by_outcome { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Outcome { - #[serde(rename = "passed")] - Passed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "notImpacted")] - NotImpacted, - #[serde(rename = "others")] - Others, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Outcome { + #[serde(rename = "passed")] + Passed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "notImpacted")] + NotImpacted, + #[serde(rename = "others")] + Others, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedRunsByState { - #[serde( - rename = "resultsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_by_outcome: Option<serde_json::Value>, - #[serde(rename = "runsCount", default, skip_serializing_if = "Option::is_none")] - pub runs_count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<aggregated_runs_by_state::State>, + #[serde( + rename = "resultsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_by_outcome: Option<serde_json::Value>, + #[serde(rename = "runsCount", default, skip_serializing_if = "Option::is_none")] + pub runs_count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<aggregated_runs_by_state::State>, } impl AggregatedRunsByState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod aggregated_runs_by_state { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "notStarted")] - NotStarted, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "waiting")] - Waiting, - #[serde(rename = "needsInvestigation")] - NeedsInvestigation, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "notStarted")] + NotStarted, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "waiting")] + Waiting, + #[serde(rename = "needsInvestigation")] + NeedsInvestigation, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactResource { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "Type-specific data about the artifact."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<String>, - #[doc = "A link to download the resource."] - #[serde( - rename = "downloadUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub download_url: Option<String>, - #[doc = "Type-specific properties of the artifact."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "The type of the resource: File container, version control folder, UNC path, etc."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "The full http link to the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "Type-specific data about the artifact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<String>, + #[doc = "A link to download the resource."] + #[serde( + rename = "downloadUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub download_url: Option<String>, + #[doc = "Type-specific properties of the artifact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "The type of the resource: File container, version control folder, UNC path, etc."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "The full http link to the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ArtifactResource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AssociatedWorkItem { - #[serde( - rename = "assignedTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_to: Option<String>, - #[doc = "Id of associated the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[doc = "REST Url of the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] - pub web_url: Option<String>, - #[serde( - rename = "workItemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type: Option<String>, + #[serde( + rename = "assignedTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_to: Option<String>, + #[doc = "Id of associated the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[doc = "REST Url of the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] + pub web_url: Option<String>, + #[serde( + rename = "workItemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type: Option<String>, } impl AssociatedWorkItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an attachment to a build."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Attachment { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "The name of the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "The name of the attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl Attachment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AttachmentList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Attachment>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Attachment>, } impl AttachmentList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuthorizationHeader { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl AuthorizationHeader { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data representation of a build."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Build { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "Specification of the agent defined by the pool provider."] - #[serde( - rename = "agentSpecification", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_specification: Option<AgentSpecification>, - #[doc = "Append Commit Message To BuildNumber in UI."] - #[serde( - rename = "appendCommitMessageToRunName", - default, - skip_serializing_if = "Option::is_none" - )] - pub append_commit_message_to_run_name: Option<bool>, - #[doc = "The build number/name of the build."] - #[serde( - rename = "buildNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_number: Option<String>, - #[doc = "The build number revision."] - #[serde( - rename = "buildNumberRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_number_revision: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub controller: Option<BuildController>, - #[doc = "Represents a reference to a definition."] - pub definition: DefinitionReference, - #[doc = "Indicates whether the build has been deleted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deleted: Option<bool>, - #[doc = ""] - #[serde(rename = "deletedBy", default, skip_serializing_if = "Option::is_none")] - pub deleted_by: Option<IdentityRef>, - #[doc = "The date the build was deleted."] - #[serde( - rename = "deletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deleted_date: Option<time::OffsetDateTime>, - #[doc = "The description of how the build was deleted."] - #[serde( - rename = "deletedReason", - default, - skip_serializing_if = "Option::is_none" - )] - pub deleted_reason: Option<String>, - #[doc = "A list of demands that represents the agent capabilities required by this build."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub demands: Vec<Demand>, - #[doc = "The time that the build was completed."] - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = "The ID of the build."] - pub id: i32, - #[doc = ""] - #[serde( - rename = "lastChangedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_changed_by: Option<IdentityRef>, - #[doc = "The date the build was last changed."] - #[serde( - rename = "lastChangedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_changed_date: Option<time::OffsetDateTime>, - #[doc = "Represents a reference to a build log."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub logs: Option<BuildLogReference>, - #[doc = "Represents a reference to an orchestration plan."] - #[serde( - rename = "orchestrationPlan", - default, - skip_serializing_if = "Option::is_none" - )] - pub orchestration_plan: Option<TaskOrchestrationPlanReference>, - #[doc = "The parameters for the build."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<String>, - #[doc = "Orchestration plans associated with the build (build, cleanup)"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub plans: Vec<TaskOrchestrationPlanReference>, - #[doc = "The build's priority."] - pub priority: build::Priority, - #[doc = "Represents a shallow reference to a TeamProject."] - pub project: TeamProjectReference, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "The quality of the xaml build (good, bad, etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub quality: Option<String>, - #[doc = "Represents a queue for running builds."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub queue: Option<AgentPoolQueue>, - #[doc = "Additional options for queueing the build."] - #[serde( - rename = "queueOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub queue_options: Option<build::QueueOptions>, - #[doc = "The current position of the build in the queue."] - #[serde( - rename = "queuePosition", - default, - skip_serializing_if = "Option::is_none" - )] - pub queue_position: Option<i32>, - #[doc = "The time that the build was queued."] - #[serde( - rename = "queueTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub queue_time: Option<time::OffsetDateTime>, - #[doc = "The reason that the build was created."] - pub reason: build::Reason, - #[doc = "Represents a repository used by a build definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<BuildRepository>, - #[doc = ""] - #[serde( - rename = "requestedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_by: Option<IdentityRef>, - #[doc = ""] - #[serde( - rename = "requestedFor", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_for: Option<IdentityRef>, - #[doc = "The build result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<build::Result>, - #[doc = "Indicates whether the build is retained by a release."] - #[serde( - rename = "retainedByRelease", - default, - skip_serializing_if = "Option::is_none" - )] - pub retained_by_release: Option<bool>, - #[doc = "The source branch."] - #[serde( - rename = "sourceBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_branch: Option<String>, - #[doc = "The source version."] - #[serde( - rename = "sourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_version: Option<String>, - #[doc = "The time that the build was started."] - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, - #[doc = "The status of the build."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<build::Status>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[doc = "Parameters to template expression evaluation"] - #[serde( - rename = "templateParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub template_parameters: Option<serde_json::Value>, - #[doc = "Data representation of a build."] - #[serde( - rename = "triggeredByBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub triggered_by_build: Box<Option<Build>>, - #[doc = "Sourceprovider-specific information about what triggered the build"] - #[serde( - rename = "triggerInfo", - default, - skip_serializing_if = "Option::is_none" - )] - pub trigger_info: Option<serde_json::Value>, - #[doc = "The URI of the build."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, - #[doc = "The REST URL of the build."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[serde( - rename = "validationResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub validation_results: Vec<BuildRequestValidationResult>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "Specification of the agent defined by the pool provider."] + #[serde( + rename = "agentSpecification", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_specification: Option<AgentSpecification>, + #[doc = "The build number/name of the build."] + #[serde( + rename = "buildNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_number: Option<String>, + #[doc = "The build number revision."] + #[serde( + rename = "buildNumberRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_number_revision: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub controller: Option<BuildController>, + #[doc = "Represents a reference to a definition."] + pub definition: DefinitionReference, + #[doc = "Indicates whether the build has been deleted."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deleted: Option<bool>, + #[doc = ""] + #[serde(rename = "deletedBy", default, skip_serializing_if = "Option::is_none")] + pub deleted_by: Option<IdentityRef>, + #[doc = "The date the build was deleted."] + #[serde( + rename = "deletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deleted_date: Option<time::OffsetDateTime>, + #[doc = "The description of how the build was deleted."] + #[serde( + rename = "deletedReason", + default, + skip_serializing_if = "Option::is_none" + )] + pub deleted_reason: Option<String>, + #[doc = "A list of demands that represents the agent capabilities required by this build."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub demands: Vec<Demand>, + #[doc = "The time that the build was completed."] + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[doc = "The ID of the build."] + pub id: i32, + #[doc = ""] + #[serde( + rename = "lastChangedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_changed_by: Option<IdentityRef>, + #[doc = "The date the build was last changed."] + #[serde( + rename = "lastChangedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_changed_date: Option<time::OffsetDateTime>, + #[doc = "Represents a reference to a build log."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub logs: Option<BuildLogReference>, + #[doc = "Represents a reference to an orchestration plan."] + #[serde( + rename = "orchestrationPlan", + default, + skip_serializing_if = "Option::is_none" + )] + pub orchestration_plan: Option<TaskOrchestrationPlanReference>, + #[doc = "The parameters for the build."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<String>, + #[doc = "Orchestration plans associated with the build (build, cleanup)"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub plans: Vec<TaskOrchestrationPlanReference>, + #[doc = "The build's priority."] + pub priority: build::Priority, + #[doc = "Represents a shallow reference to a TeamProject."] + pub project: TeamProjectReference, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "The quality of the xaml build (good, bad, etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub quality: Option<String>, + #[doc = "Represents a queue for running builds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub queue: Option<AgentPoolQueue>, + #[doc = "Additional options for queueing the build."] + #[serde( + rename = "queueOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub queue_options: Option<build::QueueOptions>, + #[doc = "The current position of the build in the queue."] + #[serde( + rename = "queuePosition", + default, + skip_serializing_if = "Option::is_none" + )] + pub queue_position: Option<i32>, + #[doc = "The time that the build was queued."] + #[serde( + rename = "queueTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub queue_time: Option<time::OffsetDateTime>, + #[doc = "The reason that the build was created."] + pub reason: build::Reason, + #[doc = "Represents a repository used by a build definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<BuildRepository>, + #[doc = ""] + #[serde( + rename = "requestedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_by: Option<IdentityRef>, + #[doc = ""] + #[serde( + rename = "requestedFor", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_for: Option<IdentityRef>, + #[doc = "The build result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<build::Result>, + #[doc = "Indicates whether the build is retained by a release."] + #[serde( + rename = "retainedByRelease", + default, + skip_serializing_if = "Option::is_none" + )] + pub retained_by_release: Option<bool>, + #[doc = "The source branch."] + #[serde( + rename = "sourceBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_branch: Option<String>, + #[doc = "The source version."] + #[serde( + rename = "sourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_version: Option<String>, + #[doc = "The time that the build was started."] + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, + #[doc = "The status of the build."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<build::Status>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[doc = "Parameters to template expression evaluation"] + #[serde( + rename = "templateParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub template_parameters: Option<serde_json::Value>, + #[doc = "Data representation of a build."] + #[serde( + rename = "triggeredByBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub triggered_by_build: Box<Option<Build>>, + #[doc = "Sourceprovider-specific information about what triggered the build"] + #[serde( + rename = "triggerInfo", + default, + skip_serializing_if = "Option::is_none" + )] + pub trigger_info: Option<serde_json::Value>, + #[doc = "The URI of the build."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, + #[doc = "The REST URL of the build."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[serde( + rename = "validationResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub validation_results: Vec<BuildRequestValidationResult>, } impl Build { - pub fn new( - definition: DefinitionReference, - id: i32, - priority: build::Priority, - project: TeamProjectReference, - reason: build::Reason, - ) -> Self { - Self { - links: None, - agent_specification: None, - append_commit_message_to_run_name: None, - build_number: None, - build_number_revision: None, - controller: None, - definition, - deleted: None, - deleted_by: None, - deleted_date: None, - deleted_reason: None, - demands: Vec::new(), - finish_time: None, - id, - last_changed_by: None, - last_changed_date: None, - logs: None, - orchestration_plan: None, - parameters: None, - plans: Vec::new(), - priority, - project, - properties: None, - quality: None, - queue: None, - queue_options: None, - queue_position: None, - queue_time: None, - reason, - repository: None, - requested_by: None, - requested_for: None, - result: None, - retained_by_release: None, - source_branch: None, - source_version: None, - start_time: None, - status: None, - tags: Vec::new(), - template_parameters: None, - triggered_by_build: Box::new(None), - trigger_info: None, - uri: None, - url: None, - validation_results: Vec::new(), - } - } + pub fn new( + definition: DefinitionReference, + id: i32, + priority: build::Priority, + project: TeamProjectReference, + reason: build::Reason, + ) -> Self { + Self { + links: None, + agent_specification: None, + build_number: None, + build_number_revision: None, + controller: None, + definition, + deleted: None, + deleted_by: None, + deleted_date: None, + deleted_reason: None, + demands: Vec::new(), + finish_time: None, + id, + last_changed_by: None, + last_changed_date: None, + logs: None, + orchestration_plan: None, + parameters: None, + plans: Vec::new(), + priority, + project, + properties: None, + quality: None, + queue: None, + queue_options: None, + queue_position: None, + queue_time: None, + reason, + repository: None, + requested_by: None, + requested_for: None, + result: None, + retained_by_release: None, + source_branch: None, + source_version: None, + start_time: None, + status: None, + tags: Vec::new(), + template_parameters: None, + triggered_by_build: Box::new(None), + trigger_info: None, + uri: None, + url: None, + validation_results: Vec::new(), + } + } } pub mod build { - use super::*; - #[doc = "The build's priority."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Priority { - #[serde(rename = "low")] - Low, - #[serde(rename = "belowNormal")] - BelowNormal, - #[serde(rename = "normal")] - Normal, - #[serde(rename = "aboveNormal")] - AboveNormal, - #[serde(rename = "high")] - High, - } - #[doc = "Additional options for queueing the build."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum QueueOptions { - #[serde(rename = "none")] - None, - #[serde(rename = "doNotRun")] - DoNotRun, - } - #[doc = "The reason that the build was created."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Reason { - #[serde(rename = "none")] - None, - #[serde(rename = "manual")] - Manual, - #[serde(rename = "individualCI")] - IndividualCi, - #[serde(rename = "batchedCI")] - BatchedCi, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "scheduleForced")] - ScheduleForced, - #[serde(rename = "userCreated")] - UserCreated, - #[serde(rename = "validateShelveset")] - ValidateShelveset, - #[serde(rename = "checkInShelveset")] - CheckInShelveset, - #[serde(rename = "pullRequest")] - PullRequest, - #[serde(rename = "buildCompletion")] - BuildCompletion, - #[serde(rename = "resourceTrigger")] - ResourceTrigger, - #[serde(rename = "triggered")] - Triggered, - #[serde(rename = "all")] - All, - } - #[doc = "The build result."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "none")] - None, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "partiallySucceeded")] - PartiallySucceeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - } - #[doc = "The status of the build."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "none")] - None, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "cancelling")] - Cancelling, - #[serde(rename = "postponed")] - Postponed, - #[serde(rename = "notStarted")] - NotStarted, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "The build's priority."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Priority { + #[serde(rename = "low")] + Low, + #[serde(rename = "belowNormal")] + BelowNormal, + #[serde(rename = "normal")] + Normal, + #[serde(rename = "aboveNormal")] + AboveNormal, + #[serde(rename = "high")] + High, + } + #[doc = "Additional options for queueing the build."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum QueueOptions { + #[serde(rename = "none")] + None, + #[serde(rename = "doNotRun")] + DoNotRun, + } + #[doc = "The reason that the build was created."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Reason { + #[serde(rename = "none")] + None, + #[serde(rename = "manual")] + Manual, + #[serde(rename = "individualCI")] + IndividualCi, + #[serde(rename = "batchedCI")] + BatchedCi, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "scheduleForced")] + ScheduleForced, + #[serde(rename = "userCreated")] + UserCreated, + #[serde(rename = "validateShelveset")] + ValidateShelveset, + #[serde(rename = "checkInShelveset")] + CheckInShelveset, + #[serde(rename = "pullRequest")] + PullRequest, + #[serde(rename = "buildCompletion")] + BuildCompletion, + #[serde(rename = "resourceTrigger")] + ResourceTrigger, + #[serde(rename = "triggered")] + Triggered, + #[serde(rename = "all")] + All, + } + #[doc = "The build result."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "none")] + None, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "partiallySucceeded")] + PartiallySucceeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + } + #[doc = "The status of the build."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "none")] + None, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "cancelling")] + Cancelling, + #[serde(rename = "postponed")] + Postponed, + #[serde(rename = "notStarted")] + NotStarted, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildAgent { - #[serde( - rename = "buildDirectory", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_directory: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub controller: Option<XamlBuildControllerReference>, - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde( - rename = "messageQueueUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub message_queue_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "reservedForBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub reserved_for_build: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub server: Option<XamlBuildServerReference>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<build_agent::Status>, - #[serde( - rename = "statusMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_message: Option<String>, - #[serde( - rename = "updatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub updated_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde( + rename = "buildDirectory", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_directory: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub controller: Option<XamlBuildControllerReference>, + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde( + rename = "messageQueueUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub message_queue_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "reservedForBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub reserved_for_build: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub server: Option<XamlBuildServerReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<build_agent::Status>, + #[serde( + rename = "statusMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_message: Option<String>, + #[serde( + rename = "updatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub updated_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl BuildAgent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod build_agent { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "unavailable")] - Unavailable, - #[serde(rename = "available")] - Available, - #[serde(rename = "offline")] - Offline, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "unavailable")] + Unavailable, + #[serde(rename = "available")] + Available, + #[serde(rename = "offline")] + Offline, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildAgentReference { - #[doc = "Id of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the linked resource (definition name, controller name, etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Full http link to the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Id of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the linked resource (definition name, controller name, etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Full http link to the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl BuildAgentReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an artifact produced by a build."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildArtifact { - #[doc = "The artifact ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "The name of the artifact."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option<ArtifactResource>, - #[doc = "The artifact source, which will be the ID of the job that produced this artifact. If an artifact is associated with multiple sources, this points to the first source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<String>, + #[doc = "The artifact ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "The name of the artifact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option<ArtifactResource>, + #[doc = "The artifact source, which will be the ID of the job that produced this artifact. If an artifact is associated with multiple sources, this points to the first source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<String>, } impl BuildArtifact { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildArtifactList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BuildArtifact>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BuildArtifact>, } impl BuildArtifactList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a build badge."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildBadge { - #[doc = "The ID of the build represented by this badge."] - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option<i32>, - #[doc = "A link to the SVG resource."] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, + #[doc = "The ID of the build represented by this badge."] + #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] + pub build_id: Option<i32>, + #[doc = "A link to the SVG resource."] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, } impl BuildBadge { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildCompletedEvent { - #[serde(flatten)] - pub build_updated_event: BuildUpdatedEvent, - #[doc = "Changes associated with a build used for build notifications"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub changes: Vec<Change>, - #[doc = "Represents a pull request object. These are retrieved from Source Providers."] - #[serde( - rename = "pullRequest", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request: Option<PullRequest>, - #[doc = ""] - #[serde( - rename = "testResults", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_results: Option<AggregatedResultsAnalysis>, - #[doc = "Timeline records associated with a build used for build notifications"] - #[serde( - rename = "timelineRecords", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub timeline_records: Vec<TimelineRecord>, - #[doc = "Work items associated with a build used for build notifications"] - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<AssociatedWorkItem>, + #[serde(flatten)] + pub build_updated_event: BuildUpdatedEvent, + #[doc = "Changes associated with a build used for build notifications"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub changes: Vec<Change>, + #[doc = "Represents a pull request object. These are retrieved from Source Providers."] + #[serde( + rename = "pullRequest", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request: Option<PullRequest>, + #[doc = ""] + #[serde( + rename = "testResults", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_results: Option<AggregatedResultsAnalysis>, + #[doc = "Timeline records associated with a build used for build notifications"] + #[serde( + rename = "timelineRecords", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub timeline_records: Vec<TimelineRecord>, + #[doc = "Work items associated with a build used for build notifications"] + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<AssociatedWorkItem>, } impl BuildCompletedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a build completion trigger."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildCompletionTrigger { - #[serde(flatten)] - pub build_trigger: BuildTrigger, - #[serde( - rename = "branchFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub branch_filters: Vec<String>, - #[doc = "Represents a reference to a definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub definition: Option<DefinitionReference>, - #[serde( - rename = "requiresSuccessfulBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub requires_successful_build: Option<bool>, + #[serde(flatten)] + pub build_trigger: BuildTrigger, + #[serde( + rename = "branchFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub branch_filters: Vec<String>, + #[doc = "Represents a reference to a definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option<DefinitionReference>, + #[serde( + rename = "requiresSuccessfulBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub requires_successful_build: Option<bool>, } impl BuildCompletionTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildController { - #[serde(flatten)] - pub xaml_build_controller_reference: XamlBuildControllerReference, - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "The date the controller was created."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "The description of the controller."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Indicates whether the controller is enabled."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[doc = "The status of the controller."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<build_controller::Status>, - #[doc = "The date the controller was last updated."] - #[serde( - rename = "updatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub updated_date: Option<time::OffsetDateTime>, - #[doc = "The controller's URI."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, + #[serde(flatten)] + pub xaml_build_controller_reference: XamlBuildControllerReference, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "The date the controller was created."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "The description of the controller."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Indicates whether the controller is enabled."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[doc = "The status of the controller."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<build_controller::Status>, + #[doc = "The date the controller was last updated."] + #[serde( + rename = "updatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub updated_date: Option<time::OffsetDateTime>, + #[doc = "The controller's URI."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, } impl BuildController { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod build_controller { - use super::*; - #[doc = "The status of the controller."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "unavailable")] - Unavailable, - #[serde(rename = "available")] - Available, - #[serde(rename = "offline")] - Offline, - } + use super::*; + #[doc = "The status of the controller."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "unavailable")] + Unavailable, + #[serde(rename = "available")] + Available, + #[serde(rename = "offline")] + Offline, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildControllerList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BuildController>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BuildController>, } impl BuildControllerList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a build definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BuildDefinition { - #[serde(flatten)] - pub build_definition_reference: BuildDefinitionReference, - #[doc = "Indicates whether badges are enabled for this definition."] - #[serde( - rename = "badgeEnabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub badge_enabled: Option<bool>, - #[doc = "The build number format."] - #[serde( - rename = "buildNumberFormat", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_number_format: Option<String>, - #[doc = "A save-time comment for the definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub demands: Vec<Demand>, - #[doc = "The description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The drop location for the definition."] - #[serde( - rename = "dropLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub drop_location: Option<String>, - #[doc = "The job authorization scope for builds queued against this definition."] - #[serde( - rename = "jobAuthorizationScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_authorization_scope: Option<build_definition::JobAuthorizationScope>, - #[doc = "The job cancel timeout (in minutes) for builds cancelled by user for this definition."] - #[serde( - rename = "jobCancelTimeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_cancel_timeout_in_minutes: Option<i32>, - #[doc = "The job execution timeout (in minutes) for builds queued against this definition."] - #[serde( - rename = "jobTimeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_timeout_in_minutes: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub options: Vec<BuildOption>, - #[doc = "Represents a build process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub process: Option<BuildProcess>, - #[doc = ""] - #[serde( - rename = "processParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub process_parameters: Option<ProcessParameters>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "Represents a repository used by a build definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<BuildRepository>, - #[serde( - rename = "retentionRules", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub retention_rules: Vec<RetentionPolicy>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub triggers: Vec<BuildTrigger>, - #[serde( - rename = "variableGroups", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub variable_groups: Vec<VariableGroup>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[serde(flatten)] + pub build_definition_reference: BuildDefinitionReference, + #[doc = "Indicates whether badges are enabled for this definition."] + #[serde( + rename = "badgeEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub badge_enabled: Option<bool>, + #[doc = "The build number format."] + #[serde( + rename = "buildNumberFormat", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_number_format: Option<String>, + #[doc = "A save-time comment for the definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub demands: Vec<Demand>, + #[doc = "The description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The drop location for the definition."] + #[serde( + rename = "dropLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub drop_location: Option<String>, + #[doc = "The job authorization scope for builds queued against this definition."] + #[serde( + rename = "jobAuthorizationScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_authorization_scope: Option<build_definition::JobAuthorizationScope>, + #[doc = "The job cancel timeout (in minutes) for builds cancelled by user for this definition."] + #[serde( + rename = "jobCancelTimeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_cancel_timeout_in_minutes: Option<i32>, + #[doc = "The job execution timeout (in minutes) for builds queued against this definition."] + #[serde( + rename = "jobTimeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_timeout_in_minutes: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub options: Vec<BuildOption>, + #[doc = "Represents a build process."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub process: Option<BuildProcess>, + #[doc = ""] + #[serde( + rename = "processParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub process_parameters: Option<ProcessParameters>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "Represents a repository used by a build definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<BuildRepository>, + #[serde( + rename = "retentionRules", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub retention_rules: Vec<RetentionPolicy>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub triggers: Vec<BuildTrigger>, + #[serde( + rename = "variableGroups", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub variable_groups: Vec<VariableGroup>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl BuildDefinition { - pub fn new(build_definition_reference: BuildDefinitionReference) -> Self { - Self { - build_definition_reference, - badge_enabled: None, - build_number_format: None, - comment: None, - demands: Vec::new(), - description: None, - drop_location: None, - job_authorization_scope: None, - job_cancel_timeout_in_minutes: None, - job_timeout_in_minutes: None, - options: Vec::new(), - process: None, - process_parameters: None, - properties: None, - repository: None, - retention_rules: Vec::new(), - tags: Vec::new(), - triggers: Vec::new(), - variable_groups: Vec::new(), - variables: None, - } - } + pub fn new(build_definition_reference: BuildDefinitionReference) -> Self { + Self { + build_definition_reference, + badge_enabled: None, + build_number_format: None, + comment: None, + demands: Vec::new(), + description: None, + drop_location: None, + job_authorization_scope: None, + job_cancel_timeout_in_minutes: None, + job_timeout_in_minutes: None, + options: Vec::new(), + process: None, + process_parameters: None, + properties: None, + repository: None, + retention_rules: Vec::new(), + tags: Vec::new(), + triggers: Vec::new(), + variable_groups: Vec::new(), + variables: None, + } + } } pub mod build_definition { - use super::*; - #[doc = "The job authorization scope for builds queued against this definition."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum JobAuthorizationScope { - #[serde(rename = "projectCollection")] - ProjectCollection, - #[serde(rename = "project")] - Project, - } + use super::*; + #[doc = "The job authorization scope for builds queued against this definition."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum JobAuthorizationScope { + #[serde(rename = "projectCollection")] + ProjectCollection, + #[serde(rename = "project")] + Project, + } } #[doc = "For back-compat with extensions that use the old Steps format instead of Process and Phases"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BuildDefinition32 { - #[serde(flatten)] - pub build_definition_reference3_2: BuildDefinitionReference32, - #[doc = "Indicates whether badges are enabled for this definition"] - #[serde( - rename = "badgeEnabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub badge_enabled: Option<bool>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub build: Vec<BuildDefinitionStep>, - #[doc = "The build number format"] - #[serde( - rename = "buildNumberFormat", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_number_format: Option<String>, - #[doc = "The comment entered when saving the definition"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub demands: Vec<Demand>, - #[doc = "The description"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The drop location for the definition"] - #[serde( - rename = "dropLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub drop_location: Option<String>, - #[doc = "The job authorization scope for builds which are queued against this definition"] - #[serde( - rename = "jobAuthorizationScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_authorization_scope: Option<build_definition3_2::JobAuthorizationScope>, - #[doc = "The job cancel timeout in minutes for builds which are cancelled by user for this definition"] - #[serde( - rename = "jobCancelTimeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_cancel_timeout_in_minutes: Option<i32>, - #[doc = "The job execution timeout in minutes for builds which are queued against this definition"] - #[serde( - rename = "jobTimeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_timeout_in_minutes: Option<i32>, - #[doc = "Data representation of a build."] - #[serde( - rename = "latestBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_build: Option<Build>, - #[doc = "Data representation of a build."] - #[serde( - rename = "latestCompletedBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_completed_build: Option<Build>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub options: Vec<BuildOption>, - #[doc = ""] - #[serde( - rename = "processParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub process_parameters: Option<ProcessParameters>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "Represents a repository used by a build definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<BuildRepository>, - #[serde( - rename = "retentionRules", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub retention_rules: Vec<RetentionPolicy>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub triggers: Vec<BuildTrigger>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[serde(flatten)] + pub build_definition_reference3_2: BuildDefinitionReference32, + #[doc = "Indicates whether badges are enabled for this definition"] + #[serde( + rename = "badgeEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub badge_enabled: Option<bool>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub build: Vec<BuildDefinitionStep>, + #[doc = "The build number format"] + #[serde( + rename = "buildNumberFormat", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_number_format: Option<String>, + #[doc = "The comment entered when saving the definition"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub demands: Vec<Demand>, + #[doc = "The description"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The drop location for the definition"] + #[serde( + rename = "dropLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub drop_location: Option<String>, + #[doc = "The job authorization scope for builds which are queued against this definition"] + #[serde( + rename = "jobAuthorizationScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_authorization_scope: Option<build_definition3_2::JobAuthorizationScope>, + #[doc = "The job cancel timeout in minutes for builds which are cancelled by user for this definition"] + #[serde( + rename = "jobCancelTimeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_cancel_timeout_in_minutes: Option<i32>, + #[doc = "The job execution timeout in minutes for builds which are queued against this definition"] + #[serde( + rename = "jobTimeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_timeout_in_minutes: Option<i32>, + #[doc = "Data representation of a build."] + #[serde( + rename = "latestBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_build: Option<Build>, + #[doc = "Data representation of a build."] + #[serde( + rename = "latestCompletedBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_completed_build: Option<Build>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub options: Vec<BuildOption>, + #[doc = ""] + #[serde( + rename = "processParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub process_parameters: Option<ProcessParameters>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "Represents a repository used by a build definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<BuildRepository>, + #[serde( + rename = "retentionRules", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub retention_rules: Vec<RetentionPolicy>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub triggers: Vec<BuildTrigger>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl BuildDefinition32 { - pub fn new(build_definition_reference3_2: BuildDefinitionReference32) -> Self { - Self { - build_definition_reference3_2, - badge_enabled: None, - build: Vec::new(), - build_number_format: None, - comment: None, - demands: Vec::new(), - description: None, - drop_location: None, - job_authorization_scope: None, - job_cancel_timeout_in_minutes: None, - job_timeout_in_minutes: None, - latest_build: None, - latest_completed_build: None, - options: Vec::new(), - process_parameters: None, - properties: None, - repository: None, - retention_rules: Vec::new(), - tags: Vec::new(), - triggers: Vec::new(), - variables: None, - } - } + pub fn new(build_definition_reference3_2: BuildDefinitionReference32) -> Self { + Self { + build_definition_reference3_2, + badge_enabled: None, + build: Vec::new(), + build_number_format: None, + comment: None, + demands: Vec::new(), + description: None, + drop_location: None, + job_authorization_scope: None, + job_cancel_timeout_in_minutes: None, + job_timeout_in_minutes: None, + latest_build: None, + latest_completed_build: None, + options: Vec::new(), + process_parameters: None, + properties: None, + repository: None, + retention_rules: Vec::new(), + tags: Vec::new(), + triggers: Vec::new(), + variables: None, + } + } } pub mod build_definition3_2 { - use super::*; - #[doc = "The job authorization scope for builds which are queued against this definition"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum JobAuthorizationScope { - #[serde(rename = "projectCollection")] - ProjectCollection, - #[serde(rename = "project")] - Project, - } + use super::*; + #[doc = "The job authorization scope for builds which are queued against this definition"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum JobAuthorizationScope { + #[serde(rename = "projectCollection")] + ProjectCollection, + #[serde(rename = "project")] + Project, + } } #[doc = "Represents a reference to a build definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BuildDefinitionReference { - #[serde(flatten)] - pub definition_reference: DefinitionReference, - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = ""] - #[serde( - rename = "authoredBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub authored_by: Option<IdentityRef>, - #[doc = "Represents a reference to a definition."] - #[serde(rename = "draftOf", default, skip_serializing_if = "Option::is_none")] - pub draft_of: Option<DefinitionReference>, - #[doc = "The list of drafts associated with this definition, if this is not a draft definition."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub drafts: Vec<DefinitionReference>, - #[doc = "Data representation of a build."] - #[serde( - rename = "latestBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_build: Option<Build>, - #[doc = "Data representation of a build."] - #[serde( - rename = "latestCompletedBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_completed_build: Option<Build>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub metrics: Vec<BuildMetric>, - #[doc = "The quality of the definition document (draft, etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub quality: Option<build_definition_reference::Quality>, - #[doc = "Represents a queue for running builds."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub queue: Option<AgentPoolQueue>, + #[serde(flatten)] + pub definition_reference: DefinitionReference, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = ""] + #[serde( + rename = "authoredBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub authored_by: Option<IdentityRef>, + #[doc = "Represents a reference to a definition."] + #[serde(rename = "draftOf", default, skip_serializing_if = "Option::is_none")] + pub draft_of: Option<DefinitionReference>, + #[doc = "The list of drafts associated with this definition, if this is not a draft definition."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub drafts: Vec<DefinitionReference>, + #[doc = "Data representation of a build."] + #[serde( + rename = "latestBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_build: Option<Build>, + #[doc = "Data representation of a build."] + #[serde( + rename = "latestCompletedBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_completed_build: Option<Build>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub metrics: Vec<BuildMetric>, + #[doc = "The quality of the definition document (draft, etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub quality: Option<build_definition_reference::Quality>, + #[doc = "Represents a queue for running builds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub queue: Option<AgentPoolQueue>, } impl BuildDefinitionReference { - pub fn new(definition_reference: DefinitionReference) -> Self { - Self { - definition_reference, - links: None, - authored_by: None, - draft_of: None, - drafts: Vec::new(), - latest_build: None, - latest_completed_build: None, - metrics: Vec::new(), - quality: None, - queue: None, - } - } + pub fn new(definition_reference: DefinitionReference) -> Self { + Self { + definition_reference, + links: None, + authored_by: None, + draft_of: None, + drafts: Vec::new(), + latest_build: None, + latest_completed_build: None, + metrics: Vec::new(), + quality: None, + queue: None, + } + } } pub mod build_definition_reference { - use super::*; - #[doc = "The quality of the definition document (draft, etc.)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Quality { - #[serde(rename = "definition")] - Definition, - #[serde(rename = "draft")] - Draft, - } + use super::*; + #[doc = "The quality of the definition document (draft, etc.)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Quality { + #[serde(rename = "definition")] + Definition, + #[serde(rename = "draft")] + Draft, + } } #[doc = "For back-compat with extensions that use the old Steps format instead of Process and Phases"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BuildDefinitionReference32 { - #[serde(flatten)] - pub definition_reference: DefinitionReference, - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = ""] - #[serde( - rename = "authoredBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub authored_by: Option<IdentityRef>, - #[doc = "Represents a reference to a definition."] - #[serde(rename = "draftOf", default, skip_serializing_if = "Option::is_none")] - pub draft_of: Option<DefinitionReference>, - #[doc = "The list of drafts associated with this definition, if this is not a draft definition."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub drafts: Vec<DefinitionReference>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub metrics: Vec<BuildMetric>, - #[doc = "The quality of the definition document (draft, etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub quality: Option<build_definition_reference3_2::Quality>, - #[doc = "Represents a queue for running builds."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub queue: Option<AgentPoolQueue>, + #[serde(flatten)] + pub definition_reference: DefinitionReference, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = ""] + #[serde( + rename = "authoredBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub authored_by: Option<IdentityRef>, + #[doc = "Represents a reference to a definition."] + #[serde(rename = "draftOf", default, skip_serializing_if = "Option::is_none")] + pub draft_of: Option<DefinitionReference>, + #[doc = "The list of drafts associated with this definition, if this is not a draft definition."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub drafts: Vec<DefinitionReference>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub metrics: Vec<BuildMetric>, + #[doc = "The quality of the definition document (draft, etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub quality: Option<build_definition_reference3_2::Quality>, + #[doc = "Represents a queue for running builds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub queue: Option<AgentPoolQueue>, } impl BuildDefinitionReference32 { - pub fn new(definition_reference: DefinitionReference) -> Self { - Self { - definition_reference, - links: None, - authored_by: None, - draft_of: None, - drafts: Vec::new(), - metrics: Vec::new(), - quality: None, - queue: None, - } - } + pub fn new(definition_reference: DefinitionReference) -> Self { + Self { + definition_reference, + links: None, + authored_by: None, + draft_of: None, + drafts: Vec::new(), + metrics: Vec::new(), + quality: None, + queue: None, + } + } } pub mod build_definition_reference3_2 { - use super::*; - #[doc = "The quality of the definition document (draft, etc.)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Quality { - #[serde(rename = "definition")] - Definition, - #[serde(rename = "draft")] - Draft, - } + use super::*; + #[doc = "The quality of the definition document (draft, etc.)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Quality { + #[serde(rename = "definition")] + Definition, + #[serde(rename = "draft")] + Draft, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildDefinitionReferenceList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BuildDefinitionReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BuildDefinitionReference>, } impl BuildDefinitionReferenceList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a revision of a build definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildDefinitionRevision { - #[doc = ""] - #[serde(rename = "changedBy", default, skip_serializing_if = "Option::is_none")] - pub changed_by: Option<IdentityRef>, - #[doc = "The date and time that the definition was changed."] - #[serde( - rename = "changedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub changed_date: Option<time::OffsetDateTime>, - #[doc = "The change type (add, edit, delete)."] - #[serde( - rename = "changeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_type: Option<build_definition_revision::ChangeType>, - #[doc = "The comment associated with the change."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "A link to the definition at this revision."] - #[serde( - rename = "definitionUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_url: Option<String>, - #[doc = "The name of the definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The revision number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[doc = ""] + #[serde(rename = "changedBy", default, skip_serializing_if = "Option::is_none")] + pub changed_by: Option<IdentityRef>, + #[doc = "The date and time that the definition was changed."] + #[serde( + rename = "changedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub changed_date: Option<time::OffsetDateTime>, + #[doc = "The change type (add, edit, delete)."] + #[serde( + rename = "changeType", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_type: Option<build_definition_revision::ChangeType>, + #[doc = "The comment associated with the change."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "A link to the definition at this revision."] + #[serde( + rename = "definitionUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_url: Option<String>, + #[doc = "The name of the definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The revision number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl BuildDefinitionRevision { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod build_definition_revision { - use super::*; - #[doc = "The change type (add, edit, delete)."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ChangeType { - #[serde(rename = "add")] - Add, - #[serde(rename = "update")] - Update, - #[serde(rename = "delete")] - Delete, - } + use super::*; + #[doc = "The change type (add, edit, delete)."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ChangeType { + #[serde(rename = "add")] + Add, + #[serde(rename = "update")] + Update, + #[serde(rename = "delete")] + Delete, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildDefinitionRevisionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BuildDefinitionRevision>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BuildDefinitionRevision>, } impl BuildDefinitionRevisionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildDefinitionSourceProvider { - #[doc = "Uri of the associated definition"] - #[serde( - rename = "definitionUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_uri: Option<String>, - #[doc = "fields associated with this build definition"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fields: Option<serde_json::Value>, - #[doc = "Id of this source provider"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "The lst time this source provider was modified"] - #[serde( - rename = "lastModified", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified: Option<time::OffsetDateTime>, - #[doc = "Name of the source provider"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Which trigger types are supported by this definition source provider"] - #[serde( - rename = "supportedTriggerTypes", - default, - skip_serializing_if = "Option::is_none" - )] - pub supported_trigger_types: Option<build_definition_source_provider::SupportedTriggerTypes>, + #[doc = "Uri of the associated definition"] + #[serde( + rename = "definitionUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_uri: Option<String>, + #[doc = "fields associated with this build definition"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fields: Option<serde_json::Value>, + #[doc = "Id of this source provider"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "The lst time this source provider was modified"] + #[serde( + rename = "lastModified", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified: Option<time::OffsetDateTime>, + #[doc = "Name of the source provider"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Which trigger types are supported by this definition source provider"] + #[serde( + rename = "supportedTriggerTypes", + default, + skip_serializing_if = "Option::is_none" + )] + pub supported_trigger_types: Option<build_definition_source_provider::SupportedTriggerTypes>, } impl BuildDefinitionSourceProvider { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod build_definition_source_provider { - use super::*; - #[doc = "Which trigger types are supported by this definition source provider"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SupportedTriggerTypes { - #[serde(rename = "none")] - None, - #[serde(rename = "continuousIntegration")] - ContinuousIntegration, - #[serde(rename = "batchedContinuousIntegration")] - BatchedContinuousIntegration, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "gatedCheckIn")] - GatedCheckIn, - #[serde(rename = "batchedGatedCheckIn")] - BatchedGatedCheckIn, - #[serde(rename = "pullRequest")] - PullRequest, - #[serde(rename = "buildCompletion")] - BuildCompletion, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "Which trigger types are supported by this definition source provider"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SupportedTriggerTypes { + #[serde(rename = "none")] + None, + #[serde(rename = "continuousIntegration")] + ContinuousIntegration, + #[serde(rename = "batchedContinuousIntegration")] + BatchedContinuousIntegration, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "gatedCheckIn")] + GatedCheckIn, + #[serde(rename = "batchedGatedCheckIn")] + BatchedGatedCheckIn, + #[serde(rename = "pullRequest")] + PullRequest, + #[serde(rename = "buildCompletion")] + BuildCompletion, + #[serde(rename = "all")] + All, + } } #[doc = "Represents a step in a build phase."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildDefinitionStep { - #[doc = "Indicates whether this step should run even if a previous step fails."] - #[serde(rename = "alwaysRun", default, skip_serializing_if = "Option::is_none")] - pub always_run: Option<bool>, - #[doc = "A condition that determines whether this step should run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub condition: Option<String>, - #[doc = "Indicates whether the phase should continue even if this step fails."] - #[serde( - rename = "continueOnError", - default, - skip_serializing_if = "Option::is_none" - )] - pub continue_on_error: Option<bool>, - #[doc = "The display name for this step."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Indicates whether the step is enabled."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option<serde_json::Value>, - #[doc = "The reference name for this step."] - #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] - pub ref_name: Option<String>, - #[doc = "Number of retries."] - #[serde( - rename = "retryCountOnTaskFailure", - default, - skip_serializing_if = "Option::is_none" - )] - pub retry_count_on_task_failure: Option<i32>, - #[doc = "A reference to a task definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub task: Option<TaskDefinitionReference>, - #[doc = "The time, in minutes, that this step is allowed to run."] - #[serde( - rename = "timeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeout_in_minutes: Option<i32>, + #[doc = "Indicates whether this step should run even if a previous step fails."] + #[serde(rename = "alwaysRun", default, skip_serializing_if = "Option::is_none")] + pub always_run: Option<bool>, + #[doc = "A condition that determines whether this step should run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub condition: Option<String>, + #[doc = "Indicates whether the phase should continue even if this step fails."] + #[serde( + rename = "continueOnError", + default, + skip_serializing_if = "Option::is_none" + )] + pub continue_on_error: Option<bool>, + #[doc = "The display name for this step."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Indicates whether the step is enabled."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inputs: Option<serde_json::Value>, + #[doc = "The reference name for this step."] + #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] + pub ref_name: Option<String>, + #[doc = "Number of retries."] + #[serde( + rename = "retryCountOnTaskFailure", + default, + skip_serializing_if = "Option::is_none" + )] + pub retry_count_on_task_failure: Option<i32>, + #[doc = "A reference to a task definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub task: Option<TaskDefinitionReference>, + #[doc = "The time, in minutes, that this step is allowed to run."] + #[serde( + rename = "timeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeout_in_minutes: Option<i32>, } impl BuildDefinitionStep { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a template from which new build definitions can be created."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildDefinitionTemplate { - #[doc = "Indicates whether the template can be deleted."] - #[serde(rename = "canDelete", default, skip_serializing_if = "Option::is_none")] - pub can_delete: Option<bool>, - #[doc = "The template category."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option<String>, - #[doc = "An optional hosted agent queue for the template to use by default."] - #[serde( - rename = "defaultHostedQueue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_hosted_queue: Option<String>, - #[doc = "A description of the template."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub icons: Option<serde_json::Value>, - #[doc = "The ID of the task whose icon is used when showing this template in the UI."] - #[serde( - rename = "iconTaskId", - default, - skip_serializing_if = "Option::is_none" - )] - pub icon_task_id: Option<String>, - #[doc = "The ID of the template."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The name of the template."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Represents a build definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub template: Option<BuildDefinition>, + #[doc = "Indicates whether the template can be deleted."] + #[serde(rename = "canDelete", default, skip_serializing_if = "Option::is_none")] + pub can_delete: Option<bool>, + #[doc = "The template category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option<String>, + #[doc = "An optional hosted agent queue for the template to use by default."] + #[serde( + rename = "defaultHostedQueue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_hosted_queue: Option<String>, + #[doc = "A description of the template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icons: Option<serde_json::Value>, + #[doc = "The ID of the task whose icon is used when showing this template in the UI."] + #[serde( + rename = "iconTaskId", + default, + skip_serializing_if = "Option::is_none" + )] + pub icon_task_id: Option<String>, + #[doc = "The ID of the template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The name of the template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Represents a build definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub template: Option<BuildDefinition>, } impl BuildDefinitionTemplate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "For back-compat with extensions that use the old Steps format instead of Process and Phases"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildDefinitionTemplate32 { - #[serde(rename = "canDelete", default, skip_serializing_if = "Option::is_none")] - pub can_delete: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option<String>, - #[serde( - rename = "defaultHostedQueue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_hosted_queue: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub icons: Option<serde_json::Value>, - #[serde( - rename = "iconTaskId", - default, - skip_serializing_if = "Option::is_none" - )] - pub icon_task_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "For back-compat with extensions that use the old Steps format instead of Process and Phases"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub template: Option<BuildDefinition32>, + #[serde(rename = "canDelete", default, skip_serializing_if = "Option::is_none")] + pub can_delete: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option<String>, + #[serde( + rename = "defaultHostedQueue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_hosted_queue: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icons: Option<serde_json::Value>, + #[serde( + rename = "iconTaskId", + default, + skip_serializing_if = "Option::is_none" + )] + pub icon_task_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "For back-compat with extensions that use the old Steps format instead of Process and Phases"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub template: Option<BuildDefinition32>, } impl BuildDefinitionTemplate32 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildDefinitionTemplateList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BuildDefinitionTemplate>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BuildDefinitionTemplate>, } impl BuildDefinitionTemplateList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a variable used by a build definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildDefinitionVariable { - #[doc = "Indicates whether the value can be set at queue time."] - #[serde( - rename = "allowOverride", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_override: Option<bool>, - #[doc = "Indicates whether the variable's value is a secret."] - #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] - pub is_secret: Option<bool>, - #[doc = "The value of the variable."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Indicates whether the value can be set at queue time."] + #[serde( + rename = "allowOverride", + default, + skip_serializing_if = "Option::is_none" + )] + pub allow_override: Option<bool>, + #[doc = "Indicates whether the variable's value is a secret."] + #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] + pub is_secret: Option<bool>, + #[doc = "The value of the variable."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl BuildDefinitionVariable { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildDeletedEvent { - #[serde(flatten)] - pub realtime_build_event: RealtimeBuildEvent, - #[doc = "Data representation of a build."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<Build>, + #[serde(flatten)] + pub realtime_build_event: RealtimeBuildEvent, + #[doc = "Data representation of a build."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<Build>, } impl BuildDeletedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildDeployment { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deployment: Option<BuildSummary>, - #[doc = ""] - #[serde( - rename = "sourceBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_build: Option<XamlBuildReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deployment: Option<BuildSummary>, + #[doc = ""] + #[serde( + rename = "sourceBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_build: Option<XamlBuildReference>, } impl BuildDeployment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildEvent { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub data: Vec<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub data: Vec<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, } impl BuildEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Build>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Build>, } impl BuildList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a build log."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BuildLog { - #[serde(flatten)] - pub build_log_reference: BuildLogReference, - #[doc = "The date and time the log was created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "The date and time the log was last changed."] - #[serde( - rename = "lastChangedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_changed_on: Option<time::OffsetDateTime>, - #[doc = "The number of lines in the log."] - #[serde(rename = "lineCount", default, skip_serializing_if = "Option::is_none")] - pub line_count: Option<i64>, + #[serde(flatten)] + pub build_log_reference: BuildLogReference, + #[doc = "The date and time the log was created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "The date and time the log was last changed."] + #[serde( + rename = "lastChangedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_changed_on: Option<time::OffsetDateTime>, + #[doc = "The number of lines in the log."] + #[serde(rename = "lineCount", default, skip_serializing_if = "Option::is_none")] + pub line_count: Option<i64>, } impl BuildLog { - pub fn new(build_log_reference: BuildLogReference) -> Self { - Self { - build_log_reference, - created_on: None, - last_changed_on: None, - line_count: None, - } + pub fn new(build_log_reference: BuildLogReference) -> Self { + Self { + build_log_reference, + created_on: None, + last_changed_on: None, + line_count: None, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildLogList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BuildLog>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BuildLog>, } impl BuildLogList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to a build log."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BuildLogReference { - #[doc = "The ID of the log."] - pub id: i32, - #[doc = "The type of the log location."] - #[serde(rename = "type")] - pub type_: String, - #[doc = "A full link to the log resource."] - pub url: String, + #[doc = "The ID of the log."] + pub id: i32, + #[doc = "The type of the log location."] + #[serde(rename = "type")] + pub type_: String, + #[doc = "A full link to the log resource."] + pub url: String, } impl BuildLogReference { - pub fn new(id: i32, type_: String, url: String) -> Self { - Self { id, type_, url } - } + pub fn new(id: i32, type_: String, url: String) -> Self { + Self { id, type_, url } + } } #[doc = "Represents metadata about builds in the system."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildMetric { - #[doc = "The date for the scope."] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date: Option<time::OffsetDateTime>, - #[doc = "The value."] - #[serde(rename = "intValue", default, skip_serializing_if = "Option::is_none")] - pub int_value: Option<i32>, - #[doc = "The name of the metric."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The scope."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, + #[doc = "The date for the scope."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date: Option<time::OffsetDateTime>, + #[doc = "The value."] + #[serde(rename = "intValue", default, skip_serializing_if = "Option::is_none")] + pub int_value: Option<i32>, + #[doc = "The name of the metric."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The scope."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, } impl BuildMetric { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildMetricList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BuildMetric>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BuildMetric>, } impl BuildMetricList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the application of an optional behavior to a build definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildOption { - #[doc = "Represents a reference to a build option definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub definition: Option<BuildOptionDefinitionReference>, - #[doc = "Indicates whether the behavior is enabled."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option<serde_json::Value>, + #[doc = "Represents a reference to a build option definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option<BuildOptionDefinitionReference>, + #[doc = "Indicates whether the behavior is enabled."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inputs: Option<serde_json::Value>, } impl BuildOption { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an optional behavior that can be applied to a build definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildOptionDefinition { - #[serde(flatten)] - pub build_option_definition_reference: BuildOptionDefinitionReference, - #[doc = "The description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The list of input groups defined for the build option."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub groups: Vec<BuildOptionGroupDefinition>, - #[doc = "The list of inputs defined for the build option."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub inputs: Vec<BuildOptionInputDefinition>, - #[doc = "The name of the build option."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "A value that indicates the relative order in which the behavior should be applied."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ordinal: Option<i32>, + #[serde(flatten)] + pub build_option_definition_reference: BuildOptionDefinitionReference, + #[doc = "The description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The list of input groups defined for the build option."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub groups: Vec<BuildOptionGroupDefinition>, + #[doc = "The list of inputs defined for the build option."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub inputs: Vec<BuildOptionInputDefinition>, + #[doc = "The name of the build option."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "A value that indicates the relative order in which the behavior should be applied."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ordinal: Option<i32>, } impl BuildOptionDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildOptionDefinitionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BuildOptionDefinition>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BuildOptionDefinition>, } impl BuildOptionDefinitionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to a build option definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildOptionDefinitionReference { - #[doc = "The ID of the referenced build option."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[doc = "The ID of the referenced build option."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl BuildOptionDefinitionReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a group of inputs for a build option."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildOptionGroupDefinition { - #[doc = "The name of the group to display in the UI."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Indicates whether the group is initially displayed as expanded in the UI."] - #[serde( - rename = "isExpanded", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_expanded: Option<bool>, - #[doc = "The internal name of the group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "The name of the group to display in the UI."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Indicates whether the group is initially displayed as expanded in the UI."] + #[serde( + rename = "isExpanded", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_expanded: Option<bool>, + #[doc = "The internal name of the group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl BuildOptionGroupDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an input for a build option."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildOptionInputDefinition { - #[doc = "The default value."] - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<String>, - #[doc = "The name of the input group that this input belongs to."] - #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] - pub group_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub help: Option<serde_json::Value>, - #[doc = "The label for the input."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub label: Option<String>, - #[doc = "The name of the input."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub options: Option<serde_json::Value>, - #[doc = "Indicates whether the input is required to have a value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub required: Option<bool>, - #[doc = "Indicates the type of the input value."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<build_option_input_definition::Type>, - #[doc = "The rule that is applied to determine whether the input is visible in the UI."] - #[serde( - rename = "visibleRule", - default, - skip_serializing_if = "Option::is_none" - )] - pub visible_rule: Option<String>, + #[doc = "The default value."] + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<String>, + #[doc = "The name of the input group that this input belongs to."] + #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] + pub group_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub help: Option<serde_json::Value>, + #[doc = "The label for the input."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option<String>, + #[doc = "The name of the input."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub options: Option<serde_json::Value>, + #[doc = "Indicates whether the input is required to have a value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub required: Option<bool>, + #[doc = "Indicates the type of the input value."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<build_option_input_definition::Type>, + #[doc = "The rule that is applied to determine whether the input is visible in the UI."] + #[serde( + rename = "visibleRule", + default, + skip_serializing_if = "Option::is_none" + )] + pub visible_rule: Option<String>, } impl BuildOptionInputDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod build_option_input_definition { - use super::*; - #[doc = "Indicates the type of the input value."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "string")] - String, - #[serde(rename = "boolean")] - Boolean, - #[serde(rename = "stringList")] - StringList, - #[serde(rename = "radio")] - Radio, - #[serde(rename = "pickList")] - PickList, - #[serde(rename = "multiLine")] - MultiLine, - #[serde(rename = "branchFilter")] - BranchFilter, - } + use super::*; + #[doc = "Indicates the type of the input value."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "string")] + String, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "stringList")] + StringList, + #[serde(rename = "radio")] + Radio, + #[serde(rename = "pickList")] + PickList, + #[serde(rename = "multiLine")] + MultiLine, + #[serde(rename = "branchFilter")] + BranchFilter, + } } #[doc = "Represents a build process."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildProcess { - #[doc = "The type of the process."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<i32>, + #[doc = "The type of the process."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<i32>, } impl BuildProcess { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents resources used by a build process."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildProcessResources { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub endpoints: Vec<ServiceEndpointReference>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub files: Vec<SecureFileReference>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub queues: Vec<AgentPoolQueueReference>, - #[serde( - rename = "variableGroups", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub variable_groups: Vec<VariableGroupReference>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub endpoints: Vec<ServiceEndpointReference>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub files: Vec<SecureFileReference>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub queues: Vec<AgentPoolQueueReference>, + #[serde( + rename = "variableGroups", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub variable_groups: Vec<VariableGroupReference>, } impl BuildProcessResources { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildProcessTemplate { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde( - rename = "fileExists", - default, - skip_serializing_if = "Option::is_none" - )] - pub file_exists: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<String>, - #[serde( - rename = "serverPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub server_path: Option<String>, - #[serde( - rename = "supportedReasons", - default, - skip_serializing_if = "Option::is_none" - )] - pub supported_reasons: Option<build_process_template::SupportedReasons>, - #[serde( - rename = "teamProject", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project: Option<String>, - #[serde( - rename = "templateType", - default, - skip_serializing_if = "Option::is_none" - )] - pub template_type: Option<build_process_template::TemplateType>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde( + rename = "fileExists", + default, + skip_serializing_if = "Option::is_none" + )] + pub file_exists: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<String>, + #[serde( + rename = "serverPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub server_path: Option<String>, + #[serde( + rename = "supportedReasons", + default, + skip_serializing_if = "Option::is_none" + )] + pub supported_reasons: Option<build_process_template::SupportedReasons>, + #[serde( + rename = "teamProject", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project: Option<String>, + #[serde( + rename = "templateType", + default, + skip_serializing_if = "Option::is_none" + )] + pub template_type: Option<build_process_template::TemplateType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl BuildProcessTemplate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod build_process_template { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SupportedReasons { - #[serde(rename = "none")] - None, - #[serde(rename = "manual")] - Manual, - #[serde(rename = "individualCI")] - IndividualCi, - #[serde(rename = "batchedCI")] - BatchedCi, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "scheduleForced")] - ScheduleForced, - #[serde(rename = "userCreated")] - UserCreated, - #[serde(rename = "validateShelveset")] - ValidateShelveset, - #[serde(rename = "checkInShelveset")] - CheckInShelveset, - #[serde(rename = "pullRequest")] - PullRequest, - #[serde(rename = "buildCompletion")] - BuildCompletion, - #[serde(rename = "resourceTrigger")] - ResourceTrigger, - #[serde(rename = "triggered")] - Triggered, - #[serde(rename = "all")] - All, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TemplateType { - #[serde(rename = "custom")] - Custom, - #[serde(rename = "default")] - Default, - #[serde(rename = "upgrade")] - Upgrade, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SupportedReasons { + #[serde(rename = "none")] + None, + #[serde(rename = "manual")] + Manual, + #[serde(rename = "individualCI")] + IndividualCi, + #[serde(rename = "batchedCI")] + BatchedCi, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "scheduleForced")] + ScheduleForced, + #[serde(rename = "userCreated")] + UserCreated, + #[serde(rename = "validateShelveset")] + ValidateShelveset, + #[serde(rename = "checkInShelveset")] + CheckInShelveset, + #[serde(rename = "pullRequest")] + PullRequest, + #[serde(rename = "buildCompletion")] + BuildCompletion, + #[serde(rename = "resourceTrigger")] + ResourceTrigger, + #[serde(rename = "triggered")] + Triggered, + #[serde(rename = "all")] + All, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum TemplateType { + #[serde(rename = "custom")] + Custom, + #[serde(rename = "default")] + Default, + #[serde(rename = "upgrade")] + Upgrade, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildQueuedEvent { - #[serde(flatten)] - pub build_updated_event: BuildUpdatedEvent, + #[serde(flatten)] + pub build_updated_event: BuildUpdatedEvent, } impl BuildQueuedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to a build."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildReference { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "The build number."] - #[serde( - rename = "buildNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_number: Option<String>, - #[doc = "Indicates whether the build has been deleted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deleted: Option<bool>, - #[doc = "The time that the build was completed."] - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = "The ID of the build."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "The time that the build was queued."] - #[serde( - rename = "queueTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub queue_time: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "requestedFor", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_for: Option<IdentityRef>, - #[doc = "The build result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<build_reference::Result>, - #[doc = "The time that the build was started."] - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, - #[doc = "The build status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<build_reference::Status>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "The build number."] + #[serde( + rename = "buildNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_number: Option<String>, + #[doc = "Indicates whether the build has been deleted."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deleted: Option<bool>, + #[doc = "The time that the build was completed."] + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[doc = "The ID of the build."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "The time that the build was queued."] + #[serde( + rename = "queueTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub queue_time: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "requestedFor", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_for: Option<IdentityRef>, + #[doc = "The build result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<build_reference::Result>, + #[doc = "The time that the build was started."] + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, + #[doc = "The build status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<build_reference::Status>, } impl BuildReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod build_reference { - use super::*; - #[doc = "The build result."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "none")] - None, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "partiallySucceeded")] - PartiallySucceeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - } - #[doc = "The build status."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "none")] - None, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "cancelling")] - Cancelling, - #[serde(rename = "postponed")] - Postponed, - #[serde(rename = "notStarted")] - NotStarted, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "The build result."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "none")] + None, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "partiallySucceeded")] + PartiallySucceeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + } + #[doc = "The build status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "none")] + None, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "cancelling")] + Cancelling, + #[serde(rename = "postponed")] + Postponed, + #[serde(rename = "notStarted")] + NotStarted, + #[serde(rename = "all")] + All, + } } #[doc = "Represents information about a build report."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildReportMetadata { - #[doc = "The Id of the build."] - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option<i32>, - #[doc = "The content of the report."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub content: Option<String>, - #[doc = "The type of the report."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "The Id of the build."] + #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] + pub build_id: Option<i32>, + #[doc = "The content of the report."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content: Option<String>, + #[doc = "The type of the report."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl BuildReportMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a repository used by a build definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BuildRepository { - #[doc = "Indicates whether to checkout submodules."] - #[serde( - rename = "checkoutSubmodules", - default, - skip_serializing_if = "Option::is_none" - )] - pub checkout_submodules: Option<bool>, - #[doc = "Indicates whether to clean the target folder when getting code from the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub clean: Option<String>, - #[doc = "The name of the default branch."] - #[serde( - rename = "defaultBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_branch: Option<String>, - #[doc = "The ID of the repository."] - pub id: String, - #[doc = "The friendly name of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "The root folder."] - #[serde( - rename = "rootFolder", - default, - skip_serializing_if = "Option::is_none" - )] - pub root_folder: Option<String>, - #[doc = "The type of the repository."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "The URL of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Indicates whether to checkout submodules."] + #[serde( + rename = "checkoutSubmodules", + default, + skip_serializing_if = "Option::is_none" + )] + pub checkout_submodules: Option<bool>, + #[doc = "Indicates whether to clean the target folder when getting code from the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub clean: Option<String>, + #[doc = "The name of the default branch."] + #[serde( + rename = "defaultBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_branch: Option<String>, + #[doc = "The ID of the repository."] + pub id: String, + #[doc = "The friendly name of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "The root folder."] + #[serde( + rename = "rootFolder", + default, + skip_serializing_if = "Option::is_none" + )] + pub root_folder: Option<String>, + #[doc = "The type of the repository."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "The URL of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl BuildRepository { - pub fn new(id: String) -> Self { - Self { - checkout_submodules: None, - clean: None, - default_branch: None, - id, - name: None, - properties: None, - root_folder: None, - type_: None, - url: None, - } - } + pub fn new(id: String) -> Self { + Self { + checkout_submodules: None, + clean: None, + default_branch: None, + id, + name: None, + properties: None, + root_folder: None, + type_: None, + url: None, + } + } } #[doc = "Represents the result of validating a build request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildRequestValidationResult { - #[doc = "The message associated with the result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "The result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<build_request_validation_result::Result>, + #[doc = "The message associated with the result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "The result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<build_request_validation_result::Result>, } impl BuildRequestValidationResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod build_request_validation_result { - use super::*; - #[doc = "The result."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "ok")] - Ok, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - } + use super::*; + #[doc = "The result."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "ok")] + Ok, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + } } #[doc = "Represents information about resources used by builds in the system."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildResourceUsage { - #[doc = "The number of build agents."] - #[serde( - rename = "distributedTaskAgents", - default, - skip_serializing_if = "Option::is_none" - )] - pub distributed_task_agents: Option<i32>, - #[doc = "The number of paid private agent slots."] - #[serde( - rename = "paidPrivateAgentSlots", - default, - skip_serializing_if = "Option::is_none" - )] - pub paid_private_agent_slots: Option<i32>, - #[doc = "The total usage."] - #[serde( - rename = "totalUsage", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_usage: Option<i32>, - #[doc = "The number of XAML controllers."] - #[serde( - rename = "xamlControllers", - default, - skip_serializing_if = "Option::is_none" - )] - pub xaml_controllers: Option<i32>, + #[doc = "The number of build agents."] + #[serde( + rename = "distributedTaskAgents", + default, + skip_serializing_if = "Option::is_none" + )] + pub distributed_task_agents: Option<i32>, + #[doc = "The number of paid private agent slots."] + #[serde( + rename = "paidPrivateAgentSlots", + default, + skip_serializing_if = "Option::is_none" + )] + pub paid_private_agent_slots: Option<i32>, + #[doc = "The total usage."] + #[serde( + rename = "totalUsage", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_usage: Option<i32>, + #[doc = "The number of XAML controllers."] + #[serde( + rename = "xamlControllers", + default, + skip_serializing_if = "Option::is_none" + )] + pub xaml_controllers: Option<i32>, } impl BuildResourceUsage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A historical overview of build retention information. This includes a list of snapshots taken about build retention usage, and a list of builds that have exceeded the default 30 day retention policy."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildRetentionHistory { - #[doc = "A list of builds that are older than the default retention policy, but are not marked as retained. Something is causing these builds to not get cleaned up."] - #[serde( - rename = "buildRetentionSamples", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub build_retention_samples: Vec<BuildRetentionSample>, + #[doc = "A list of builds that are older than the default retention policy, but are not marked as retained. Something is causing these builds to not get cleaned up."] + #[serde( + rename = "buildRetentionSamples", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub build_retention_samples: Vec<BuildRetentionSample>, } impl BuildRetentionHistory { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A snapshot of build retention information. This class takes a sample at the given time. It provides information about retained builds, files associated with those retained builds, and number of files being retained."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildRetentionSample { - #[doc = "Summary of retention by build"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub builds: Option<String>, - #[doc = "List of build definitions"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub definitions: Option<String>, - #[doc = "Summary of files consumed by retained builds"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub files: Option<String>, - #[doc = "The date and time when the sample was taken"] - #[serde( - rename = "sampleTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub sample_time: Option<time::OffsetDateTime>, + #[doc = "Summary of retention by build"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub builds: Option<String>, + #[doc = "List of build definitions"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definitions: Option<String>, + #[doc = "Summary of files consumed by retained builds"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub files: Option<String>, + #[doc = "The date and time when the sample was taken"] + #[serde( + rename = "sampleTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub sample_time: Option<time::OffsetDateTime>, } impl BuildRetentionSample { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildServer { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub agents: Vec<BuildAgentReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub controller: Option<XamlBuildControllerReference>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(rename = "isVirtual", default, skip_serializing_if = "Option::is_none")] - pub is_virtual: Option<bool>, - #[serde( - rename = "messageQueueUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub message_queue_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "requireClientCertificates", - default, - skip_serializing_if = "Option::is_none" - )] - pub require_client_certificates: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<build_server::Status>, - #[serde( - rename = "statusChangedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub status_changed_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub agents: Vec<BuildAgentReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub controller: Option<XamlBuildControllerReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(rename = "isVirtual", default, skip_serializing_if = "Option::is_none")] + pub is_virtual: Option<bool>, + #[serde( + rename = "messageQueueUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub message_queue_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "requireClientCertificates", + default, + skip_serializing_if = "Option::is_none" + )] + pub require_client_certificates: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<build_server::Status>, + #[serde( + rename = "statusChangedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub status_changed_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i32>, } impl BuildServer { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod build_server { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "online")] - Online, - #[serde(rename = "offline")] - Offline, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "online")] + Online, + #[serde(rename = "offline")] + Offline, + } } #[doc = "Represents system-wide build settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildSettings { - #[doc = "The number of days to keep records of deleted builds."] - #[serde( - rename = "daysToKeepDeletedBuildsBeforeDestroy", - default, - skip_serializing_if = "Option::is_none" - )] - pub days_to_keep_deleted_builds_before_destroy: Option<i32>, - #[doc = "Represents a retention policy for a build definition."] - #[serde( - rename = "defaultRetentionPolicy", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_retention_policy: Option<RetentionPolicy>, - #[doc = "Represents a retention policy for a build definition."] - #[serde( - rename = "maximumRetentionPolicy", - default, - skip_serializing_if = "Option::is_none" - )] - pub maximum_retention_policy: Option<RetentionPolicy>, + #[doc = "The number of days to keep records of deleted builds."] + #[serde( + rename = "daysToKeepDeletedBuildsBeforeDestroy", + default, + skip_serializing_if = "Option::is_none" + )] + pub days_to_keep_deleted_builds_before_destroy: Option<i32>, + #[doc = "Represents a retention policy for a build definition."] + #[serde( + rename = "defaultRetentionPolicy", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_retention_policy: Option<RetentionPolicy>, + #[doc = "Represents a retention policy for a build definition."] + #[serde( + rename = "maximumRetentionPolicy", + default, + skip_serializing_if = "Option::is_none" + )] + pub maximum_retention_policy: Option<RetentionPolicy>, } impl BuildSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildSummary { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<XamlBuildReference>, - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[serde( - rename = "keepForever", - default, - skip_serializing_if = "Option::is_none" - )] - pub keep_forever: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub quality: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<build_summary::Reason>, - #[doc = ""] - #[serde( - rename = "requestedFor", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_for: Option<IdentityRef>, - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<build_summary::Status>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<XamlBuildReference>, + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[serde( + rename = "keepForever", + default, + skip_serializing_if = "Option::is_none" + )] + pub keep_forever: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub quality: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<build_summary::Reason>, + #[doc = ""] + #[serde( + rename = "requestedFor", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_for: Option<IdentityRef>, + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<build_summary::Status>, } impl BuildSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod build_summary { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Reason { - #[serde(rename = "none")] - None, - #[serde(rename = "manual")] - Manual, - #[serde(rename = "individualCI")] - IndividualCi, - #[serde(rename = "batchedCI")] - BatchedCi, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "scheduleForced")] - ScheduleForced, - #[serde(rename = "userCreated")] - UserCreated, - #[serde(rename = "validateShelveset")] - ValidateShelveset, - #[serde(rename = "checkInShelveset")] - CheckInShelveset, - #[serde(rename = "pullRequest")] - PullRequest, - #[serde(rename = "buildCompletion")] - BuildCompletion, - #[serde(rename = "resourceTrigger")] - ResourceTrigger, - #[serde(rename = "triggered")] - Triggered, - #[serde(rename = "all")] - All, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "none")] - None, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "cancelling")] - Cancelling, - #[serde(rename = "postponed")] - Postponed, - #[serde(rename = "notStarted")] - NotStarted, - #[serde(rename = "all")] - All, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Reason { + #[serde(rename = "none")] + None, + #[serde(rename = "manual")] + Manual, + #[serde(rename = "individualCI")] + IndividualCi, + #[serde(rename = "batchedCI")] + BatchedCi, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "scheduleForced")] + ScheduleForced, + #[serde(rename = "userCreated")] + UserCreated, + #[serde(rename = "validateShelveset")] + ValidateShelveset, + #[serde(rename = "checkInShelveset")] + CheckInShelveset, + #[serde(rename = "pullRequest")] + PullRequest, + #[serde(rename = "buildCompletion")] + BuildCompletion, + #[serde(rename = "resourceTrigger")] + ResourceTrigger, + #[serde(rename = "triggered")] + Triggered, + #[serde(rename = "all")] + All, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "none")] + None, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "cancelling")] + Cancelling, + #[serde(rename = "postponed")] + Postponed, + #[serde(rename = "notStarted")] + NotStarted, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildTagsAddedEvent { - #[serde(flatten)] - pub build_updated_event: BuildUpdatedEvent, - #[serde( - rename = "allTags", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub all_tags: Vec<String>, - #[serde( - rename = "newTags", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub new_tags: Vec<String>, + #[serde(flatten)] + pub build_updated_event: BuildUpdatedEvent, + #[serde( + rename = "allTags", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub all_tags: Vec<String>, + #[serde( + rename = "newTags", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub new_tags: Vec<String>, } impl BuildTagsAddedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a trigger for a buld definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildTrigger { - #[doc = "The type of the trigger."] - #[serde( - rename = "triggerType", - default, - skip_serializing_if = "Option::is_none" - )] - pub trigger_type: Option<build_trigger::TriggerType>, + #[doc = "The type of the trigger."] + #[serde( + rename = "triggerType", + default, + skip_serializing_if = "Option::is_none" + )] + pub trigger_type: Option<build_trigger::TriggerType>, } impl BuildTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod build_trigger { - use super::*; - #[doc = "The type of the trigger."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TriggerType { - #[serde(rename = "none")] - None, - #[serde(rename = "continuousIntegration")] - ContinuousIntegration, - #[serde(rename = "batchedContinuousIntegration")] - BatchedContinuousIntegration, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "gatedCheckIn")] - GatedCheckIn, - #[serde(rename = "batchedGatedCheckIn")] - BatchedGatedCheckIn, - #[serde(rename = "pullRequest")] - PullRequest, - #[serde(rename = "buildCompletion")] - BuildCompletion, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "The type of the trigger."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum TriggerType { + #[serde(rename = "none")] + None, + #[serde(rename = "continuousIntegration")] + ContinuousIntegration, + #[serde(rename = "batchedContinuousIntegration")] + BatchedContinuousIntegration, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "gatedCheckIn")] + GatedCheckIn, + #[serde(rename = "batchedGatedCheckIn")] + BatchedGatedCheckIn, + #[serde(rename = "pullRequest")] + PullRequest, + #[serde(rename = "buildCompletion")] + BuildCompletion, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildUpdatedEvent { - #[serde(flatten)] - pub realtime_build_event: RealtimeBuildEvent, - #[doc = "Data representation of a build."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<Build>, + #[serde(flatten)] + pub realtime_build_event: RealtimeBuildEvent, + #[doc = "Data representation of a build."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<Build>, } impl BuildUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a workspace mapping."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildWorkspace { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mappings: Vec<MappingDetails>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mappings: Vec<MappingDetails>, } impl BuildWorkspace { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildsDeletedEvent { - #[serde(flatten)] - pub builds_deleted_event1: BuildsDeletedEvent1, + #[serde(flatten)] + pub builds_deleted_event1: BuildsDeletedEvent1, } impl BuildsDeletedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildsDeletedEvent1 { - #[serde( - rename = "buildIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub build_ids: Vec<i32>, - #[doc = "The ID of the definition."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "The ID of the project."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, + #[serde( + rename = "buildIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub build_ids: Vec<i32>, + #[doc = "The ID of the definition."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "The ID of the project."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, } impl BuildsDeletedEvent1 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a change associated with a build."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Change { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<IdentityRef>, - #[doc = "The location of a user-friendly representation of the resource."] - #[serde( - rename = "displayUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_uri: Option<String>, - #[doc = "The identifier for the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The location of the full representation of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option<String>, - #[doc = "The description of the change. This might be a commit message or changeset description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "Indicates whether the message was truncated."] - #[serde( - rename = "messageTruncated", - default, - skip_serializing_if = "Option::is_none" - )] - pub message_truncated: Option<bool>, - #[doc = "The person or process that pushed the change."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pusher: Option<String>, - #[doc = "The timestamp for the change."] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub timestamp: Option<time::OffsetDateTime>, - #[doc = "The type of change. \"commit\", \"changeset\", etc."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<IdentityRef>, + #[doc = "The location of a user-friendly representation of the resource."] + #[serde( + rename = "displayUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_uri: Option<String>, + #[doc = "The identifier for the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The location of the full representation of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option<String>, + #[doc = "The description of the change. This might be a commit message or changeset description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "Indicates whether the message was truncated."] + #[serde( + rename = "messageTruncated", + default, + skip_serializing_if = "Option::is_none" + )] + pub message_truncated: Option<bool>, + #[doc = "The person or process that pushed the change."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pusher: Option<String>, + #[doc = "The timestamp for the change."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub timestamp: Option<time::OffsetDateTime>, + #[doc = "The type of change. \"commit\", \"changeset\", etc."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl Change { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChangeList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Change>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Change>, } impl ChangeList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ConsoleLogEvent { - #[serde(flatten)] - pub realtime_build_event: RealtimeBuildEvent, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub lines: Vec<String>, - #[serde( - rename = "stepRecordId", - default, - skip_serializing_if = "Option::is_none" - )] - pub step_record_id: Option<String>, - #[serde( - rename = "timelineId", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeline_id: Option<String>, - #[serde( - rename = "timelineRecordId", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeline_record_id: Option<String>, + #[serde(flatten)] + pub realtime_build_event: RealtimeBuildEvent, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub lines: Vec<String>, + #[serde( + rename = "stepRecordId", + default, + skip_serializing_if = "Option::is_none" + )] + pub step_record_id: Option<String>, + #[serde( + rename = "timelineId", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeline_id: Option<String>, + #[serde( + rename = "timelineRecordId", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeline_record_id: Option<String>, } impl ConsoleLogEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContinuousDeploymentDefinition { - #[doc = ""] - #[serde( - rename = "connectedService", - default, - skip_serializing_if = "Option::is_none" - )] - pub connected_service: Option<WebApiConnectedServiceRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub definition: Option<XamlDefinitionReference>, - #[serde(rename = "gitBranch", default, skip_serializing_if = "Option::is_none")] - pub git_branch: Option<String>, - #[serde( - rename = "hostedServiceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub hosted_service_name: Option<String>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, - #[serde( - rename = "storageAccountName", - default, - skip_serializing_if = "Option::is_none" - )] - pub storage_account_name: Option<String>, - #[serde( - rename = "subscriptionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub website: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub webspace: Option<String>, + #[doc = ""] + #[serde( + rename = "connectedService", + default, + skip_serializing_if = "Option::is_none" + )] + pub connected_service: Option<WebApiConnectedServiceRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option<XamlDefinitionReference>, + #[serde(rename = "gitBranch", default, skip_serializing_if = "Option::is_none")] + pub git_branch: Option<String>, + #[serde( + rename = "hostedServiceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub hosted_service_name: Option<String>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, + #[serde( + rename = "storageAccountName", + default, + skip_serializing_if = "Option::is_none" + )] + pub storage_account_name: Option<String>, + #[serde( + rename = "subscriptionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub website: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub webspace: Option<String>, } impl ContinuousDeploymentDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a continuous integration (CI) trigger."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContinuousIntegrationTrigger { - #[serde(flatten)] - pub build_trigger: BuildTrigger, - #[doc = "Indicates whether changes should be batched while another CI build is running."] - #[serde( - rename = "batchChanges", - default, - skip_serializing_if = "Option::is_none" - )] - pub batch_changes: Option<bool>, - #[serde( - rename = "branchFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub branch_filters: Vec<String>, - #[doc = "The maximum number of simultaneous CI builds that will run per branch."] - #[serde( - rename = "maxConcurrentBuildsPerBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_concurrent_builds_per_branch: Option<i32>, - #[serde( - rename = "pathFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub path_filters: Vec<String>, - #[doc = "The polling interval, in seconds."] - #[serde( - rename = "pollingInterval", - default, - skip_serializing_if = "Option::is_none" - )] - pub polling_interval: Option<i32>, - #[doc = "The ID of the job used to poll an external repository."] - #[serde( - rename = "pollingJobId", - default, - skip_serializing_if = "Option::is_none" - )] - pub polling_job_id: Option<String>, - #[serde( - rename = "settingsSourceType", - default, - skip_serializing_if = "Option::is_none" - )] - pub settings_source_type: Option<i32>, + #[serde(flatten)] + pub build_trigger: BuildTrigger, + #[doc = "Indicates whether changes should be batched while another CI build is running."] + #[serde( + rename = "batchChanges", + default, + skip_serializing_if = "Option::is_none" + )] + pub batch_changes: Option<bool>, + #[serde( + rename = "branchFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub branch_filters: Vec<String>, + #[doc = "The maximum number of simultaneous CI builds that will run per branch."] + #[serde( + rename = "maxConcurrentBuildsPerBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_concurrent_builds_per_branch: Option<i32>, + #[serde( + rename = "pathFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub path_filters: Vec<String>, + #[doc = "The polling interval, in seconds."] + #[serde( + rename = "pollingInterval", + default, + skip_serializing_if = "Option::is_none" + )] + pub polling_interval: Option<i32>, + #[doc = "The ID of the job used to poll an external repository."] + #[serde( + rename = "pollingJobId", + default, + skip_serializing_if = "Option::is_none" + )] + pub polling_job_id: Option<String>, + #[serde( + rename = "settingsSourceType", + default, + skip_serializing_if = "Option::is_none" + )] + pub settings_source_type: Option<i32>, } impl ContinuousIntegrationTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents binding of data source for the service endpoint request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataSourceBindingBase { - #[doc = "Pagination format supported by this data source(ContinuationToken/SkipTop)."] - #[serde( - rename = "callbackContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_context_template: Option<String>, - #[doc = "Subsequent calls needed?"] - #[serde( - rename = "callbackRequiredTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_required_template: Option<String>, - #[doc = "Gets or sets the name of the data source."] - #[serde( - rename = "dataSourceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub data_source_name: Option<String>, - #[doc = "Gets or sets the endpoint Id."] - #[serde( - rename = "endpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_id: Option<String>, - #[doc = "Gets or sets the url of the service endpoint."] - #[serde( - rename = "endpointUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_url: Option<String>, - #[doc = "Gets or sets the authorization headers."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub headers: Vec<AuthorizationHeader>, - #[doc = "Defines the initial value of the query params"] - #[serde( - rename = "initialContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub initial_context_template: Option<String>, - #[doc = "Gets or sets the parameters for the data source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<serde_json::Value>, - #[doc = "Gets or sets http request body"] - #[serde( - rename = "requestContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_content: Option<String>, - #[doc = "Gets or sets http request verb"] - #[serde( - rename = "requestVerb", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_verb: Option<String>, - #[doc = "Gets or sets the result selector."] - #[serde( - rename = "resultSelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_selector: Option<String>, - #[doc = "Gets or sets the result template."] - #[serde( - rename = "resultTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_template: Option<String>, - #[doc = "Gets or sets the target of the data source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<String>, + #[doc = "Pagination format supported by this data source(ContinuationToken/SkipTop)."] + #[serde( + rename = "callbackContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_context_template: Option<String>, + #[doc = "Subsequent calls needed?"] + #[serde( + rename = "callbackRequiredTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_required_template: Option<String>, + #[doc = "Gets or sets the name of the data source."] + #[serde( + rename = "dataSourceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub data_source_name: Option<String>, + #[doc = "Gets or sets the endpoint Id."] + #[serde( + rename = "endpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_id: Option<String>, + #[doc = "Gets or sets the url of the service endpoint."] + #[serde( + rename = "endpointUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_url: Option<String>, + #[doc = "Gets or sets the authorization headers."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub headers: Vec<AuthorizationHeader>, + #[doc = "Defines the initial value of the query params"] + #[serde( + rename = "initialContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub initial_context_template: Option<String>, + #[doc = "Gets or sets the parameters for the data source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<serde_json::Value>, + #[doc = "Gets or sets http request body"] + #[serde( + rename = "requestContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_content: Option<String>, + #[doc = "Gets or sets http request verb"] + #[serde( + rename = "requestVerb", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_verb: Option<String>, + #[doc = "Gets or sets the result selector."] + #[serde( + rename = "resultSelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_selector: Option<String>, + #[doc = "Gets or sets the result template."] + #[serde( + rename = "resultTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_template: Option<String>, + #[doc = "Gets or sets the target of the data source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<String>, } impl DataSourceBindingBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to a definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DefinitionReference { - #[doc = "The date this version of the definition was created."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "The ID of the referenced definition."] - pub id: i32, - #[doc = "The name of the referenced definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The folder path of the definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Represents a shallow reference to a TeamProject."] - pub project: TeamProjectReference, - #[doc = "A value that indicates whether builds can be queued against this definition."] - #[serde(rename = "queueStatus")] - pub queue_status: definition_reference::QueueStatus, - #[doc = "The definition revision number."] - pub revision: i32, - #[doc = "The type of the definition."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<definition_reference::Type>, - #[doc = "The definition's URI."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, - #[doc = "The REST URL of the definition."] - pub url: String, + #[doc = "The date this version of the definition was created."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "The ID of the referenced definition."] + pub id: i32, + #[doc = "The name of the referenced definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The folder path of the definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Represents a shallow reference to a TeamProject."] + pub project: TeamProjectReference, + #[doc = "A value that indicates whether builds can be queued against this definition."] + #[serde(rename = "queueStatus")] + pub queue_status: definition_reference::QueueStatus, + #[doc = "The definition revision number."] + pub revision: i32, + #[doc = "The type of the definition."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<definition_reference::Type>, + #[doc = "The definition's URI."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, + #[doc = "The REST URL of the definition."] + pub url: String, } impl DefinitionReference { - pub fn new( - id: i32, - project: TeamProjectReference, - queue_status: definition_reference::QueueStatus, - revision: i32, - url: String, - ) -> Self { - Self { - created_date: None, - id, - name: None, - path: None, - project, - queue_status, - revision, - type_: None, - uri: None, - url, - } - } + pub fn new( + id: i32, + project: TeamProjectReference, + queue_status: definition_reference::QueueStatus, + revision: i32, + url: String, + ) -> Self { + Self { + created_date: None, + id, + name: None, + path: None, + project, + queue_status, + revision, + type_: None, + uri: None, + url, + } + } } pub mod definition_reference { - use super::*; - #[doc = "A value that indicates whether builds can be queued against this definition."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum QueueStatus { - #[serde(rename = "enabled")] - Enabled, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "disabled")] - Disabled, - } - #[doc = "The type of the definition."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "xaml")] - Xaml, - #[serde(rename = "build")] - Build, - } + use super::*; + #[doc = "A value that indicates whether builds can be queued against this definition."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum QueueStatus { + #[serde(rename = "enabled")] + Enabled, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "disabled")] + Disabled, + } + #[doc = "The type of the definition."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "xaml")] + Xaml, + #[serde(rename = "build")] + Build, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DefinitionResourceReference { - #[doc = "Indicates whether the resource is authorized for use."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorized: Option<bool>, - #[doc = "The id of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "A friendly name for the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The type of the resource."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Indicates whether the resource is authorized for use."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorized: Option<bool>, + #[doc = "The id of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "A friendly name for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The type of the resource."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl DefinitionResourceReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DefinitionResourceReferenceList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<DefinitionResourceReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<DefinitionResourceReference>, } impl DefinitionResourceReferenceList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a demand used by a definition or build."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Demand { - #[doc = "The name of the capability referenced by the demand."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The demanded value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "The name of the capability referenced by the demand."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The demanded value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl Demand { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a dependency."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Dependency { - #[doc = "The event. The dependency is satisfied when the referenced object emits this event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub event: Option<String>, - #[doc = "The scope. This names the object referenced by the dependency."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, + #[doc = "The event. The dependency is satisfied when the referenced object emits this event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub event: Option<String>, + #[doc = "The scope. This names the object referenced by the dependency."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, } impl Dependency { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the data from the build information nodes for type \"DeploymentInformation\" for xaml builds"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Deployment { - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl Deployment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deployment information for type \"Build\""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentBuild { - #[serde(flatten)] - pub deployment: Deployment, - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option<i32>, + #[serde(flatten)] + pub deployment: Deployment, + #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] + pub build_id: Option<i32>, } impl DeploymentBuild { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deployment information for type \"Deploy\""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentDeploy { - #[serde(flatten)] - pub deployment: Deployment, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, + #[serde(flatten)] + pub deployment: Deployment, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, } impl DeploymentDeploy { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deployment information for type \"Test\""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentTest { - #[serde(flatten)] - pub deployment: Deployment, - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option<i32>, + #[serde(flatten)] + pub deployment: Deployment, + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option<i32>, } impl DeploymentTest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a build process supported by the build definition designer."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DesignerProcess { - #[serde(flatten)] - pub build_process: BuildProcess, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub phases: Vec<Phase>, - #[doc = "Represents the target for the build process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<DesignerProcessTarget>, + #[serde(flatten)] + pub build_process: BuildProcess, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub phases: Vec<Phase>, + #[doc = "Represents the target for the build process."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<DesignerProcessTarget>, } impl DesignerProcess { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the target for the build process."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DesignerProcessTarget { - #[doc = "Specification of the agent defined by the pool provider."] - #[serde( - rename = "agentSpecification", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_specification: Option<AgentSpecification>, + #[doc = "Specification of the agent defined by the pool provider."] + #[serde( + rename = "agentSpecification", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_specification: Option<AgentSpecification>, } impl DesignerProcessTarget { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DockerProcess { - #[serde(flatten)] - pub build_process: BuildProcess, - #[doc = "Represents the target for the docker build process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<DockerProcessTarget>, + #[serde(flatten)] + pub build_process: BuildProcess, + #[doc = "Represents the target for the docker build process."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<DockerProcessTarget>, } impl DockerProcess { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the target for the docker build process."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DockerProcessTarget { - #[serde(flatten)] - pub designer_process_target: DesignerProcessTarget, + #[serde(flatten)] + pub designer_process_target: DesignerProcessTarget, } impl DockerProcessTarget { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a folder that contains build definitions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Folder { - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "The date the folder was created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "The description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = ""] - #[serde( - rename = "lastChangedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_changed_by: Option<IdentityRef>, - #[doc = "The date the folder was last changed."] - #[serde( - rename = "lastChangedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_changed_date: Option<time::OffsetDateTime>, - #[doc = "The full path."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "The date the folder was created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "The description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = ""] + #[serde( + rename = "lastChangedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_changed_by: Option<IdentityRef>, + #[doc = "The date the folder was last changed."] + #[serde( + rename = "lastChangedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_changed_date: Option<time::OffsetDateTime>, + #[doc = "The full path."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, } impl Folder { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FolderList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Folder>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Folder>, } impl FolderList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the ability to build forks of the selected repository."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Forks { - #[doc = "Indicates whether a build should allow a full access token or scope it down when building forks of the selected repository."] - #[serde( - rename = "allowFullAccessToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_full_access_token: Option<bool>, - #[doc = "Indicates whether a build should use secrets when building forks of the selected repository."] - #[serde( - rename = "allowSecrets", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_secrets: Option<bool>, - #[doc = "Indicates whether the trigger should queue builds for forks of the selected repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, + #[doc = "Indicates whether a build should allow a full access token or scope it down when building forks of the selected repository."] + #[serde( + rename = "allowFullAccessToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub allow_full_access_token: Option<bool>, + #[doc = "Indicates whether a build should use secrets when building forks of the selected repository."] + #[serde( + rename = "allowSecrets", + default, + skip_serializing_if = "Option::is_none" + )] + pub allow_secrets: Option<bool>, + #[doc = "Indicates whether the trigger should queue builds for forks of the selected repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, } impl Forks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a gated check-in trigger."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GatedCheckInTrigger { - #[serde(flatten)] - pub build_trigger: BuildTrigger, - #[serde( - rename = "pathFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub path_filters: Vec<String>, - #[doc = "Indicates whether CI triggers should run after the gated check-in succeeds."] - #[serde( - rename = "runContinuousIntegration", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_continuous_integration: Option<bool>, - #[doc = "Indicates whether to take workspace mappings into account when determining whether a build should run."] - #[serde( - rename = "useWorkspaceMappings", - default, - skip_serializing_if = "Option::is_none" - )] - pub use_workspace_mappings: Option<bool>, + #[serde(flatten)] + pub build_trigger: BuildTrigger, + #[serde( + rename = "pathFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub path_filters: Vec<String>, + #[doc = "Indicates whether CI triggers should run after the gated check-in succeeds."] + #[serde( + rename = "runContinuousIntegration", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_continuous_integration: Option<bool>, + #[doc = "Indicates whether to take workspace mappings into account when determining whether a build should run."] + #[serde( + rename = "useWorkspaceMappings", + default, + skip_serializing_if = "Option::is_none" + )] + pub use_workspace_mappings: Option<bool>, } impl GatedCheckInTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, + } + } } #[doc = "Data representation of an information node associated with a build"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InformationNode { - #[doc = "Fields of the information node"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fields: Option<serde_json::Value>, - #[doc = "Process or person that last modified this node"] - #[serde( - rename = "lastModifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_modified_by: Option<String>, - #[doc = "Date this node was last modified"] - #[serde( - rename = "lastModifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified_date: Option<time::OffsetDateTime>, - #[doc = "Node Id of this information node"] - #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")] - pub node_id: Option<i32>, - #[doc = "Id of parent node (xml tree)"] - #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option<i32>, - #[doc = "The type of the information node"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Fields of the information node"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fields: Option<serde_json::Value>, + #[doc = "Process or person that last modified this node"] + #[serde( + rename = "lastModifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_modified_by: Option<String>, + #[doc = "Date this node was last modified"] + #[serde( + rename = "lastModifiedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified_date: Option<time::OffsetDateTime>, + #[doc = "Node Id of this information node"] + #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")] + pub node_id: Option<i32>, + #[doc = "Id of parent node (xml tree)"] + #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option<i32>, + #[doc = "The type of the information node"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl InformationNode { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an issue (error, warning) associated with a build."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Issue { - #[doc = "The category."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "A description of the issue."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "The type (error, warning) of the issue."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<issue::Type>, + #[doc = "The category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "A description of the issue."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "The type (error, warning) of the issue."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<issue::Type>, } impl Issue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod issue { - use super::*; - #[doc = "The type (error, warning) of the issue."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "error")] - Error, - #[serde(rename = "warning")] - Warning, - } + use super::*; + #[doc = "The type (error, warning) of the issue."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "error")] + Error, + #[serde(rename = "warning")] + Warning, + } } #[doc = "Job in pipeline. This is related to matrixing in YAML."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobReference { - #[doc = "Attempt number of the job"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character."] - #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] - pub job_name: Option<String>, + #[doc = "Attempt number of the job"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character."] + #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] + pub job_name: Option<String>, } impl JobReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for JSON Patch Operations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchDocument {} impl JsonPatchDocument { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for a JSON Patch operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchOperation { - #[doc = "The path to copy from for the Move/Copy operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub from: Option<String>, - #[doc = "The patch operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub op: Option<json_patch_operation::Op>, - #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "The value for the operation. This is either a primitive or a JToken."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = "The path to copy from for the Move/Copy operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub from: Option<String>, + #[doc = "The patch operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub op: Option<json_patch_operation::Op>, + #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "The value for the operation. This is either a primitive or a JToken."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl JsonPatchOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod json_patch_operation { - use super::*; - #[doc = "The patch operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Op { - #[serde(rename = "add")] - Add, - #[serde(rename = "remove")] - Remove, - #[serde(rename = "replace")] - Replace, - #[serde(rename = "move")] - Move, - #[serde(rename = "copy")] - Copy, - #[serde(rename = "test")] - Test, - } + use super::*; + #[doc = "The patch operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Op { + #[serde(rename = "add")] + Add, + #[serde(rename = "remove")] + Remove, + #[serde(rename = "replace")] + Replace, + #[serde(rename = "move")] + Move, + #[serde(rename = "copy")] + Copy, + #[serde(rename = "test")] + Test, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JustInTimeProcess { - #[serde(flatten)] - pub build_process: BuildProcess, + #[serde(flatten)] + pub build_process: BuildProcess, } impl JustInTimeProcess { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Link URL"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Link { - pub href: String, + pub href: String, } impl Link { - pub fn new(href: String) -> Self { - Self { href } - } + pub fn new(href: String) -> Self { + Self { href } + } } #[doc = "Represents an entry in a workspace mapping."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MappingDetails { - #[doc = "The local path."] - #[serde(rename = "localPath", default, skip_serializing_if = "Option::is_none")] - pub local_path: Option<String>, - #[doc = "The mapping type."] - #[serde( - rename = "mappingType", - default, - skip_serializing_if = "Option::is_none" - )] - pub mapping_type: Option<String>, - #[doc = "The server path."] - #[serde( - rename = "serverPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub server_path: Option<String>, + #[doc = "The local path."] + #[serde(rename = "localPath", default, skip_serializing_if = "Option::is_none")] + pub local_path: Option<String>, + #[doc = "The mapping type."] + #[serde( + rename = "mappingType", + default, + skip_serializing_if = "Option::is_none" + )] + pub mapping_type: Option<String>, + #[doc = "The server path."] + #[serde( + rename = "serverPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub server_path: Option<String>, } impl MappingDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MinimalRetentionLease { - #[doc = "The pipeline definition of the run."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "User-provided string that identifies the owner of a retention lease."] - #[serde(rename = "ownerId", default, skip_serializing_if = "Option::is_none")] - pub owner_id: Option<String>, - #[doc = "The pipeline run to protect."] - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option<i32>, + #[doc = "The pipeline definition of the run."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "User-provided string that identifies the owner of a retention lease."] + #[serde(rename = "ownerId", default, skip_serializing_if = "Option::is_none")] + pub owner_id: Option<String>, + #[doc = "The pipeline run to protect."] + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option<i32>, } impl MinimalRetentionLease { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents options for running a phase against multiple agents."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MultipleAgentExecutionOptions { - #[serde(flatten)] - pub agent_target_execution_options: AgentTargetExecutionOptions, - #[doc = "Indicates whether failure on one agent should prevent the phase from running on other agents."] - #[serde( - rename = "continueOnError", - default, - skip_serializing_if = "Option::is_none" - )] - pub continue_on_error: Option<bool>, - #[doc = "The maximum number of agents to use simultaneously."] - #[serde( - rename = "maxConcurrency", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_concurrency: Option<i32>, + #[serde(flatten)] + pub agent_target_execution_options: AgentTargetExecutionOptions, + #[doc = "Indicates whether failure on one agent should prevent the phase from running on other agents."] + #[serde( + rename = "continueOnError", + default, + skip_serializing_if = "Option::is_none" + )] + pub continue_on_error: Option<bool>, + #[doc = "The maximum number of agents to use simultaneously."] + #[serde( + rename = "maxConcurrency", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_concurrency: Option<i32>, } impl MultipleAgentExecutionOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Required information to create a new retention lease."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NewRetentionLease { - #[doc = "The number of days to consider the lease valid. A retention lease valid for more than 100 years (36500 days) will display as retaining the build \"forever\"."] - #[serde(rename = "daysValid", default, skip_serializing_if = "Option::is_none")] - pub days_valid: Option<i32>, - #[doc = "The pipeline definition of the run."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "User-provided string that identifies the owner of a retention lease."] - #[serde(rename = "ownerId", default, skip_serializing_if = "Option::is_none")] - pub owner_id: Option<String>, - #[doc = "If set, this lease will also prevent the pipeline from being deleted while the lease is still valid."] - #[serde( - rename = "protectPipeline", - default, - skip_serializing_if = "Option::is_none" - )] - pub protect_pipeline: Option<bool>, - #[doc = "The pipeline run to protect."] - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option<i32>, + #[doc = "The number of days to consider the lease valid. A retention lease valid for more than 100 years (36500 days) will display as retaining the build \"forever\"."] + #[serde(rename = "daysValid", default, skip_serializing_if = "Option::is_none")] + pub days_valid: Option<i32>, + #[doc = "The pipeline definition of the run."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "User-provided string that identifies the owner of a retention lease."] + #[serde(rename = "ownerId", default, skip_serializing_if = "Option::is_none")] + pub owner_id: Option<String>, + #[doc = "If set, this lease will also prevent the pipeline from being deleted while the lease is still valid."] + #[serde( + rename = "protectPipeline", + default, + skip_serializing_if = "Option::is_none" + )] + pub protect_pipeline: Option<bool>, + #[doc = "The pipeline run to protect."] + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option<i32>, } impl NewRetentionLease { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a phase of a build definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Phase { - #[doc = "The condition that must be true for this phase to execute."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub condition: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dependencies: Vec<Dependency>, - #[doc = "The job authorization scope for builds queued against this definition."] - #[serde( - rename = "jobAuthorizationScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_authorization_scope: Option<phase::JobAuthorizationScope>, - #[doc = "The cancellation timeout, in minutes, for builds queued against this definition."] - #[serde( - rename = "jobCancelTimeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_cancel_timeout_in_minutes: Option<i32>, - #[doc = "The job execution timeout, in minutes, for builds queued against this definition."] - #[serde( - rename = "jobTimeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_timeout_in_minutes: Option<i32>, - #[doc = "The name of the phase."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The unique ref name of the phase."] - #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] - pub ref_name: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub steps: Vec<BuildDefinitionStep>, - #[doc = "Represents the target of a phase."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<PhaseTarget>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[doc = "The condition that must be true for this phase to execute."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub condition: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dependencies: Vec<Dependency>, + #[doc = "The job authorization scope for builds queued against this definition."] + #[serde( + rename = "jobAuthorizationScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_authorization_scope: Option<phase::JobAuthorizationScope>, + #[doc = "The cancellation timeout, in minutes, for builds queued against this definition."] + #[serde( + rename = "jobCancelTimeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_cancel_timeout_in_minutes: Option<i32>, + #[doc = "The job execution timeout, in minutes, for builds queued against this definition."] + #[serde( + rename = "jobTimeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_timeout_in_minutes: Option<i32>, + #[doc = "The name of the phase."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The unique ref name of the phase."] + #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] + pub ref_name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub steps: Vec<BuildDefinitionStep>, + #[doc = "Represents the target of a phase."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<PhaseTarget>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl Phase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod phase { - use super::*; - #[doc = "The job authorization scope for builds queued against this definition."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum JobAuthorizationScope { - #[serde(rename = "projectCollection")] - ProjectCollection, - #[serde(rename = "project")] - Project, - } + use super::*; + #[doc = "The job authorization scope for builds queued against this definition."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum JobAuthorizationScope { + #[serde(rename = "projectCollection")] + ProjectCollection, + #[serde(rename = "project")] + Project, + } } #[doc = "Phase in pipeline"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PhaseReference { - #[doc = "Attempt number of the phase"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Name of the phase. Maximum supported length for name is 256 character."] - #[serde(rename = "phaseName", default, skip_serializing_if = "Option::is_none")] - pub phase_name: Option<String>, + #[doc = "Attempt number of the phase"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Name of the phase. Maximum supported length for name is 256 character."] + #[serde(rename = "phaseName", default, skip_serializing_if = "Option::is_none")] + pub phase_name: Option<String>, } impl PhaseReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the target of a phase."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PhaseTarget { - #[doc = "The type of the target."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<i32>, + #[doc = "The type of the target."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<i32>, } impl PhaseTarget { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contains pipeline general settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelineGeneralSettings { - #[doc = "If enabled, audit logs will be generated whenever someone queues a pipeline run and defines variables that are not marked as \"Settable at queue time\"."] - #[serde( - rename = "auditEnforceSettableVar", - default, - skip_serializing_if = "Option::is_none" - )] - pub audit_enforce_settable_var: Option<bool>, - #[doc = "Disable classic build pipelines creation."] - #[serde( - rename = "disableClassicBuildPipelineCreation", - default, - skip_serializing_if = "Option::is_none" - )] - pub disable_classic_build_pipeline_creation: Option<bool>, - #[doc = "Disable classic pipelines creation."] - #[serde( - rename = "disableClassicPipelineCreation", - default, - skip_serializing_if = "Option::is_none" - )] - pub disable_classic_pipeline_creation: Option<bool>, - #[doc = "Disable classic release pipelines creation."] - #[serde( - rename = "disableClassicReleasePipelineCreation", - default, - skip_serializing_if = "Option::is_none" - )] - pub disable_classic_release_pipeline_creation: Option<bool>, - #[doc = "If enabled, scope of access for all non-release pipelines reduces to the current project."] - #[serde( - rename = "enforceJobAuthScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub enforce_job_auth_scope: Option<bool>, - #[doc = "If enabled, scope of access for all release pipelines reduces to the current project."] - #[serde( - rename = "enforceJobAuthScopeForReleases", - default, - skip_serializing_if = "Option::is_none" - )] - pub enforce_job_auth_scope_for_releases: Option<bool>, - #[doc = "Restricts the scope of access for all pipelines to only repositories explicitly referenced by the pipeline."] - #[serde( - rename = "enforceReferencedRepoScopedToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub enforce_referenced_repo_scoped_token: Option<bool>, - #[doc = "If enabled, only those variables that are explicitly marked as \"Settable at queue time\" can be set at queue time."] - #[serde( - rename = "enforceSettableVar", - default, - skip_serializing_if = "Option::is_none" - )] - pub enforce_settable_var: Option<bool>, - #[doc = "Allows pipelines to record metadata."] - #[serde( - rename = "publishPipelineMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub publish_pipeline_metadata: Option<bool>, - #[doc = "Anonymous users can access the status badge API for all pipelines unless this option is enabled."] - #[serde( - rename = "statusBadgesArePrivate", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_badges_are_private: Option<bool>, + #[doc = "If enabled, scope of access for all non-release pipelines reduces to the current project."] + #[serde( + rename = "enforceJobAuthScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub enforce_job_auth_scope: Option<bool>, + #[doc = "If enabled, scope of access for all release pipelines reduces to the current project."] + #[serde( + rename = "enforceJobAuthScopeForReleases", + default, + skip_serializing_if = "Option::is_none" + )] + pub enforce_job_auth_scope_for_releases: Option<bool>, + #[doc = "Restricts the scope of access for all pipelines to only repositories explicitly referenced by the pipeline."] + #[serde( + rename = "enforceReferencedRepoScopedToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub enforce_referenced_repo_scoped_token: Option<bool>, + #[doc = "If enabled, only those variables that are explicitly marked as \"Settable at queue time\" can be set at queue time."] + #[serde( + rename = "enforceSettableVar", + default, + skip_serializing_if = "Option::is_none" + )] + pub enforce_settable_var: Option<bool>, + #[doc = "Allows pipelines to record metadata."] + #[serde( + rename = "publishPipelineMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub publish_pipeline_metadata: Option<bool>, + #[doc = "Anonymous users can access the status badge API for all pipelines unless this option is enabled."] + #[serde( + rename = "statusBadgesArePrivate", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_badges_are_private: Option<bool>, } impl PipelineGeneralSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Pipeline reference"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelineReference { - #[doc = "Job in pipeline. This is related to matrixing in YAML."] - #[serde( - rename = "jobReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_reference: Option<JobReference>, - #[doc = "Phase in pipeline"] - #[serde( - rename = "phaseReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub phase_reference: Option<PhaseReference>, - #[doc = "Reference of the pipeline with which this pipeline instance is related."] - #[serde( - rename = "pipelineId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pipeline_id: Option<i32>, - #[doc = "Stage in pipeline"] - #[serde( - rename = "stageReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub stage_reference: Option<StageReference>, + #[doc = "Job in pipeline. This is related to matrixing in YAML."] + #[serde( + rename = "jobReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_reference: Option<JobReference>, + #[doc = "Phase in pipeline"] + #[serde( + rename = "phaseReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub phase_reference: Option<PhaseReference>, + #[doc = "Reference of the pipeline with which this pipeline instance is related."] + #[serde( + rename = "pipelineId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pipeline_id: Option<i32>, + #[doc = "Stage in pipeline"] + #[serde( + rename = "stageReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub stage_reference: Option<StageReference>, } impl PipelineReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessParameters { - #[serde( - rename = "dataSourceBindings", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub data_source_bindings: Vec<DataSourceBindingBase>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub inputs: Vec<TaskInputDefinitionBase>, - #[serde( - rename = "sourceDefinitions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub source_definitions: Vec<TaskSourceDefinitionBase>, + #[serde( + rename = "dataSourceBindings", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub data_source_bindings: Vec<DataSourceBindingBase>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub inputs: Vec<TaskInputDefinitionBase>, + #[serde( + rename = "sourceDefinitions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub source_definitions: Vec<TaskSourceDefinitionBase>, } impl ProcessParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contains the settings for the retention rules."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectRetentionSetting { - #[doc = "Contains the minimum, maximum, and current value for a retention setting."] - #[serde( - rename = "purgeArtifacts", - default, - skip_serializing_if = "Option::is_none" - )] - pub purge_artifacts: Option<RetentionSetting>, - #[doc = "Contains the minimum, maximum, and current value for a retention setting."] - #[serde( - rename = "purgePullRequestRuns", - default, - skip_serializing_if = "Option::is_none" - )] - pub purge_pull_request_runs: Option<RetentionSetting>, - #[doc = "Contains the minimum, maximum, and current value for a retention setting."] - #[serde(rename = "purgeRuns", default, skip_serializing_if = "Option::is_none")] - pub purge_runs: Option<RetentionSetting>, - #[doc = "Contains the minimum, maximum, and current value for a retention setting."] - #[serde( - rename = "retainRunsPerProtectedBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub retain_runs_per_protected_branch: Option<RetentionSetting>, + #[doc = "Contains the minimum, maximum, and current value for a retention setting."] + #[serde( + rename = "purgeArtifacts", + default, + skip_serializing_if = "Option::is_none" + )] + pub purge_artifacts: Option<RetentionSetting>, + #[doc = "Contains the minimum, maximum, and current value for a retention setting."] + #[serde( + rename = "purgePullRequestRuns", + default, + skip_serializing_if = "Option::is_none" + )] + pub purge_pull_request_runs: Option<RetentionSetting>, + #[doc = "Contains the minimum, maximum, and current value for a retention setting."] + #[serde(rename = "purgeRuns", default, skip_serializing_if = "Option::is_none")] + pub purge_runs: Option<RetentionSetting>, + #[doc = "Contains the minimum, maximum, and current value for a retention setting."] + #[serde( + rename = "retainRunsPerProtectedBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub retain_runs_per_protected_branch: Option<RetentionSetting>, } impl ProjectRetentionSetting { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PropertiesCollection { - #[doc = "The count of properties in the collection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<serde_json::Value>, - #[doc = "The set of keys in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub keys: Vec<String>, - #[doc = "The set of values in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<String>, + #[doc = "The count of properties in the collection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<serde_json::Value>, + #[doc = "The set of keys in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub keys: Vec<String>, + #[doc = "The set of values in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<String>, } impl PropertiesCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a pull request object. These are retrieved from Source Providers."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PullRequest { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<IdentityRef>, - #[doc = "Current state of the pull request, e.g. open, merged, closed, conflicts, etc."] - #[serde( - rename = "currentState", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_state: Option<String>, - #[doc = "Description for the pull request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Returns if pull request is draft"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub draft: Option<bool>, - #[doc = "Unique identifier for the pull request"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The name of the provider this pull request is associated with."] - #[serde( - rename = "providerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub provider_name: Option<String>, - #[doc = "Source branch ref of this pull request"] - #[serde( - rename = "sourceBranchRef", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_branch_ref: Option<String>, - #[doc = "Owner of the source repository of this pull request"] - #[serde( - rename = "sourceRepositoryOwner", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_repository_owner: Option<String>, - #[doc = "Target branch ref of this pull request"] - #[serde( - rename = "targetBranchRef", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_branch_ref: Option<String>, - #[doc = "Owner of the target repository of this pull request"] - #[serde( - rename = "targetRepositoryOwner", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_repository_owner: Option<String>, - #[doc = "Title of the pull request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<IdentityRef>, + #[doc = "Current state of the pull request, e.g. open, merged, closed, conflicts, etc."] + #[serde( + rename = "currentState", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_state: Option<String>, + #[doc = "Description for the pull request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Returns if pull request is draft"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub draft: Option<bool>, + #[doc = "Unique identifier for the pull request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The name of the provider this pull request is associated with."] + #[serde( + rename = "providerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub provider_name: Option<String>, + #[doc = "Source branch ref of this pull request"] + #[serde( + rename = "sourceBranchRef", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_branch_ref: Option<String>, + #[doc = "Owner of the source repository of this pull request"] + #[serde( + rename = "sourceRepositoryOwner", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_repository_owner: Option<String>, + #[doc = "Target branch ref of this pull request"] + #[serde( + rename = "targetBranchRef", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_branch_ref: Option<String>, + #[doc = "Owner of the target repository of this pull request"] + #[serde( + rename = "targetRepositoryOwner", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_repository_owner: Option<String>, + #[doc = "Title of the pull request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, } impl PullRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a pull request trigger."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PullRequestTrigger { - #[serde(flatten)] - pub build_trigger: BuildTrigger, - #[doc = "Indicates if an update to a PR should delete current in-progress builds."] - #[serde( - rename = "autoCancel", - default, - skip_serializing_if = "Option::is_none" - )] - pub auto_cancel: Option<bool>, - #[serde( - rename = "branchFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub branch_filters: Vec<String>, - #[doc = "Represents the ability to build forks of the selected repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub forks: Option<Forks>, - #[serde( - rename = "isCommentRequiredForPullRequest", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_comment_required_for_pull_request: Option<bool>, - #[serde( - rename = "pathFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub path_filters: Vec<String>, - #[serde( - rename = "requireCommentsForNonTeamMemberAndNonContributors", - default, - skip_serializing_if = "Option::is_none" - )] - pub require_comments_for_non_team_member_and_non_contributors: Option<bool>, - #[serde( - rename = "requireCommentsForNonTeamMembersOnly", - default, - skip_serializing_if = "Option::is_none" - )] - pub require_comments_for_non_team_members_only: Option<bool>, - #[serde( - rename = "settingsSourceType", - default, - skip_serializing_if = "Option::is_none" - )] - pub settings_source_type: Option<i32>, + #[serde(flatten)] + pub build_trigger: BuildTrigger, + #[doc = "Indicates if an update to a PR should delete current in-progress builds."] + #[serde( + rename = "autoCancel", + default, + skip_serializing_if = "Option::is_none" + )] + pub auto_cancel: Option<bool>, + #[serde( + rename = "branchFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub branch_filters: Vec<String>, + #[doc = "Represents the ability to build forks of the selected repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub forks: Option<Forks>, + #[serde( + rename = "isCommentRequiredForPullRequest", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_comment_required_for_pull_request: Option<bool>, + #[serde( + rename = "pathFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub path_filters: Vec<String>, + #[serde( + rename = "requireCommentsForNonTeamMemberAndNonContributors", + default, + skip_serializing_if = "Option::is_none" + )] + pub require_comments_for_non_team_member_and_non_contributors: Option<bool>, + #[serde( + rename = "requireCommentsForNonTeamMembersOnly", + default, + skip_serializing_if = "Option::is_none" + )] + pub require_comments_for_non_team_members_only: Option<bool>, + #[serde( + rename = "settingsSourceType", + default, + skip_serializing_if = "Option::is_none" + )] + pub settings_source_type: Option<i32>, } impl PullRequestTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RealtimeBuildEvent { - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option<i32>, + #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] + pub build_id: Option<i32>, } impl RealtimeBuildEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "Link URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub badge: Option<Link>, - #[doc = "Link URL"] - #[serde(rename = "self", default, skip_serializing_if = "Option::is_none")] - pub self_: Option<Link>, - #[doc = "Link URL"] - #[serde( - rename = "sourceVersionDisplayUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_version_display_uri: Option<Link>, - #[doc = "Link URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeline: Option<Link>, - #[doc = "Link URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub web: Option<Link>, + #[doc = "Link URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub badge: Option<Link>, + #[doc = "Link URL"] + #[serde(rename = "self", default, skip_serializing_if = "Option::is_none")] + pub self_: Option<Link>, + #[doc = "Link URL"] + #[serde( + rename = "sourceVersionDisplayUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_version_display_uri: Option<Link>, + #[doc = "Link URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeline: Option<Link>, + #[doc = "Link URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub web: Option<Link>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to a release."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseReference { - #[doc = "Number of Release Attempt."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Release Creation Date(UTC)."] - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[doc = "Release definition ID."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "Environment creation Date(UTC)."] - #[serde( - rename = "environmentCreationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub environment_creation_date: Option<time::OffsetDateTime>, - #[doc = "Release environment definition ID."] - #[serde( - rename = "environmentDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_definition_id: Option<i32>, - #[doc = "Release environment definition name."] - #[serde( - rename = "environmentDefinitionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_definition_name: Option<String>, - #[doc = "Release environment ID."] - #[serde( - rename = "environmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_id: Option<i32>, - #[doc = "Release environment name."] - #[serde( - rename = "environmentName", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_name: Option<String>, - #[doc = "Release ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Release name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Number of Release Attempt."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Release Creation Date(UTC)."] + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[doc = "Release definition ID."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "Environment creation Date(UTC)."] + #[serde( + rename = "environmentCreationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub environment_creation_date: Option<time::OffsetDateTime>, + #[doc = "Release environment definition ID."] + #[serde( + rename = "environmentDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_definition_id: Option<i32>, + #[doc = "Release environment definition name."] + #[serde( + rename = "environmentDefinitionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_definition_name: Option<String>, + #[doc = "Release environment ID."] + #[serde( + rename = "environmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_id: Option<i32>, + #[doc = "Release environment name."] + #[serde( + rename = "environmentName", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_name: Option<String>, + #[doc = "Release ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Release name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ReleaseReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a repository's webhook returned from a source provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RepositoryWebhook { - #[doc = "The friendly name of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub types: Vec<serde_json::Value>, - #[doc = "The URL of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The friendly name of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub types: Vec<serde_json::Value>, + #[doc = "The URL of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl RepositoryWebhook { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RepositoryWebhookList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<RepositoryWebhook>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<RepositoryWebhook>, } impl RepositoryWebhookList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceRef { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ResourceRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceRefList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ResourceRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ResourceRef>, } impl ResourceRefList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to a resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceReference { - #[doc = "An alias to be used when referencing the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub alias: Option<String>, + #[doc = "An alias to be used when referencing the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, } impl ResourceReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A valid retention lease prevents automated systems from deleting a pipeline run."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetentionLease { - #[doc = "When the lease was created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "The pipeline definition of the run."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "The unique identifier for this lease."] - #[serde(rename = "leaseId", default, skip_serializing_if = "Option::is_none")] - pub lease_id: Option<i32>, - #[doc = "Non-unique string that identifies the owner of a retention lease."] - #[serde(rename = "ownerId", default, skip_serializing_if = "Option::is_none")] - pub owner_id: Option<String>, - #[doc = "If set, this lease will also prevent the pipeline from being deleted while the lease is still valid."] - #[serde( - rename = "protectPipeline", - default, - skip_serializing_if = "Option::is_none" - )] - pub protect_pipeline: Option<bool>, - #[doc = "The pipeline run protected by this lease."] - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option<i32>, - #[doc = "The last day the lease is considered valid."] - #[serde( - rename = "validUntil", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub valid_until: Option<time::OffsetDateTime>, + #[doc = "When the lease was created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "The pipeline definition of the run."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "The unique identifier for this lease."] + #[serde(rename = "leaseId", default, skip_serializing_if = "Option::is_none")] + pub lease_id: Option<i32>, + #[doc = "Non-unique string that identifies the owner of a retention lease."] + #[serde(rename = "ownerId", default, skip_serializing_if = "Option::is_none")] + pub owner_id: Option<String>, + #[doc = "If set, this lease will also prevent the pipeline from being deleted while the lease is still valid."] + #[serde( + rename = "protectPipeline", + default, + skip_serializing_if = "Option::is_none" + )] + pub protect_pipeline: Option<bool>, + #[doc = "The pipeline run protected by this lease."] + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option<i32>, + #[doc = "The last day the lease is considered valid."] + #[serde( + rename = "validUntil", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub valid_until: Option<time::OffsetDateTime>, } impl RetentionLease { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetentionLeaseList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<RetentionLease>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<RetentionLease>, } impl RetentionLeaseList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An update to the retention parameters of a retention lease."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetentionLeaseUpdate { - #[doc = "The number of days to consider the lease valid. A retention lease valid for more than 100 years (36500 days) will display as retaining the build \"forever\"."] - #[serde(rename = "daysValid", default, skip_serializing_if = "Option::is_none")] - pub days_valid: Option<i32>, - #[doc = "If set, this lease will also prevent the pipeline from being deleted while the lease is still valid."] - #[serde( - rename = "protectPipeline", - default, - skip_serializing_if = "Option::is_none" - )] - pub protect_pipeline: Option<bool>, + #[doc = "The number of days to consider the lease valid. A retention lease valid for more than 100 years (36500 days) will display as retaining the build \"forever\"."] + #[serde(rename = "daysValid", default, skip_serializing_if = "Option::is_none")] + pub days_valid: Option<i32>, + #[doc = "If set, this lease will also prevent the pipeline from being deleted while the lease is still valid."] + #[serde( + rename = "protectPipeline", + default, + skip_serializing_if = "Option::is_none" + )] + pub protect_pipeline: Option<bool>, } impl RetentionLeaseUpdate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a retention policy for a build definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetentionPolicy { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub artifacts: Vec<String>, - #[serde( - rename = "artifactTypesToDelete", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub artifact_types_to_delete: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub branches: Vec<String>, - #[doc = "The number of days to keep builds."] - #[serde( - rename = "daysToKeep", - default, - skip_serializing_if = "Option::is_none" - )] - pub days_to_keep: Option<i32>, - #[doc = "Indicates whether the build record itself should be deleted."] - #[serde( - rename = "deleteBuildRecord", - default, - skip_serializing_if = "Option::is_none" - )] - pub delete_build_record: Option<bool>, - #[doc = "Indicates whether to delete test results associated with the build."] - #[serde( - rename = "deleteTestResults", - default, - skip_serializing_if = "Option::is_none" - )] - pub delete_test_results: Option<bool>, - #[doc = "The minimum number of builds to keep."] - #[serde( - rename = "minimumToKeep", - default, - skip_serializing_if = "Option::is_none" - )] - pub minimum_to_keep: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub artifacts: Vec<String>, + #[serde( + rename = "artifactTypesToDelete", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub artifact_types_to_delete: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub branches: Vec<String>, + #[doc = "The number of days to keep builds."] + #[serde( + rename = "daysToKeep", + default, + skip_serializing_if = "Option::is_none" + )] + pub days_to_keep: Option<i32>, + #[doc = "Indicates whether the build record itself should be deleted."] + #[serde( + rename = "deleteBuildRecord", + default, + skip_serializing_if = "Option::is_none" + )] + pub delete_build_record: Option<bool>, + #[doc = "Indicates whether to delete test results associated with the build."] + #[serde( + rename = "deleteTestResults", + default, + skip_serializing_if = "Option::is_none" + )] + pub delete_test_results: Option<bool>, + #[doc = "The minimum number of builds to keep."] + #[serde( + rename = "minimumToKeep", + default, + skip_serializing_if = "Option::is_none" + )] + pub minimum_to_keep: Option<i32>, } impl RetentionPolicy { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contains the minimum, maximum, and current value for a retention setting."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetentionSetting { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub max: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub min: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub min: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<i32>, } impl RetentionSetting { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Schedule { - #[serde( - rename = "branchFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub branch_filters: Vec<String>, - #[doc = "Days for a build (flags enum for days of the week)"] - #[serde( - rename = "daysToBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub days_to_build: Option<schedule::DaysToBuild>, - #[doc = "The Job Id of the Scheduled job that will queue the scheduled build. Since a single trigger can have multiple schedules and we want a single job to process a single schedule (since each schedule has a list of branches to build), the schedule itself needs to define the Job Id. This value will be filled in when a definition is added or updated. The UI does not provide it or use it."] - #[serde( - rename = "scheduleJobId", - default, - skip_serializing_if = "Option::is_none" - )] - pub schedule_job_id: Option<String>, - #[doc = "Flag to determine if this schedule should only build if the associated source has been changed."] - #[serde( - rename = "scheduleOnlyWithChanges", - default, - skip_serializing_if = "Option::is_none" - )] - pub schedule_only_with_changes: Option<bool>, - #[doc = "Local timezone hour to start"] - #[serde( - rename = "startHours", - default, - skip_serializing_if = "Option::is_none" - )] - pub start_hours: Option<i32>, - #[doc = "Local timezone minute to start"] - #[serde( - rename = "startMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub start_minutes: Option<i32>, - #[doc = "Time zone of the build schedule (String representation of the time zone ID)"] - #[serde( - rename = "timeZoneId", - default, - skip_serializing_if = "Option::is_none" - )] - pub time_zone_id: Option<String>, + #[serde( + rename = "branchFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub branch_filters: Vec<String>, + #[doc = "Days for a build (flags enum for days of the week)"] + #[serde( + rename = "daysToBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub days_to_build: Option<schedule::DaysToBuild>, + #[doc = "The Job Id of the Scheduled job that will queue the scheduled build. Since a single trigger can have multiple schedules and we want a single job to process a single schedule (since each schedule has a list of branches to build), the schedule itself needs to define the Job Id. This value will be filled in when a definition is added or updated. The UI does not provide it or use it."] + #[serde( + rename = "scheduleJobId", + default, + skip_serializing_if = "Option::is_none" + )] + pub schedule_job_id: Option<String>, + #[doc = "Flag to determine if this schedule should only build if the associated source has been changed."] + #[serde( + rename = "scheduleOnlyWithChanges", + default, + skip_serializing_if = "Option::is_none" + )] + pub schedule_only_with_changes: Option<bool>, + #[doc = "Local timezone hour to start"] + #[serde( + rename = "startHours", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_hours: Option<i32>, + #[doc = "Local timezone minute to start"] + #[serde( + rename = "startMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_minutes: Option<i32>, + #[doc = "Time zone of the build schedule (String representation of the time zone ID)"] + #[serde( + rename = "timeZoneId", + default, + skip_serializing_if = "Option::is_none" + )] + pub time_zone_id: Option<String>, } impl Schedule { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod schedule { - use super::*; - #[doc = "Days for a build (flags enum for days of the week)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DaysToBuild { - #[serde(rename = "none")] - None, - #[serde(rename = "monday")] - Monday, - #[serde(rename = "tuesday")] - Tuesday, - #[serde(rename = "wednesday")] - Wednesday, - #[serde(rename = "thursday")] - Thursday, - #[serde(rename = "friday")] - Friday, - #[serde(rename = "saturday")] - Saturday, - #[serde(rename = "sunday")] - Sunday, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "Days for a build (flags enum for days of the week)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DaysToBuild { + #[serde(rename = "none")] + None, + #[serde(rename = "monday")] + Monday, + #[serde(rename = "tuesday")] + Tuesday, + #[serde(rename = "wednesday")] + Wednesday, + #[serde(rename = "thursday")] + Thursday, + #[serde(rename = "friday")] + Friday, + #[serde(rename = "saturday")] + Saturday, + #[serde(rename = "sunday")] + Sunday, + #[serde(rename = "all")] + All, + } } #[doc = "Represents a schedule trigger."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ScheduleTrigger { - #[serde(flatten)] - pub build_trigger: BuildTrigger, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub schedules: Vec<Schedule>, + #[serde(flatten)] + pub build_trigger: BuildTrigger, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub schedules: Vec<Schedule>, } impl ScheduleTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to a secure file."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecureFileReference { - #[serde(flatten)] - pub resource_reference: ResourceReference, - #[doc = "The ID of the secure file."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[serde(flatten)] + pub resource_reference: ResourceReference, + #[doc = "The ID of the secure file."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl SecureFileReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a phase target that runs on the server."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServerTarget { - #[serde(flatten)] - pub phase_target: PhaseTarget, - #[doc = "Represents options for running a phase on the server."] - #[serde( - rename = "executionOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub execution_options: Option<ServerTargetExecutionOptions>, + #[serde(flatten)] + pub phase_target: PhaseTarget, + #[doc = "Represents options for running a phase on the server."] + #[serde( + rename = "executionOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub execution_options: Option<ServerTargetExecutionOptions>, } impl ServerTarget { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents options for running a phase on the server."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServerTargetExecutionOptions { - #[doc = "The type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<i32>, + #[doc = "The type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<i32>, } impl ServerTargetExecutionOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a referenec to a service endpoint."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointReference { - #[serde(flatten)] - pub resource_reference: ResourceReference, - #[doc = "The ID of the service endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[serde(flatten)] + pub resource_reference: ResourceReference, + #[doc = "The ID of the service endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl ServiceEndpointReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceProviderAttributes { - #[doc = "The name of the source provider."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The capabilities supported by this source provider."] - #[serde( - rename = "supportedCapabilities", - default, - skip_serializing_if = "Option::is_none" - )] - pub supported_capabilities: Option<serde_json::Value>, - #[doc = "The types of triggers supported by this source provider."] - #[serde( - rename = "supportedTriggers", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub supported_triggers: Vec<SupportedTrigger>, + #[doc = "The name of the source provider."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The capabilities supported by this source provider."] + #[serde( + rename = "supportedCapabilities", + default, + skip_serializing_if = "Option::is_none" + )] + pub supported_capabilities: Option<serde_json::Value>, + #[doc = "The types of triggers supported by this source provider."] + #[serde( + rename = "supportedTriggers", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub supported_triggers: Vec<SupportedTrigger>, } impl SourceProviderAttributes { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceProviderAttributesList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<SourceProviderAttributes>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<SourceProviderAttributes>, } impl SourceProviderAttributesList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a work item related to some source item. These are retrieved from Source Providers."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceRelatedWorkItem { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = ""] - #[serde( - rename = "assignedTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_to: Option<IdentityRef>, - #[doc = "Current state of the work item, e.g. Active, Resolved, Closed, etc."] - #[serde( - rename = "currentState", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_state: Option<String>, - #[doc = "Long description for the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Unique identifier for the work item"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The name of the provider the work item is associated with."] - #[serde( - rename = "providerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub provider_name: Option<String>, - #[doc = "Short name for the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[doc = "Type of work item, e.g. Bug, Task, User Story, etc."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = ""] + #[serde( + rename = "assignedTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_to: Option<IdentityRef>, + #[doc = "Current state of the work item, e.g. Active, Resolved, Closed, etc."] + #[serde( + rename = "currentState", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_state: Option<String>, + #[doc = "Long description for the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Unique identifier for the work item"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The name of the provider the work item is associated with."] + #[serde( + rename = "providerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub provider_name: Option<String>, + #[doc = "Short name for the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[doc = "Type of work item, e.g. Bug, Task, User Story, etc."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl SourceRelatedWorkItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A set of repositories returned from the source provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceRepositories { - #[doc = "A token used to continue this paged request; 'null' if the request is complete"] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[doc = "The number of repositories requested for each page"] - #[serde( - rename = "pageLength", - default, - skip_serializing_if = "Option::is_none" - )] - pub page_length: Option<i32>, - #[doc = "A list of repositories"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub repositories: Vec<SourceRepository>, - #[doc = "The total number of pages, or '-1' if unknown"] - #[serde( - rename = "totalPageCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_page_count: Option<i32>, + #[doc = "A token used to continue this paged request; 'null' if the request is complete"] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[doc = "The number of repositories requested for each page"] + #[serde( + rename = "pageLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub page_length: Option<i32>, + #[doc = "A list of repositories"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub repositories: Vec<SourceRepository>, + #[doc = "The total number of pages, or '-1' if unknown"] + #[serde( + rename = "totalPageCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_page_count: Option<i32>, } impl SourceRepositories { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a repository returned from a source provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceRepository { - #[doc = "The name of the default branch."] - #[serde( - rename = "defaultBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_branch: Option<String>, - #[doc = "The full name of the repository."] - #[serde(rename = "fullName", default, skip_serializing_if = "Option::is_none")] - pub full_name: Option<String>, - #[doc = "The ID of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The friendly name of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "The name of the source provider the repository is from."] - #[serde( - rename = "sourceProviderName", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_provider_name: Option<String>, - #[doc = "The URL of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The name of the default branch."] + #[serde( + rename = "defaultBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_branch: Option<String>, + #[doc = "The full name of the repository."] + #[serde(rename = "fullName", default, skip_serializing_if = "Option::is_none")] + pub full_name: Option<String>, + #[doc = "The ID of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The friendly name of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "The name of the source provider the repository is from."] + #[serde( + rename = "sourceProviderName", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_provider_name: Option<String>, + #[doc = "The URL of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl SourceRepository { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an item in a repository from a source provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceRepositoryItem { - #[doc = "Whether the item is able to have sub-items (e.g., is a folder)."] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[doc = "The full path of the item, relative to the root of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "The type of the item (folder, file, etc)."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "The URL of the item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Whether the item is able to have sub-items (e.g., is a folder)."] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[doc = "The full path of the item, relative to the root of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "The type of the item (folder, file, etc)."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "The URL of the item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl SourceRepositoryItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceRepositoryItemList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<SourceRepositoryItem>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<SourceRepositoryItem>, } impl SourceRepositoryItemList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Stage in pipeline"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StageReference { - #[doc = "Attempt number of stage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Name of the stage. Maximum supported length for name is 256 character."] - #[serde(rename = "stageName", default, skip_serializing_if = "Option::is_none")] - pub stage_name: Option<String>, + #[doc = "Attempt number of stage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Name of the stage. Maximum supported length for name is 256 character."] + #[serde(rename = "stageName", default, skip_serializing_if = "Option::is_none")] + pub stage_name: Option<String>, } impl StageReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SupportedTrigger { - #[doc = "The default interval to wait between polls (only relevant when NotificationType is Polling)."] - #[serde( - rename = "defaultPollingInterval", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_polling_interval: Option<i32>, - #[doc = "How the trigger is notified of changes."] - #[serde( - rename = "notificationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub notification_type: Option<String>, - #[doc = "The capabilities supported by this trigger."] - #[serde( - rename = "supportedCapabilities", - default, - skip_serializing_if = "Option::is_none" - )] - pub supported_capabilities: Option<serde_json::Value>, - #[doc = "The type of trigger."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<supported_trigger::Type>, + #[doc = "The default interval to wait between polls (only relevant when NotificationType is Polling)."] + #[serde( + rename = "defaultPollingInterval", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_polling_interval: Option<i32>, + #[doc = "How the trigger is notified of changes."] + #[serde( + rename = "notificationType", + default, + skip_serializing_if = "Option::is_none" + )] + pub notification_type: Option<String>, + #[doc = "The capabilities supported by this trigger."] + #[serde( + rename = "supportedCapabilities", + default, + skip_serializing_if = "Option::is_none" + )] + pub supported_capabilities: Option<serde_json::Value>, + #[doc = "The type of trigger."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<supported_trigger::Type>, } impl SupportedTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod supported_trigger { - use super::*; - #[doc = "The type of trigger."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "none")] - None, - #[serde(rename = "continuousIntegration")] - ContinuousIntegration, - #[serde(rename = "batchedContinuousIntegration")] - BatchedContinuousIntegration, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "gatedCheckIn")] - GatedCheckIn, - #[serde(rename = "batchedGatedCheckIn")] - BatchedGatedCheckIn, - #[serde(rename = "pullRequest")] - PullRequest, - #[serde(rename = "buildCompletion")] - BuildCompletion, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "The type of trigger."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "none")] + None, + #[serde(rename = "continuousIntegration")] + ContinuousIntegration, + #[serde(rename = "batchedContinuousIntegration")] + BatchedContinuousIntegration, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "gatedCheckIn")] + GatedCheckIn, + #[serde(rename = "batchedGatedCheckIn")] + BatchedGatedCheckIn, + #[serde(rename = "pullRequest")] + PullRequest, + #[serde(rename = "buildCompletion")] + BuildCompletion, + #[serde(rename = "all")] + All, + } } #[doc = "Represents a Subversion mapping entry."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SvnMappingDetails { - #[doc = "The depth."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub depth: Option<i32>, - #[doc = "Indicates whether to ignore externals."] - #[serde( - rename = "ignoreExternals", - default, - skip_serializing_if = "Option::is_none" - )] - pub ignore_externals: Option<bool>, - #[doc = "The local path."] - #[serde(rename = "localPath", default, skip_serializing_if = "Option::is_none")] - pub local_path: Option<String>, - #[doc = "The revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<String>, - #[doc = "The server path."] - #[serde( - rename = "serverPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub server_path: Option<String>, + #[doc = "The depth."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub depth: Option<i32>, + #[doc = "Indicates whether to ignore externals."] + #[serde( + rename = "ignoreExternals", + default, + skip_serializing_if = "Option::is_none" + )] + pub ignore_externals: Option<bool>, + #[doc = "The local path."] + #[serde(rename = "localPath", default, skip_serializing_if = "Option::is_none")] + pub local_path: Option<String>, + #[doc = "The revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<String>, + #[doc = "The server path."] + #[serde( + rename = "serverPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub server_path: Option<String>, } impl SvnMappingDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a subversion workspace."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SvnWorkspace { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mappings: Vec<SvnMappingDetails>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mappings: Vec<SvnMappingDetails>, } impl SvnWorkspace { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to an agent pool."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TaskAgentPoolReference { - #[doc = "The pool ID."] - pub id: i32, - #[doc = "A value indicating whether or not this pool is managed by the service."] - #[serde(rename = "isHosted", default, skip_serializing_if = "Option::is_none")] - pub is_hosted: Option<bool>, - #[doc = "The pool name."] - pub name: String, + #[doc = "The pool ID."] + pub id: i32, + #[doc = "A value indicating whether or not this pool is managed by the service."] + #[serde(rename = "isHosted", default, skip_serializing_if = "Option::is_none")] + pub is_hosted: Option<bool>, + #[doc = "The pool name."] + pub name: String, } impl TaskAgentPoolReference { - pub fn new(id: i32, name: String) -> Self { - Self { - id, - is_hosted: None, - name, - } + pub fn new(id: i32, name: String) -> Self { + Self { + id, + is_hosted: None, + name, } + } } #[doc = "A reference to a task definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskDefinitionReference { - #[doc = "The type of task (task or task group)."] - #[serde( - rename = "definitionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_type: Option<String>, - #[doc = "The ID of the task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The version of the task."] - #[serde( - rename = "versionSpec", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_spec: Option<String>, + #[doc = "The type of task (task or task group)."] + #[serde( + rename = "definitionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_type: Option<String>, + #[doc = "The ID of the task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The version of the task."] + #[serde( + rename = "versionSpec", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_spec: Option<String>, } impl TaskDefinitionReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskInputDefinitionBase { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub aliases: Vec<String>, - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<String>, - #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] - pub group_name: Option<String>, - #[serde( - rename = "helpMarkDown", - default, - skip_serializing_if = "Option::is_none" - )] - pub help_mark_down: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub label: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub options: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub required: Option<bool>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub validation: Option<TaskInputValidation>, - #[serde( - rename = "visibleRule", - default, - skip_serializing_if = "Option::is_none" - )] - pub visible_rule: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub aliases: Vec<String>, + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<String>, + #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] + pub group_name: Option<String>, + #[serde( + rename = "helpMarkDown", + default, + skip_serializing_if = "Option::is_none" + )] + pub help_mark_down: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub options: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub required: Option<bool>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub validation: Option<TaskInputValidation>, + #[serde( + rename = "visibleRule", + default, + skip_serializing_if = "Option::is_none" + )] + pub visible_rule: Option<String>, } impl TaskInputDefinitionBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskInputValidation { - #[doc = "Conditional expression"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub expression: Option<String>, - #[doc = "Message explaining how user can correct if validation fails"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, + #[doc = "Conditional expression"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub expression: Option<String>, + #[doc = "Message explaining how user can correct if validation fails"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, } impl TaskInputValidation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to a plan group."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationPlanGroupReference { - #[doc = "The name of the plan group."] - #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] - pub plan_group: Option<String>, - #[doc = "The project ID."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, + #[doc = "The name of the plan group."] + #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] + pub plan_group: Option<String>, + #[doc = "The project ID."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, } impl TaskOrchestrationPlanGroupReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationPlanGroupsStartedEvent { - #[serde( - rename = "planGroups", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub plan_groups: Vec<TaskOrchestrationPlanGroupReference>, + #[serde( + rename = "planGroups", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub plan_groups: Vec<TaskOrchestrationPlanGroupReference>, } impl TaskOrchestrationPlanGroupsStartedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to an orchestration plan."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TaskOrchestrationPlanReference { - #[doc = "The type of the plan."] - #[serde( - rename = "orchestrationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub orchestration_type: Option<i32>, - #[doc = "The ID of the plan."] - #[serde(rename = "planId")] - pub plan_id: String, + #[doc = "The type of the plan."] + #[serde( + rename = "orchestrationType", + default, + skip_serializing_if = "Option::is_none" + )] + pub orchestration_type: Option<i32>, + #[doc = "The ID of the plan."] + #[serde(rename = "planId")] + pub plan_id: String, } impl TaskOrchestrationPlanReference { - pub fn new(plan_id: String) -> Self { - Self { - orchestration_type: None, - plan_id, - } + pub fn new(plan_id: String) -> Self { + Self { + orchestration_type: None, + plan_id, } + } } #[doc = "Represents a reference to a task."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskReference { - #[doc = "The ID of the task definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The name of the task definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The version of the task definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "The ID of the task definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The name of the task definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The version of the task definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl TaskReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskSourceDefinitionBase { - #[serde(rename = "authKey", default, skip_serializing_if = "Option::is_none")] - pub auth_key: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option<String>, - #[serde( - rename = "keySelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub key_selector: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub selector: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<String>, + #[serde(rename = "authKey", default, skip_serializing_if = "Option::is_none")] + pub auth_key: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub endpoint: Option<String>, + #[serde( + rename = "keySelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub key_selector: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub selector: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<String>, } impl TaskSourceDefinitionBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a shallow reference to a TeamProject."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TeamProjectReference { - #[doc = "Project abbreviation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub abbreviation: Option<String>, - #[doc = "Url to default team identity image."] - #[serde( - rename = "defaultTeamImageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_team_image_url: Option<String>, - #[doc = "The project's description (if any)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Project identifier."] - pub id: String, - #[doc = "Project last update time."] - #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] - pub last_update_time: time::OffsetDateTime, - #[doc = "Project name."] - pub name: String, - #[doc = "Project revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, - #[doc = "Project state."] - pub state: team_project_reference::State, - #[doc = "Url to the full version of the object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Project visibility."] - pub visibility: team_project_reference::Visibility, + #[doc = "Project abbreviation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub abbreviation: Option<String>, + #[doc = "Url to default team identity image."] + #[serde( + rename = "defaultTeamImageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_team_image_url: Option<String>, + #[doc = "The project's description (if any)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Project identifier."] + pub id: String, + #[doc = "Project last update time."] + #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] + pub last_update_time: time::OffsetDateTime, + #[doc = "Project name."] + pub name: String, + #[doc = "Project revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i64>, + #[doc = "Project state."] + pub state: team_project_reference::State, + #[doc = "Url to the full version of the object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Project visibility."] + pub visibility: team_project_reference::Visibility, } impl TeamProjectReference { - pub fn new( - id: String, - last_update_time: time::OffsetDateTime, - name: String, - state: team_project_reference::State, - visibility: team_project_reference::Visibility, - ) -> Self { - Self { - abbreviation: None, - default_team_image_url: None, - description: None, - id, - last_update_time, - name, - revision: None, - state, - url: None, - visibility, - } - } + pub fn new( + id: String, + last_update_time: time::OffsetDateTime, + name: String, + state: team_project_reference::State, + visibility: team_project_reference::Visibility, + ) -> Self { + Self { + abbreviation: None, + default_team_image_url: None, + description: None, + id, + last_update_time, + name, + revision: None, + state, + url: None, + visibility, + } + } } pub mod team_project_reference { - use super::*; - #[doc = "Project state."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "deleting")] - Deleting, - #[serde(rename = "new")] - New, - #[serde(rename = "wellFormed")] - WellFormed, - #[serde(rename = "createPending")] - CreatePending, - #[serde(rename = "all")] - All, - #[serde(rename = "unchanged")] - Unchanged, - #[serde(rename = "deleted")] - Deleted, - } - #[doc = "Project visibility."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Visibility { - #[serde(rename = "private")] - Private, - #[serde(rename = "public")] - Public, - #[serde(rename = "organization")] - Organization, - #[serde(rename = "unchanged")] - Unchanged, - } + use super::*; + #[doc = "Project state."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "deleting")] + Deleting, + #[serde(rename = "new")] + New, + #[serde(rename = "wellFormed")] + WellFormed, + #[serde(rename = "createPending")] + CreatePending, + #[serde(rename = "all")] + All, + #[serde(rename = "unchanged")] + Unchanged, + #[serde(rename = "deleted")] + Deleted, + } + #[doc = "Project visibility."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Visibility { + #[serde(rename = "private")] + Private, + #[serde(rename = "public")] + Public, + #[serde(rename = "organization")] + Organization, + #[serde(rename = "unchanged")] + Unchanged, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsContext { - #[doc = "Represents a reference to a build."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<BuildReference>, - #[serde( - rename = "contextType", - default, - skip_serializing_if = "Option::is_none" - )] - pub context_type: Option<test_results_context::ContextType>, - #[doc = "Pipeline reference"] - #[serde( - rename = "pipelineReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub pipeline_reference: Option<PipelineReference>, - #[doc = "Reference to a release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ReleaseReference>, + #[doc = "Represents a reference to a build."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<BuildReference>, + #[serde( + rename = "contextType", + default, + skip_serializing_if = "Option::is_none" + )] + pub context_type: Option<test_results_context::ContextType>, + #[doc = "Pipeline reference"] + #[serde( + rename = "pipelineReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub pipeline_reference: Option<PipelineReference>, + #[doc = "Reference to a release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ReleaseReference>, } impl TestResultsContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_results_context { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ContextType { - #[serde(rename = "build")] - Build, - #[serde(rename = "release")] - Release, - #[serde(rename = "pipeline")] - Pipeline, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ContextType { + #[serde(rename = "build")] + Build, + #[serde(rename = "release")] + Release, + #[serde(rename = "pipeline")] + Pipeline, + } } #[doc = "Represents the timeline of a build."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Timeline { - #[serde(flatten)] - pub timeline_reference: TimelineReference, - #[doc = "The process or person that last changed the timeline."] - #[serde( - rename = "lastChangedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_changed_by: Option<String>, - #[doc = "The time the timeline was last changed."] - #[serde( - rename = "lastChangedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_changed_on: Option<time::OffsetDateTime>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub records: Vec<TimelineRecord>, + #[serde(flatten)] + pub timeline_reference: TimelineReference, + #[doc = "The process or person that last changed the timeline."] + #[serde( + rename = "lastChangedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_changed_by: Option<String>, + #[doc = "The time the timeline was last changed."] + #[serde( + rename = "lastChangedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_changed_on: Option<time::OffsetDateTime>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub records: Vec<TimelineRecord>, } impl Timeline { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineAttempt { - #[doc = "Gets or sets the attempt of the record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Gets or sets the record identifier located within the specified timeline."] - #[serde(rename = "recordId", default, skip_serializing_if = "Option::is_none")] - pub record_id: Option<String>, - #[doc = "Gets or sets the timeline identifier which owns the record representing this attempt."] - #[serde( - rename = "timelineId", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeline_id: Option<String>, + #[doc = "Gets or sets the attempt of the record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Gets or sets the record identifier located within the specified timeline."] + #[serde(rename = "recordId", default, skip_serializing_if = "Option::is_none")] + pub record_id: Option<String>, + #[doc = "Gets or sets the timeline identifier which owns the record representing this attempt."] + #[serde( + rename = "timelineId", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeline_id: Option<String>, } impl TimelineAttempt { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an entry in a build's timeline."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineRecord { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "Attempt number of record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "The change ID."] - #[serde(rename = "changeId", default, skip_serializing_if = "Option::is_none")] - pub change_id: Option<i32>, - #[doc = "A string that indicates the current operation."] - #[serde( - rename = "currentOperation", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_operation: Option<String>, - #[doc = "Represents a reference to a timeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub details: Option<TimelineReference>, - #[doc = "The number of errors produced by this operation."] - #[serde( - rename = "errorCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_count: Option<i32>, - #[doc = "The finish time."] - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = "The ID of the record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "String identifier that is consistent across attempts."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub issues: Vec<Issue>, - #[doc = "The time the record was last modified."] - #[serde( - rename = "lastModified", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified: Option<time::OffsetDateTime>, - #[doc = "Represents a reference to a build log."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub log: Option<BuildLogReference>, - #[doc = "The name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "An ordinal value relative to other records."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, - #[doc = "The ID of the record's parent."] - #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option<String>, - #[doc = "The current completion percentage."] - #[serde( - rename = "percentComplete", - default, - skip_serializing_if = "Option::is_none" - )] - pub percent_complete: Option<i32>, - #[serde( - rename = "previousAttempts", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub previous_attempts: Vec<TimelineAttempt>, - #[doc = "The queue ID of the queue that the operation ran on."] - #[serde(rename = "queueId", default, skip_serializing_if = "Option::is_none")] - pub queue_id: Option<i32>, - #[doc = "The result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<timeline_record::Result>, - #[doc = "The result code."] - #[serde( - rename = "resultCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_code: Option<String>, - #[doc = "The start time."] - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, - #[doc = "The state of the record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<timeline_record::State>, - #[doc = "Represents a reference to a task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub task: Option<TaskReference>, - #[doc = "The type of the record."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "The REST URL of the timeline record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "The number of warnings produced by this operation."] - #[serde( - rename = "warningCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub warning_count: Option<i32>, - #[doc = "The name of the agent running the operation."] - #[serde( - rename = "workerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub worker_name: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "Attempt number of record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "The change ID."] + #[serde(rename = "changeId", default, skip_serializing_if = "Option::is_none")] + pub change_id: Option<i32>, + #[doc = "A string that indicates the current operation."] + #[serde( + rename = "currentOperation", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_operation: Option<String>, + #[doc = "Represents a reference to a timeline."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub details: Option<TimelineReference>, + #[doc = "The number of errors produced by this operation."] + #[serde( + rename = "errorCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_count: Option<i32>, + #[doc = "The finish time."] + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[doc = "The ID of the record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "String identifier that is consistent across attempts."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub issues: Vec<Issue>, + #[doc = "The time the record was last modified."] + #[serde( + rename = "lastModified", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified: Option<time::OffsetDateTime>, + #[doc = "Represents a reference to a build log."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub log: Option<BuildLogReference>, + #[doc = "The name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "An ordinal value relative to other records."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, + #[doc = "The ID of the record's parent."] + #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option<String>, + #[doc = "The current completion percentage."] + #[serde( + rename = "percentComplete", + default, + skip_serializing_if = "Option::is_none" + )] + pub percent_complete: Option<i32>, + #[serde( + rename = "previousAttempts", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub previous_attempts: Vec<TimelineAttempt>, + #[doc = "The queue ID of the queue that the operation ran on."] + #[serde(rename = "queueId", default, skip_serializing_if = "Option::is_none")] + pub queue_id: Option<i32>, + #[doc = "The result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<timeline_record::Result>, + #[doc = "The result code."] + #[serde( + rename = "resultCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_code: Option<String>, + #[doc = "The start time."] + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, + #[doc = "The state of the record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<timeline_record::State>, + #[doc = "Represents a reference to a task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub task: Option<TaskReference>, + #[doc = "The type of the record."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "The REST URL of the timeline record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "The number of warnings produced by this operation."] + #[serde( + rename = "warningCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub warning_count: Option<i32>, + #[doc = "The name of the agent running the operation."] + #[serde( + rename = "workerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub worker_name: Option<String>, } impl TimelineRecord { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod timeline_record { - use super::*; - #[doc = "The result."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "succeededWithIssues")] - SucceededWithIssues, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "abandoned")] - Abandoned, - } - #[doc = "The state of the record."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "pending")] - Pending, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - } + use super::*; + #[doc = "The result."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "succeededWithIssues")] + SucceededWithIssues, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "abandoned")] + Abandoned, + } + #[doc = "The state of the record."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineRecordsUpdatedEvent { - #[serde(flatten)] - pub realtime_build_event: RealtimeBuildEvent, - #[serde( - rename = "timelineRecords", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub timeline_records: Vec<TimelineRecord>, + #[serde(flatten)] + pub realtime_build_event: RealtimeBuildEvent, + #[serde( + rename = "timelineRecords", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub timeline_records: Vec<TimelineRecord>, } impl TimelineRecordsUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to a timeline."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineReference { - #[doc = "The change ID."] - #[serde(rename = "changeId", default, skip_serializing_if = "Option::is_none")] - pub change_id: Option<i32>, - #[doc = "The ID of the timeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The REST URL of the timeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The change ID."] + #[serde(rename = "changeId", default, skip_serializing_if = "Option::is_none")] + pub change_id: Option<i32>, + #[doc = "The ID of the timeline."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The REST URL of the timeline."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TimelineReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contains members for updating the retention settings values. All fields are optional."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateProjectRetentionSettingModel { - #[doc = ""] - #[serde( - rename = "artifactsRetention", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifacts_retention: Option<UpdateRetentionSettingModel>, - #[doc = ""] - #[serde( - rename = "pullRequestRunRetention", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_run_retention: Option<UpdateRetentionSettingModel>, - #[doc = ""] - #[serde( - rename = "retainRunsPerProtectedBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub retain_runs_per_protected_branch: Option<UpdateRetentionSettingModel>, - #[doc = ""] - #[serde( - rename = "runRetention", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_retention: Option<UpdateRetentionSettingModel>, + #[doc = ""] + #[serde( + rename = "artifactsRetention", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifacts_retention: Option<UpdateRetentionSettingModel>, + #[doc = ""] + #[serde( + rename = "pullRequestRunRetention", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_run_retention: Option<UpdateRetentionSettingModel>, + #[doc = ""] + #[serde( + rename = "retainRunsPerProtectedBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub retain_runs_per_protected_branch: Option<UpdateRetentionSettingModel>, + #[doc = ""] + #[serde( + rename = "runRetention", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_retention: Option<UpdateRetentionSettingModel>, } impl UpdateProjectRetentionSettingModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateRetentionSettingModel { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<i32>, } impl UpdateRetentionSettingModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateStageParameters { - #[serde( - rename = "forceRetryAllJobs", - default, - skip_serializing_if = "Option::is_none" - )] - pub force_retry_all_jobs: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<update_stage_parameters::State>, + #[serde( + rename = "forceRetryAllJobs", + default, + skip_serializing_if = "Option::is_none" + )] + pub force_retry_all_jobs: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<update_stage_parameters::State>, } impl UpdateStageParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod update_stage_parameters { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "cancel")] - Cancel, - #[serde(rename = "retry")] - Retry, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "cancel")] + Cancel, + #[serde(rename = "retry")] + Retry, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateTagParameters { - #[serde( - rename = "tagsToAdd", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags_to_add: Vec<String>, - #[serde( - rename = "tagsToRemove", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags_to_remove: Vec<String>, + #[serde( + rename = "tagsToAdd", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags_to_add: Vec<String>, + #[serde( + rename = "tagsToRemove", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags_to_remove: Vec<String>, } impl UpdateTagParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a variable group."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableGroup { - #[serde(flatten)] - pub variable_group_reference: VariableGroupReference, - #[doc = "The description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The name of the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The type of the variable group."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[serde(flatten)] + pub variable_group_reference: VariableGroupReference, + #[doc = "The description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The name of the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The type of the variable group."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl VariableGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to a variable group."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableGroupReference { - #[doc = "The Name of the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub alias: Option<String>, - #[doc = "The ID of the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, + #[doc = "The Name of the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, + #[doc = "The ID of the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, } impl VariableGroupReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents options for running a phase based on values specified by a list of variables."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableMultipliersAgentExecutionOptions { - #[serde(flatten)] - pub agent_target_execution_options: AgentTargetExecutionOptions, - #[doc = "Indicates whether failure on one agent should prevent the phase from running on other agents."] - #[serde( - rename = "continueOnError", - default, - skip_serializing_if = "Option::is_none" - )] - pub continue_on_error: Option<bool>, - #[doc = "The maximum number of agents to use in parallel."] - #[serde( - rename = "maxConcurrency", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_concurrency: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub multipliers: Vec<String>, + #[serde(flatten)] + pub agent_target_execution_options: AgentTargetExecutionOptions, + #[doc = "Indicates whether failure on one agent should prevent the phase from running on other agents."] + #[serde( + rename = "continueOnError", + default, + skip_serializing_if = "Option::is_none" + )] + pub continue_on_error: Option<bool>, + #[doc = "The maximum number of agents to use in parallel."] + #[serde( + rename = "maxConcurrency", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_concurrency: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub multipliers: Vec<String>, } impl VariableMultipliersAgentExecutionOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents options for running a phase based on values specified by a list of variables."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableMultipliersServerExecutionOptions { - #[serde(flatten)] - pub server_target_execution_options: ServerTargetExecutionOptions, - #[doc = "Indicates whether failure of one job should prevent the phase from running in other jobs."] - #[serde( - rename = "continueOnError", - default, - skip_serializing_if = "Option::is_none" - )] - pub continue_on_error: Option<bool>, - #[doc = "The maximum number of server jobs to run in parallel."] - #[serde( - rename = "maxConcurrency", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_concurrency: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub multipliers: Vec<String>, + #[serde(flatten)] + pub server_target_execution_options: ServerTargetExecutionOptions, + #[doc = "Indicates whether failure of one job should prevent the phase from running in other jobs."] + #[serde( + rename = "continueOnError", + default, + skip_serializing_if = "Option::is_none" + )] + pub continue_on_error: Option<bool>, + #[doc = "The maximum number of server jobs to run in parallel."] + #[serde( + rename = "maxConcurrency", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_concurrency: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub multipliers: Vec<String>, } impl VariableMultipliersServerExecutionOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiConnectedServiceRef { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WebApiConnectedServiceRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Mapping for a workspace"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkspaceMapping { - #[doc = "Uri of the associated definition"] - #[serde( - rename = "definitionUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_uri: Option<String>, - #[doc = "Depth of this mapping"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub depth: Option<i32>, - #[doc = "local location of the definition"] - #[serde(rename = "localItem", default, skip_serializing_if = "Option::is_none")] - pub local_item: Option<String>, - #[doc = "type of workspace mapping"] - #[serde( - rename = "mappingType", - default, - skip_serializing_if = "Option::is_none" - )] - pub mapping_type: Option<workspace_mapping::MappingType>, - #[doc = "Server location of the definition"] - #[serde( - rename = "serverItem", - default, - skip_serializing_if = "Option::is_none" - )] - pub server_item: Option<String>, - #[doc = "Id of the workspace"] - #[serde( - rename = "workspaceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub workspace_id: Option<i32>, + #[doc = "Uri of the associated definition"] + #[serde( + rename = "definitionUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_uri: Option<String>, + #[doc = "Depth of this mapping"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub depth: Option<i32>, + #[doc = "local location of the definition"] + #[serde(rename = "localItem", default, skip_serializing_if = "Option::is_none")] + pub local_item: Option<String>, + #[doc = "type of workspace mapping"] + #[serde( + rename = "mappingType", + default, + skip_serializing_if = "Option::is_none" + )] + pub mapping_type: Option<workspace_mapping::MappingType>, + #[doc = "Server location of the definition"] + #[serde( + rename = "serverItem", + default, + skip_serializing_if = "Option::is_none" + )] + pub server_item: Option<String>, + #[doc = "Id of the workspace"] + #[serde( + rename = "workspaceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub workspace_id: Option<i32>, } impl WorkspaceMapping { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod workspace_mapping { - use super::*; - #[doc = "type of workspace mapping"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum MappingType { - #[serde(rename = "map")] - Map, - #[serde(rename = "cloak")] - Cloak, - } + use super::*; + #[doc = "type of workspace mapping"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum MappingType { + #[serde(rename = "map")] + Map, + #[serde(rename = "cloak")] + Cloak, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkspaceTemplate { - #[doc = "Uri of the associated definition"] - #[serde( - rename = "definitionUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_uri: Option<String>, - #[doc = "The identity that last modified this template"] - #[serde( - rename = "lastModifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_modified_by: Option<String>, - #[doc = "The last time this template was modified"] - #[serde( - rename = "lastModifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified_date: Option<time::OffsetDateTime>, - #[doc = "List of workspace mappings"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mappings: Vec<WorkspaceMapping>, - #[doc = "Id of the workspace for this template"] - #[serde( - rename = "workspaceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub workspace_id: Option<i32>, + #[doc = "Uri of the associated definition"] + #[serde( + rename = "definitionUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_uri: Option<String>, + #[doc = "The identity that last modified this template"] + #[serde( + rename = "lastModifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_modified_by: Option<String>, + #[doc = "The last time this template was modified"] + #[serde( + rename = "lastModifiedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified_date: Option<time::OffsetDateTime>, + #[doc = "List of workspace mappings"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mappings: Vec<WorkspaceMapping>, + #[doc = "Id of the workspace for this template"] + #[serde( + rename = "workspaceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub workspace_id: Option<i32>, } impl WorkspaceTemplate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct XamlBuildControllerReference { - #[doc = "Id of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the linked resource (definition name, controller name, etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Full http link to the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Id of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the linked resource (definition name, controller name, etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Full http link to the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl XamlBuildControllerReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct XamlBuildDefinition { - #[serde(flatten)] - pub definition_reference: DefinitionReference, - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "Batch size of the definition"] - #[serde(rename = "batchSize", default, skip_serializing_if = "Option::is_none")] - pub batch_size: Option<i32>, - #[serde(rename = "buildArgs", default, skip_serializing_if = "Option::is_none")] - pub build_args: Option<String>, - #[doc = "The continuous integration quiet period"] - #[serde( - rename = "continuousIntegrationQuietPeriod", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuous_integration_quiet_period: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub controller: Option<BuildController>, - #[doc = "The date this definition was created"] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Default drop location for builds from this definition"] - #[serde( - rename = "defaultDropLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_drop_location: Option<String>, - #[doc = "Description of the definition"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = ""] - #[serde(rename = "lastBuild", default, skip_serializing_if = "Option::is_none")] - pub last_build: Option<XamlBuildReference>, - #[doc = "Represents a repository used by a build definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<BuildRepository>, - #[doc = "The reasons supported by the template"] - #[serde( - rename = "supportedReasons", - default, - skip_serializing_if = "Option::is_none" - )] - pub supported_reasons: Option<xaml_build_definition::SupportedReasons>, - #[doc = "How builds are triggered from this definition"] - #[serde( - rename = "triggerType", - default, - skip_serializing_if = "Option::is_none" - )] - pub trigger_type: Option<xaml_build_definition::TriggerType>, + #[serde(flatten)] + pub definition_reference: DefinitionReference, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "Batch size of the definition"] + #[serde(rename = "batchSize", default, skip_serializing_if = "Option::is_none")] + pub batch_size: Option<i32>, + #[serde(rename = "buildArgs", default, skip_serializing_if = "Option::is_none")] + pub build_args: Option<String>, + #[doc = "The continuous integration quiet period"] + #[serde( + rename = "continuousIntegrationQuietPeriod", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuous_integration_quiet_period: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub controller: Option<BuildController>, + #[doc = "The date this definition was created"] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Default drop location for builds from this definition"] + #[serde( + rename = "defaultDropLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_drop_location: Option<String>, + #[doc = "Description of the definition"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = ""] + #[serde(rename = "lastBuild", default, skip_serializing_if = "Option::is_none")] + pub last_build: Option<XamlBuildReference>, + #[doc = "Represents a repository used by a build definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<BuildRepository>, + #[doc = "The reasons supported by the template"] + #[serde( + rename = "supportedReasons", + default, + skip_serializing_if = "Option::is_none" + )] + pub supported_reasons: Option<xaml_build_definition::SupportedReasons>, + #[doc = "How builds are triggered from this definition"] + #[serde( + rename = "triggerType", + default, + skip_serializing_if = "Option::is_none" + )] + pub trigger_type: Option<xaml_build_definition::TriggerType>, } impl XamlBuildDefinition { - pub fn new(definition_reference: DefinitionReference) -> Self { - Self { - definition_reference, - links: None, - batch_size: None, - build_args: None, - continuous_integration_quiet_period: None, - controller: None, - created_on: None, - default_drop_location: None, - description: None, - last_build: None, - repository: None, - supported_reasons: None, - trigger_type: None, - } - } + pub fn new(definition_reference: DefinitionReference) -> Self { + Self { + definition_reference, + links: None, + batch_size: None, + build_args: None, + continuous_integration_quiet_period: None, + controller: None, + created_on: None, + default_drop_location: None, + description: None, + last_build: None, + repository: None, + supported_reasons: None, + trigger_type: None, + } + } } pub mod xaml_build_definition { - use super::*; - #[doc = "The reasons supported by the template"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SupportedReasons { - #[serde(rename = "none")] - None, - #[serde(rename = "manual")] - Manual, - #[serde(rename = "individualCI")] - IndividualCi, - #[serde(rename = "batchedCI")] - BatchedCi, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "scheduleForced")] - ScheduleForced, - #[serde(rename = "userCreated")] - UserCreated, - #[serde(rename = "validateShelveset")] - ValidateShelveset, - #[serde(rename = "checkInShelveset")] - CheckInShelveset, - #[serde(rename = "pullRequest")] - PullRequest, - #[serde(rename = "buildCompletion")] - BuildCompletion, - #[serde(rename = "resourceTrigger")] - ResourceTrigger, - #[serde(rename = "triggered")] - Triggered, - #[serde(rename = "all")] - All, - } - #[doc = "How builds are triggered from this definition"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TriggerType { - #[serde(rename = "none")] - None, - #[serde(rename = "continuousIntegration")] - ContinuousIntegration, - #[serde(rename = "batchedContinuousIntegration")] - BatchedContinuousIntegration, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "gatedCheckIn")] - GatedCheckIn, - #[serde(rename = "batchedGatedCheckIn")] - BatchedGatedCheckIn, - #[serde(rename = "pullRequest")] - PullRequest, - #[serde(rename = "buildCompletion")] - BuildCompletion, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "The reasons supported by the template"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SupportedReasons { + #[serde(rename = "none")] + None, + #[serde(rename = "manual")] + Manual, + #[serde(rename = "individualCI")] + IndividualCi, + #[serde(rename = "batchedCI")] + BatchedCi, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "scheduleForced")] + ScheduleForced, + #[serde(rename = "userCreated")] + UserCreated, + #[serde(rename = "validateShelveset")] + ValidateShelveset, + #[serde(rename = "checkInShelveset")] + CheckInShelveset, + #[serde(rename = "pullRequest")] + PullRequest, + #[serde(rename = "buildCompletion")] + BuildCompletion, + #[serde(rename = "resourceTrigger")] + ResourceTrigger, + #[serde(rename = "triggered")] + Triggered, + #[serde(rename = "all")] + All, + } + #[doc = "How builds are triggered from this definition"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum TriggerType { + #[serde(rename = "none")] + None, + #[serde(rename = "continuousIntegration")] + ContinuousIntegration, + #[serde(rename = "batchedContinuousIntegration")] + BatchedContinuousIntegration, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "gatedCheckIn")] + GatedCheckIn, + #[serde(rename = "batchedGatedCheckIn")] + BatchedGatedCheckIn, + #[serde(rename = "pullRequest")] + PullRequest, + #[serde(rename = "buildCompletion")] + BuildCompletion, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct XamlBuildReference { - #[doc = "Id of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the linked resource (definition name, controller name, etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Full http link to the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Id of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the linked resource (definition name, controller name, etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Full http link to the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl XamlBuildReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct XamlBuildServerReference { - #[doc = "Id of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the linked resource (definition name, controller name, etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Full http link to the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Id of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the linked resource (definition name, controller name, etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Full http link to the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl XamlBuildServerReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct XamlDefinitionReference { - #[doc = "Id of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the linked resource (definition name, controller name, etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Full http link to the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Id of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the linked resource (definition name, controller name, etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Full http link to the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl XamlDefinitionReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a yaml build."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct YamlBuild { - #[doc = "The yaml used to define the build"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub yaml: Option<String>, + #[doc = "The yaml used to define the build"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub yaml: Option<String>, } impl YamlBuild { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a YAML process."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct YamlProcess { - #[serde(flatten)] - pub build_process: BuildProcess, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub errors: Vec<String>, - #[doc = "Represents resources used by a build process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option<BuildProcessResources>, - #[doc = "The YAML filename."] - #[serde( - rename = "yamlFilename", - default, - skip_serializing_if = "Option::is_none" - )] - pub yaml_filename: Option<String>, + #[serde(flatten)] + pub build_process: BuildProcess, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub errors: Vec<String>, + #[doc = "Represents resources used by a build process."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resources: Option<BuildProcessResources>, + #[doc = "The YAML filename."] + #[serde( + rename = "yamlFilename", + default, + skip_serializing_if = "Option::is_none" + )] + pub yaml_filename: Option<String>, } impl YamlProcess { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/core/mod.rs b/azure_devops_rust_api/src/core/mod.rs index 5690b760..d94b2295 100644 --- a/azure_devops_rust_api/src/core/mod.rs +++ b/azure_devops_rust_api/src/core/mod.rs @@ -9,2595 +9,2446 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + pub fn avatar_client(&self) -> avatar::Client { + avatar::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()) + } +} +pub mod processes { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of processes."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Get a process by ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: ID for a process."] + pub fn get( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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 AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } -} -pub mod processes { + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/process/processes", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of processes."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - #[doc = "Get a process by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: ID for a process."] - pub fn get( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - process_id: process_id.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/process/processes", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ProcessList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Process> { - let bytes = self.0.into_body().collect().await?; - let body: models::Process = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/process/processes/{}", - this.client.endpoint(), - &this.organization, - &this.process_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Process>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Process>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Process> { + let bytes = self.0.into_body().collect().await?; + let body: models::Process = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/process/processes/{}", + this.client.endpoint(), + &this.organization, + &this.process_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Process>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Process>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod projects { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The project to create."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::TeamProject>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get( + &self, + organization: impl Into<String>, + project_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The updates for the project. The state must be set to wellFormed to restore the project."] + #[doc = "* `project_id`: The project id of the project to update."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TeamProject>, + project_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project_id`: The project id of the project to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + project_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project_id`: The team project ID."] + pub fn get_project_properties( + &self, + organization: impl Into<String>, + project_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project_id`: The team project ID."] + #[doc = "* `body`: A JSON Patch document that represents an array of property operations. See RFC 6902 for more details on JSON Patch. The accepted operation verbs are Add and Remove, where Add is used for both creating and updating properties. The path consists of a forward slash and a property name."] + pub fn set_project_properties( + &self, + organization: impl Into<String>, + project_id: impl Into<String>, + body: impl Into<models::JsonPatchDocument>, + ) -> 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 list { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The project to create."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::TeamProject>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get( - &self, - organization: impl Into<String>, - project_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The updates for the project. The state must be set to wellFormed to restore the project."] - #[doc = "* `project_id`: The project id of the project to update."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TeamProject>, - project_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project_id`: The project id of the project to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - project_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project_id`: The team project ID."] - pub fn get_project_properties( - &self, - organization: impl Into<String>, - project_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project_id`: The team project ID."] - #[doc = "* `body`: A JSON Patch document that represents an array of property operations. See RFC 6902 for more details on JSON Patch. The accepted operation verbs are Add and Remove, where Add is used for both creating and updating properties. The path consists of a forward slash and a property name."] - pub fn set_project_properties( - &self, - organization: impl Into<String>, - project_id: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamProjectReferenceList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamProjectReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) state_filter: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) continuation_token: Option<i32>, - pub(crate) get_default_team_image_url: Option<bool>, - } - 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<String>) -> Self { - self.state_filter = Some(state_filter.into()); - self - } - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "Pointer that shows how many projects already been fetched."] - pub fn continuation_token(mut self, continuation_token: i32) -> Self { - self.continuation_token = Some(continuation_token); - self - } - pub fn get_default_team_image_url(http://github.com/mut%20self,%20get_default_team_image_url:%20bool) -> Self { - self.get_default_team_image_url = Some(get_default_team_image_url); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(state_filter) = &this.state_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("stateFilter", state_filter); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamProjectReferenceList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TeamProjectReferenceList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::OperationReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::OperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TeamProject, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::OperationReference>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::OperationReference>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamProject> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamProject = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project_id: String, - pub(crate) include_capabilities: Option<bool>, - pub(crate) include_history: Option<bool>, - } - 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); - self - } - #[doc = "Search within renamed projects (that had such name in the past)."] - pub fn include_history(mut self, include_history: bool) -> Self { - self.include_history = Some(include_history); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}", - this.client.endpoint(), - &this.organization, - &this.project_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamProject>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TeamProject>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::OperationReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::OperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TeamProject, - pub(crate) project_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}", - this.client.endpoint(), - &this.organization, - &this.project_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::OperationReference>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::OperationReference>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::OperationReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::OperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}", - this.client.endpoint(), - &this.organization, - &this.project_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::OperationReference>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::OperationReference>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_project_properties { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProjectPropertyList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProjectPropertyList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project_id: String, - pub(crate) keys: Option<String>, - } - 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<String>) -> Self { - self.keys = Some(keys.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}/properties", - this.client.endpoint(), - &this.organization, - &this.project_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(keys) = &this.keys { - req.url_mut().query_pairs_mut().append_pair("keys", keys); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProjectPropertyList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProjectPropertyList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod set_project_properties { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project_id: String, - pub(crate) body: models::JsonPatchDocument, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}/properties", - this.client.endpoint(), - &this.organization, - &this.project_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamProjectReferenceList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamProjectReferenceList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) state_filter: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) continuation_token: Option<String>, + pub(crate) get_default_team_image_url: Option<bool>, + } + 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<String>) -> Self { + self.state_filter = Some(state_filter.into()); + self + } + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + pub fn get_default_team_image_url(http://github.com/mut%20self,%20get_default_team_image_url:%20bool) -> Self { + self.get_default_team_image_url = Some(get_default_team_image_url); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(state_filter) = &this.state_filter { + req + .url_mut() + .query_pairs_mut() + .append_pair("stateFilter", state_filter); + } + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamProjectReferenceList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamProjectReferenceList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::OperationReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationReference = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TeamProject, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::OperationReference>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::OperationReference>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamProject> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamProject = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project_id: String, + pub(crate) include_capabilities: Option<bool>, + pub(crate) include_history: Option<bool>, + } + 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); + self + } + #[doc = "Search within renamed projects (that had such name in the past)."] + pub fn include_history(mut self, include_history: bool) -> Self { + self.include_history = Some(include_history); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}", + this.client.endpoint(), + &this.organization, + &this.project_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamProject>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamProject>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::OperationReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationReference = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TeamProject, + pub(crate) project_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}", + this.client.endpoint(), + &this.organization, + &this.project_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::OperationReference>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::OperationReference>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::OperationReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationReference = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}", + this.client.endpoint(), + &this.organization, + &this.project_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::OperationReference>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::OperationReference>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_project_properties { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProjectPropertyList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProjectPropertyList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project_id: String, + pub(crate) keys: Option<String>, } + 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<String>) -> Self { + self.keys = Some(keys.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}/properties", + this.client.endpoint(), + &this.organization, + &this.project_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(keys) = &this.keys { + req.url_mut().query_pairs_mut().append_pair("keys", keys); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProjectPropertyList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProjectPropertyList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod set_project_properties { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project_id: String, + pub(crate) body: models::JsonPatchDocument, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}/properties", + this.client.endpoint(), + &this.organization, + &this.project_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod avatar { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Sets the avatar for the project."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The avatar blob data object to upload."] + #[doc = "* `project_id`: The ID or name of the project."] + pub fn set_project_avatar( + &self, + organization: impl Into<String>, + body: impl Into<models::ProjectAvatar>, + project_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project_id`: The ID or name of the project."] + pub fn remove_project_avatar( + &self, + organization: impl Into<String>, + project_id: impl Into<String>, + ) -> remove_project_avatar::RequestBuilder { + remove_project_avatar::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project_id: project_id.into(), + } + } + } + pub mod set_project_avatar { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Sets the avatar for the project."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The avatar blob data object to upload."] - #[doc = "* `project_id`: The ID or name of the project."] - pub fn set_project_avatar( - &self, - organization: impl Into<String>, - body: impl Into<models::ProjectAvatar>, - project_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project_id`: The ID or name of the project."] - pub fn remove_project_avatar( - &self, - organization: impl Into<String>, - project_id: impl Into<String>, - ) -> remove_project_avatar::RequestBuilder { - remove_project_avatar::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project_id: project_id.into(), - } - } - } - pub mod set_project_avatar { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ProjectAvatar, - pub(crate) project_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}/avatar", - this.client.endpoint(), - &this.organization, - &this.project_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod remove_project_avatar { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}/avatar", - this.client.endpoint(), - &this.organization, - &this.project_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ProjectAvatar, + pub(crate) project_id: String, } -} -pub mod categorized_teams { + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}/avatar", + this.client.endpoint(), + &this.organization, + &this.project_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod remove_project_avatar { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project_id`: The name or ID (GUID) of the team project containing the teams to retrieve."] - pub fn get( - &self, - organization: impl Into<String>, - project_id: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CategorizedWebApiTeams> { - let bytes = self.0.into_body().collect().await?; - let body: models::CategorizedWebApiTeams = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project_id: String, - pub(crate) expand_identity: Option<bool>, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - } - 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 - } - #[doc = "Maximum number of teams to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of teams to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}/categorizedteams/", - this.client.endpoint(), - &this.organization, - &this.project_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CategorizedWebApiTeams>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::CategorizedWebApiTeams>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}/avatar", + this.client.endpoint(), + &this.organization, + &this.project_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod teams { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of teams."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get_teams( + &self, + organization: impl Into<String>, + project_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The team data used to create the team."] + #[doc = "* `project_id`: The name or ID (GUID) of the team project in which to create the team."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::WebApiTeam>, + project_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project_id`: The name or ID (GUID) of the team project containing the team."] + #[doc = "* `team_id`: The name or ID (GUID) of the team."] + pub fn get( + &self, + organization: impl Into<String>, + project_id: impl Into<String>, + team_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project_id`: The name or ID (GUID) of the team project containing the team to update."] + #[doc = "* `team_id`: The name of ID of the team to update."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::WebApiTeam>, + project_id: impl Into<String>, + team_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project_id`: The name or ID (GUID) of the team project containing the team to delete."] + #[doc = "* `team_id`: The name or ID of the team to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + project_id: impl Into<String>, + team_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project_id`: The name or ID (GUID) of the team project the team belongs to."] + #[doc = "* `team_id`: The name or ID (GUID) of the team ."] + pub fn get_team_members_with_extended_properties( + &self, + organization: impl Into<String>, + project_id: impl Into<String>, + team_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get_all_teams(&self, organization: impl Into<String>) -> get_all_teams::RequestBuilder { + get_all_teams::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + mine: None, + top: None, + skip: None, + expand_identity: None, + } + } + } + pub mod get_teams { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of teams."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get_teams( - &self, - organization: impl Into<String>, - project_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The team data used to create the team."] - #[doc = "* `project_id`: The name or ID (GUID) of the team project in which to create the team."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::WebApiTeam>, - project_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project_id`: The name or ID (GUID) of the team project containing the team."] - #[doc = "* `team_id`: The name or ID (GUID) of the team."] - pub fn get( - &self, - organization: impl Into<String>, - project_id: impl Into<String>, - team_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project_id`: The name or ID (GUID) of the team project containing the team to update."] - #[doc = "* `team_id`: The name of ID of the team to update."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::WebApiTeam>, - project_id: impl Into<String>, - team_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project_id`: The name or ID (GUID) of the team project containing the team to delete."] - #[doc = "* `team_id`: The name or ID of the team to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - project_id: impl Into<String>, - team_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project_id`: The name or ID (GUID) of the team project the team belongs to."] - #[doc = "* `team_id`: The name or ID (GUID) of the team ."] - pub fn get_team_members_with_extended_properties( - &self, - organization: impl Into<String>, - project_id: impl Into<String>, - team_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get_all_teams( - &self, - organization: impl Into<String>, - ) -> get_all_teams::RequestBuilder { - get_all_teams::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - mine: None, - top: None, - skip: None, - expand_identity: None, - } - } - } - pub mod get_teams { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WebApiTeamList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTeamList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project_id: String, - pub(crate) mine: Option<bool>, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) expand_identity: Option<bool>, - } - 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); - self - } - #[doc = "Maximum number of teams to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of teams to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}/teams", - this.client.endpoint(), - &this.organization, - &this.project_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WebApiTeamList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTeamList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WebApiTeam> { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTeam = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WebApiTeam, - pub(crate) project_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}/teams", - this.client.endpoint(), - &this.organization, - &this.project_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WebApiTeam>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTeam>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WebApiTeam> { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTeam = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project_id: String, - pub(crate) team_id: String, - pub(crate) expand_identity: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}/teams/{}", - this.client.endpoint(), - &this.organization, - &this.project_id, - &this.team_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand_identity) = &this.expand_identity { - req.url_mut() - .query_pairs_mut() - .append_pair("$expandIdentity", &expand_identity.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WebApiTeam>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTeam>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WebApiTeam> { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTeam = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WebApiTeam, - pub(crate) project_id: String, - pub(crate) team_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}/teams/{}", - this.client.endpoint(), - &this.organization, - &this.project_id, - &this.team_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WebApiTeam>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTeam>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project_id: String, - pub(crate) team_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}/teams/{}", - this.client.endpoint(), - &this.organization, - &this.project_id, - &this.team_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_team_members_with_extended_properties { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamMemberList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamMemberList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project_id: String, - pub(crate) team_id: String, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - } - impl RequestBuilder { - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/projects/{}/teams/{}/members", - this.client.endpoint(), - &this.organization, - &this.project_id, - &this.team_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamMemberList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TeamMemberList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_all_teams { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WebApiTeamList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTeamList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) mine: Option<bool>, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) expand_identity: Option<bool>, - } - 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); - self - } - #[doc = "Maximum number of teams to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of teams to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/teams", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WebApiTeamList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTeamList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WebApiTeamList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WebApiTeamList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project_id: String, + pub(crate) mine: Option<bool>, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) expand_identity: Option<bool>, + } + 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); + self + } + #[doc = "Maximum number of teams to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of teams to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}/teams", + this.client.endpoint(), + &this.organization, + &this.project_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WebApiTeamList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTeamList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WebApiTeam> { + let bytes = self.0.into_body().collect().await?; + let body: models::WebApiTeam = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WebApiTeam, + pub(crate) project_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}/teams", + this.client.endpoint(), + &this.organization, + &this.project_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WebApiTeam>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTeam>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WebApiTeam> { + let bytes = self.0.into_body().collect().await?; + let body: models::WebApiTeam = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project_id: String, + pub(crate) team_id: String, + pub(crate) expand_identity: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}/teams/{}", + this.client.endpoint(), + &this.organization, + &this.project_id, + &this.team_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand_identity) = &this.expand_identity { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expandIdentity", &expand_identity.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WebApiTeam>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTeam>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WebApiTeam> { + let bytes = self.0.into_body().collect().await?; + let body: models::WebApiTeam = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WebApiTeam, + pub(crate) project_id: String, + pub(crate) team_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}/teams/{}", + this.client.endpoint(), + &this.organization, + &this.project_id, + &this.team_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WebApiTeam>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTeam>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project_id: String, + pub(crate) team_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}/teams/{}", + this.client.endpoint(), + &this.organization, + &this.project_id, + &this.team_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_team_members_with_extended_properties { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamMemberList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamMemberList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project_id: String, + pub(crate) team_id: String, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + } + impl RequestBuilder { + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/projects/{}/teams/{}/members", + this.client.endpoint(), + &this.organization, + &this.project_id, + &this.team_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamMemberList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamMemberList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_all_teams { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WebApiTeamList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WebApiTeamList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) mine: Option<bool>, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) expand_identity: Option<bool>, + } + 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); + self + } + #[doc = "Maximum number of teams to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of teams to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/teams", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WebApiTeamList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTeamList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/core/models.rs b/azure_devops_rust_api/src/core/models.rs index f4eaaabe..3e70191c 100644 --- a/azure_devops_rust_api/src/core/models.rs +++ b/azure_devops_rust_api/src/core/models.rs @@ -7,1311 +7,1281 @@ use serde::{Deserialize, Serialize, Serializer}; use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CategorizedWebApiTeams { - #[doc = "Teams that the user is a member of."] - #[serde( - rename = "myTeams", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub my_teams: Vec<WebApiTeam>, - #[doc = "Teams that the user can read but is not member of."] - #[serde( - rename = "otherReadableTeams", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub other_readable_teams: Vec<WebApiTeam>, -} -impl CategorizedWebApiTeams { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Identity { - #[serde(flatten)] - pub identity_base: IdentityBase, + #[serde(flatten)] + pub identity_base: IdentityBase, } impl Identity { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Base Identity class to allow \"trimmed\" identity class in the GetConnectionData API Makes sure that on-the-wire representations of the derived classes are compatible with each other (e.g. Server responds with PublicIdentity object while client deserializes it as Identity object) Derived classes should not have additional \\[DataMember\\] properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityBase { - #[doc = "The custom display name for the identity (if any). Setting this property to an empty string will clear the existing custom display name. Setting this property to null will not affect the existing persisted value (since null values do not get sent over the wire or to the database)"] - #[serde( - rename = "customDisplayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub custom_display_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "Identity Identifier. Also called Storage Key, or VSID"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "True if the identity has a membership in any Azure Devops group in the organization."] - #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")] - pub is_active: Option<bool>, - #[doc = "True if the identity is a group."] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde(rename = "masterId", default, skip_serializing_if = "Option::is_none")] - pub master_id: Option<String>, - #[doc = "Id of the members of the identity (groups only)."] - #[serde( - rename = "memberIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub member_ids: Vec<String>, - #[serde( - rename = "memberOf", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub member_of: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub members: Vec<String>, - #[serde( - rename = "metaTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub meta_type_id: Option<i32>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "The display name for the identity as specified by the source identity provider."] - #[serde( - rename = "providerDisplayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub provider_display_name: Option<String>, - #[serde( - rename = "resourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_version: Option<i32>, - #[serde( - rename = "socialDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub social_descriptor: Option<String>, - #[doc = "Subject descriptor of a Graph entity."] - #[serde( - rename = "subjectDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub subject_descriptor: Option<String>, - #[serde( - rename = "uniqueUserId", - default, - skip_serializing_if = "Option::is_none" - )] - pub unique_user_id: Option<i32>, + #[doc = "The custom display name for the identity (if any). Setting this property to an empty string will clear the existing custom display name. Setting this property to null will not affect the existing persisted value (since null values do not get sent over the wire or to the database)"] + #[serde( + rename = "customDisplayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub custom_display_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "Identity Identifier. Also called Storage Key, or VSID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "True if the identity has a membership in any Azure Devops group in the organization."] + #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")] + pub is_active: Option<bool>, + #[doc = "True if the identity is a group."] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde(rename = "masterId", default, skip_serializing_if = "Option::is_none")] + pub master_id: Option<String>, + #[doc = "Id of the members of the identity (groups only)."] + #[serde( + rename = "memberIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub member_ids: Vec<String>, + #[serde( + rename = "memberOf", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub member_of: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub members: Vec<String>, + #[serde( + rename = "metaTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub meta_type_id: Option<i32>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "The display name for the identity as specified by the source identity provider."] + #[serde( + rename = "providerDisplayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub provider_display_name: Option<String>, + #[serde( + rename = "resourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_version: Option<i32>, + #[serde( + rename = "socialDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub social_descriptor: Option<String>, + #[doc = "Subject descriptor of a Graph entity."] + #[serde( + rename = "subjectDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub subject_descriptor: Option<String>, + #[serde( + rename = "uniqueUserId", + default, + skip_serializing_if = "Option::is_none" + )] + pub unique_user_id: Option<i32>, } impl IdentityBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityData { - #[serde( - rename = "identityIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub identity_ids: Vec<String>, + #[serde( + rename = "identityIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub identity_ids: Vec<String>, } impl IdentityData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An Identity descriptor is a wrapper for the identity type (Windows SID, Passport) along with a unique identifier such as the SID or PUID."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityDescriptor { - #[doc = "The unique identifier for this identity, not exceeding 256 chars, which will be persisted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, - #[doc = "Type of descriptor (for example, Windows, Passport, etc.)."] - #[serde( - rename = "identityType", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_type: Option<String>, + #[doc = "The unique identifier for this identity, not exceeding 256 chars, which will be persisted."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, + #[doc = "Type of descriptor (for example, Windows, Passport, etc.)."] + #[serde( + rename = "identityType", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_type: Option<String>, } impl IdentityDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, } + } } #[doc = "The JSON model for JSON Patch Operations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchDocument {} impl JsonPatchDocument { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for a JSON Patch operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchOperation { - #[doc = "The path to copy from for the Move/Copy operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub from: Option<String>, - #[doc = "The patch operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub op: Option<json_patch_operation::Op>, - #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "The value for the operation. This is either a primitive or a JToken."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = "The path to copy from for the Move/Copy operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub from: Option<String>, + #[doc = "The patch operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub op: Option<json_patch_operation::Op>, + #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "The value for the operation. This is either a primitive or a JToken."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl JsonPatchOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod json_patch_operation { - use super::*; - #[doc = "The patch operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Op { - #[serde(rename = "add")] - Add, - #[serde(rename = "remove")] - Remove, - #[serde(rename = "replace")] - Replace, - #[serde(rename = "move")] - Move, - #[serde(rename = "copy")] - Copy, - #[serde(rename = "test")] - Test, - } + use super::*; + #[doc = "The patch operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Op { + #[serde(rename = "add")] + Add, + #[serde(rename = "remove")] + Remove, + #[serde(rename = "replace")] + Replace, + #[serde(rename = "move")] + Move, + #[serde(rename = "copy")] + Copy, + #[serde(rename = "test")] + Test, + } } #[doc = "Reference for an async operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationReference { - #[doc = "Unique identifier for the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Unique identifier for the plugin."] - #[serde(rename = "pluginId", default, skip_serializing_if = "Option::is_none")] - pub plugin_id: Option<String>, - #[doc = "The current status of the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<operation_reference::Status>, - #[doc = "URL to get the full operation object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Unique identifier for the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Unique identifier for the plugin."] + #[serde(rename = "pluginId", default, skip_serializing_if = "Option::is_none")] + pub plugin_id: Option<String>, + #[doc = "The current status of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<operation_reference::Status>, + #[doc = "URL to get the full operation object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl OperationReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod operation_reference { - use super::*; - #[doc = "The current status of the operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "notSet")] - NotSet, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "cancelled")] - Cancelled, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - } + use super::*; + #[doc = "The current status of the operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "notSet")] + NotSet, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "cancelled")] + Cancelled, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Process { - #[serde(flatten)] - pub process_reference: ProcessReference, - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] - pub is_default: Option<bool>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<process::Type>, + #[serde(flatten)] + pub process_reference: ProcessReference, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] + pub is_default: Option<bool>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<process::Type>, } impl Process { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod process { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "system")] - System, - #[serde(rename = "custom")] - Custom, - #[serde(rename = "inherited")] - Inherited, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "system")] + System, + #[serde(rename = "custom")] + Custom, + #[serde(rename = "inherited")] + Inherited, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Process>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Process>, } impl ProcessList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ProcessReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contains the image data for project avatar."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectAvatar { - #[doc = "The avatar image represented as a byte array."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub image: Vec<String>, + #[doc = "The avatar image represented as a byte array."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub image: Vec<String>, } impl ProjectAvatar { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contains information describing a project."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectInfo { - #[doc = "The abbreviated name of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub abbreviation: Option<String>, - #[doc = "The description of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The id of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The time that this project was last updated."] - #[serde( - rename = "lastUpdateTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_update_time: Option<time::OffsetDateTime>, - #[doc = "The name of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "A set of name-value pairs storing additional property data related to the project."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub properties: Vec<ProjectProperty>, - #[doc = "The current revision of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, - #[doc = "The current state of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<project_info::State>, - #[doc = "A Uri that can be used to refer to this project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, - #[doc = "The version number of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i64>, - #[doc = "Indicates whom the project is visible to."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub visibility: Option<project_info::Visibility>, + #[doc = "The abbreviated name of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub abbreviation: Option<String>, + #[doc = "The description of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The id of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The time that this project was last updated."] + #[serde( + rename = "lastUpdateTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_update_time: Option<time::OffsetDateTime>, + #[doc = "The name of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "A set of name-value pairs storing additional property data related to the project."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub properties: Vec<ProjectProperty>, + #[doc = "The current revision of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i64>, + #[doc = "The current state of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<project_info::State>, + #[doc = "A Uri that can be used to refer to this project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, + #[doc = "The version number of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i64>, + #[doc = "Indicates whom the project is visible to."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub visibility: Option<project_info::Visibility>, } impl ProjectInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod project_info { - use super::*; - #[doc = "The current state of the project."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "deleting")] - Deleting, - #[serde(rename = "new")] - New, - #[serde(rename = "wellFormed")] - WellFormed, - #[serde(rename = "createPending")] - CreatePending, - #[serde(rename = "all")] - All, - #[serde(rename = "unchanged")] - Unchanged, - #[serde(rename = "deleted")] - Deleted, - } - #[doc = "Indicates whom the project is visible to."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Visibility { - #[serde(rename = "private")] - Private, - #[serde(rename = "public")] - Public, - } + use super::*; + #[doc = "The current state of the project."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "deleting")] + Deleting, + #[serde(rename = "new")] + New, + #[serde(rename = "wellFormed")] + WellFormed, + #[serde(rename = "createPending")] + CreatePending, + #[serde(rename = "all")] + All, + #[serde(rename = "unchanged")] + Unchanged, + #[serde(rename = "deleted")] + Deleted, + } + #[doc = "Indicates whom the project is visible to."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Visibility { + #[serde(rename = "private")] + Private, + #[serde(rename = "public")] + Public, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectMessage { - #[doc = "Contains information describing a project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectInfo>, - #[serde( - rename = "projectChangeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_change_type: Option<project_message::ProjectChangeType>, - #[serde( - rename = "shouldInvalidateSystemStore", - default, - skip_serializing_if = "Option::is_none" - )] - pub should_invalidate_system_store: Option<bool>, + #[doc = "Contains information describing a project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectInfo>, + #[serde( + rename = "projectChangeType", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_change_type: Option<project_message::ProjectChangeType>, + #[serde( + rename = "shouldInvalidateSystemStore", + default, + skip_serializing_if = "Option::is_none" + )] + pub should_invalidate_system_store: Option<bool>, } impl ProjectMessage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod project_message { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ProjectChangeType { - #[serde(rename = "modified")] - Modified, - #[serde(rename = "deleted")] - Deleted, - #[serde(rename = "added")] - Added, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ProjectChangeType { + #[serde(rename = "modified")] + Modified, + #[serde(rename = "deleted")] + Deleted, + #[serde(rename = "added")] + Added, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectProperties { - #[doc = "The team project Id"] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "The collection of team project properties"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub properties: Vec<ProjectProperty>, + #[doc = "The team project Id"] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "The collection of team project properties"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub properties: Vec<ProjectProperty>, } impl ProjectProperties { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A named value associated with a project."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectProperty { - #[doc = "The name of the property."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The value of the property."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = "The name of the property."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The value of the property."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl ProjectProperty { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectPropertyList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ProjectProperty>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ProjectProperty>, } impl ProjectPropertyList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PropertiesCollection { - #[doc = "The count of properties in the collection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<serde_json::Value>, - #[doc = "The set of keys in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub keys: Vec<String>, - #[doc = "The set of values in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<String>, + #[doc = "The count of properties in the collection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<serde_json::Value>, + #[doc = "The set of keys in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub keys: Vec<String>, + #[doc = "The set of values in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<String>, } impl PropertiesCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Proxy { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorization: Option<ProxyAuthorization>, - #[doc = "This is a description string"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The friendly name of the server"] - #[serde( - rename = "friendlyName", - default, - skip_serializing_if = "Option::is_none" - )] - pub friendly_name: Option<String>, - #[serde( - rename = "globalDefault", - default, - skip_serializing_if = "Option::is_none" - )] - pub global_default: Option<bool>, - #[doc = "This is a string representation of the site that the proxy server is located in (e.g. \"NA-WA-RED\")"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub site: Option<String>, - #[serde( - rename = "siteDefault", - default, - skip_serializing_if = "Option::is_none" - )] - pub site_default: Option<bool>, - #[doc = "The URL of the proxy server"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorization: Option<ProxyAuthorization>, + #[doc = "This is a description string"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The friendly name of the server"] + #[serde( + rename = "friendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option<String>, + #[serde( + rename = "globalDefault", + default, + skip_serializing_if = "Option::is_none" + )] + pub global_default: Option<bool>, + #[doc = "This is a string representation of the site that the proxy server is located in (e.g. \"NA-WA-RED\")"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub site: Option<String>, + #[serde( + rename = "siteDefault", + default, + skip_serializing_if = "Option::is_none" + )] + pub site_default: Option<bool>, + #[doc = "The URL of the proxy server"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Proxy { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProxyAuthorization { - #[doc = "Gets or sets the endpoint used to obtain access tokens from the configured token service."] - #[serde( - rename = "authorizationUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_url: Option<String>, - #[doc = "Gets or sets the client identifier for this proxy."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option<String>, - #[doc = "Gets or sets the user identity to authorize for on-prem."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option<String>, - #[doc = "Represents the public key portion of an RSA asymmetric key."] - #[serde(rename = "publicKey", default, skip_serializing_if = "Option::is_none")] - pub public_key: Option<PublicKey>, + #[doc = "Gets or sets the endpoint used to obtain access tokens from the configured token service."] + #[serde( + rename = "authorizationUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorization_url: Option<String>, + #[doc = "Gets or sets the client identifier for this proxy."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option<String>, + #[doc = "Gets or sets the user identity to authorize for on-prem."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option<String>, + #[doc = "Represents the public key portion of an RSA asymmetric key."] + #[serde(rename = "publicKey", default, skip_serializing_if = "Option::is_none")] + pub public_key: Option<PublicKey>, } impl ProxyAuthorization { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the public key portion of an RSA asymmetric key."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PublicKey { - #[doc = "Gets or sets the exponent for the public key."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub exponent: Vec<String>, - #[doc = "Gets or sets the modulus for the public key."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub modulus: Vec<String>, + #[doc = "Gets or sets the exponent for the public key."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub exponent: Vec<String>, + #[doc = "Gets or sets the modulus for the public key."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub modulus: Vec<String>, } impl PublicKey { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The Team Context for an operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamContext { - #[doc = "The team project Id or name. Ignored if ProjectId is set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<String>, - #[doc = "The Team Project ID. Required if Project is not set."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "The Team Id or name. Ignored if TeamId is set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub team: Option<String>, - #[doc = "The Team Id"] - #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] - pub team_id: Option<String>, + #[doc = "The team project Id or name. Ignored if ProjectId is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<String>, + #[doc = "The Team Project ID. Required if Project is not set."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "The Team Id or name. Ignored if TeamId is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub team: Option<String>, + #[doc = "The Team Id"] + #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] + pub team_id: Option<String>, } impl TeamContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamMember { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option<IdentityRef>, - #[serde( - rename = "isTeamAdmin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_team_admin: Option<bool>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option<IdentityRef>, + #[serde( + rename = "isTeamAdmin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_team_admin: Option<bool>, } impl TeamMember { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamMemberList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TeamMember>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TeamMember>, } impl TeamMemberList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a Team Project object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TeamProject { - #[serde(flatten)] - pub team_project_reference: TeamProjectReference, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Set of capabilities this project has (such as process template & version control)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub capabilities: Option<serde_json::Value>, - #[doc = ""] - #[serde( - rename = "defaultTeam", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_team: Option<WebApiTeamRef>, + #[serde(flatten)] + pub team_project_reference: TeamProjectReference, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Set of capabilities this project has (such as process template & version control)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: Option<serde_json::Value>, + #[doc = ""] + #[serde( + rename = "defaultTeam", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_team: Option<WebApiTeamRef>, } impl TeamProject { - pub fn new(team_project_reference: TeamProjectReference) -> Self { - Self { - team_project_reference, - links: None, - capabilities: None, - default_team: None, - } + pub fn new(team_project_reference: TeamProjectReference) -> Self { + Self { + team_project_reference, + links: None, + capabilities: None, + default_team: None, } + } } #[doc = "Data contract for a TeamProjectCollection."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamProjectCollection { - #[serde(flatten)] - pub team_project_collection_reference: TeamProjectCollectionReference, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Project collection description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Process customization type on this collection. It can be Xml or Inherited."] - #[serde( - rename = "processCustomizationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub process_customization_type: Option<team_project_collection::ProcessCustomizationType>, - #[doc = "Project collection state."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, + #[serde(flatten)] + pub team_project_collection_reference: TeamProjectCollectionReference, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Project collection description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Process customization type on this collection. It can be Xml or Inherited."] + #[serde( + rename = "processCustomizationType", + default, + skip_serializing_if = "Option::is_none" + )] + pub process_customization_type: Option<team_project_collection::ProcessCustomizationType>, + #[doc = "Project collection state."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, } impl TeamProjectCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod team_project_collection { - use super::*; - #[doc = "Process customization type on this collection. It can be Xml or Inherited."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ProcessCustomizationType { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "xml")] - Xml, - #[serde(rename = "inherited")] - Inherited, - } + use super::*; + #[doc = "Process customization type on this collection. It can be Xml or Inherited."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ProcessCustomizationType { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "xml")] + Xml, + #[serde(rename = "inherited")] + Inherited, + } } #[doc = "Reference object for a TeamProjectCollection."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamProjectCollectionReference { - #[doc = "Collection avatar Url."] - #[serde(rename = "avatarUrl", default, skip_serializing_if = "Option::is_none")] - pub avatar_url: Option<String>, - #[doc = "Collection Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Collection Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Collection REST Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Collection Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Collection Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Collection REST Url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TeamProjectCollectionReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a shallow reference to a TeamProject."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TeamProjectReference { - #[doc = "Project abbreviation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub abbreviation: Option<String>, - #[doc = "Url to default team identity image."] - #[serde( - rename = "defaultTeamImageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_team_image_url: Option<String>, - #[doc = "The project's description (if any)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Project identifier."] - pub id: String, - #[doc = "Project last update time."] - #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] - pub last_update_time: time::OffsetDateTime, - #[doc = "Project name."] - pub name: String, - #[doc = "Project revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, - #[doc = "Project state."] - pub state: team_project_reference::State, - #[doc = "Url to the full version of the object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Project visibility."] - pub visibility: team_project_reference::Visibility, + #[doc = "Project abbreviation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub abbreviation: Option<String>, + #[doc = "Url to default team identity image."] + #[serde( + rename = "defaultTeamImageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_team_image_url: Option<String>, + #[doc = "The project's description (if any)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Project identifier."] + pub id: String, + #[doc = "Project last update time."] + #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] + pub last_update_time: time::OffsetDateTime, + #[doc = "Project name."] + pub name: String, + #[doc = "Project revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i64>, + #[doc = "Project state."] + pub state: team_project_reference::State, + #[doc = "Url to the full version of the object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Project visibility."] + pub visibility: team_project_reference::Visibility, } impl TeamProjectReference { - pub fn new( - id: String, - last_update_time: time::OffsetDateTime, - name: String, - state: team_project_reference::State, - visibility: team_project_reference::Visibility, - ) -> Self { - Self { - abbreviation: None, - default_team_image_url: None, - description: None, - id, - last_update_time, - name, - revision: None, - state, - url: None, - visibility, - } + pub fn new( + id: String, + last_update_time: time::OffsetDateTime, + name: String, + state: team_project_reference::State, + visibility: team_project_reference::Visibility, + ) -> Self { + Self { + abbreviation: None, + default_team_image_url: None, + description: None, + id, + last_update_time, + name, + revision: None, + state, + url: None, + visibility, } + } } pub mod team_project_reference { - use super::*; - #[doc = "Project state."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "deleting")] - Deleting, - #[serde(rename = "new")] - New, - #[serde(rename = "wellFormed")] - WellFormed, - #[serde(rename = "createPending")] - CreatePending, - #[serde(rename = "all")] - All, - #[serde(rename = "unchanged")] - Unchanged, - #[serde(rename = "deleted")] - Deleted, - } - #[doc = "Project visibility."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Visibility { - #[serde(rename = "private")] - Private, - #[serde(rename = "public")] - Public, - #[serde(rename = "organization")] - Organization, - #[serde(rename = "unchanged")] - Unchanged, - } + use super::*; + #[doc = "Project state."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "deleting")] + Deleting, + #[serde(rename = "new")] + New, + #[serde(rename = "wellFormed")] + WellFormed, + #[serde(rename = "createPending")] + CreatePending, + #[serde(rename = "all")] + All, + #[serde(rename = "unchanged")] + Unchanged, + #[serde(rename = "deleted")] + Deleted, + } + #[doc = "Project visibility."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Visibility { + #[serde(rename = "private")] + Private, + #[serde(rename = "public")] + Public, + #[serde(rename = "organization")] + Organization, + #[serde(rename = "unchanged")] + Unchanged, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamProjectReferenceList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TeamProjectReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TeamProjectReference>, } impl TeamProjectReferenceList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A data transfer object that stores the metadata associated with the creation of temporary data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TemporaryDataCreatedDto { - #[serde(flatten)] - pub temporary_data_dto: TemporaryDataDto, - #[serde( - rename = "expirationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub expiration_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(flatten)] + pub temporary_data_dto: TemporaryDataDto, + #[serde( + rename = "expirationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub expiration_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TemporaryDataCreatedDto { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A data transfer object that stores the metadata associated with the temporary data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TemporaryDataDto { - #[serde( - rename = "expirationSeconds", - default, - skip_serializing_if = "Option::is_none" - )] - pub expiration_seconds: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub origin: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[serde( + rename = "expirationSeconds", + default, + skip_serializing_if = "Option::is_none" + )] + pub expiration_seconds: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl TemporaryDataDto { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Updateable properties for a WebApiTeam."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateTeam { - #[doc = "New description for the team."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "New name for the team."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "New description for the team."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "New name for the team."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl UpdateTeam { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiConnectedService { - #[serde(flatten)] - pub web_api_connected_service_ref: WebApiConnectedServiceRef, - #[doc = ""] - #[serde( - rename = "authenticatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub authenticated_by: Option<IdentityRef>, - #[doc = "Extra description on the service."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Friendly Name of service connection"] - #[serde( - rename = "friendlyName", - default, - skip_serializing_if = "Option::is_none" - )] - pub friendly_name: Option<String>, - #[doc = "Id/Name of the connection service. For Ex: Subscription Id for Azure Connection"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The kind of service."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option<String>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[doc = "Optional uri to connect directly to the service such as<https://windows>.azure.com"] - #[serde( - rename = "serviceUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_uri: Option<String>, + #[serde(flatten)] + pub web_api_connected_service_ref: WebApiConnectedServiceRef, + #[doc = ""] + #[serde( + rename = "authenticatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub authenticated_by: Option<IdentityRef>, + #[doc = "Extra description on the service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Friendly Name of service connection"] + #[serde( + rename = "friendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option<String>, + #[doc = "Id/Name of the connection service. For Ex: Subscription Id for Azure Connection"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The kind of service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option<String>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[doc = "Optional uri to connect directly to the service such as<https://windows>.azure.com"] + #[serde( + rename = "serviceUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_uri: Option<String>, } impl WebApiConnectedService { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiConnectedServiceDetails { - #[serde(flatten)] - pub web_api_connected_service_ref: WebApiConnectedServiceRef, - #[doc = ""] - #[serde( - rename = "connectedServiceMetaData", - default, - skip_serializing_if = "Option::is_none" - )] - pub connected_service_meta_data: Option<WebApiConnectedService>, - #[doc = "Credential info"] - #[serde( - rename = "credentialsXml", - default, - skip_serializing_if = "Option::is_none" - )] - pub credentials_xml: Option<String>, - #[doc = "Optional uri to connect directly to the service such as<https://windows>.azure.com"] - #[serde(rename = "endPoint", default, skip_serializing_if = "Option::is_none")] - pub end_point: Option<String>, + #[serde(flatten)] + pub web_api_connected_service_ref: WebApiConnectedServiceRef, + #[doc = ""] + #[serde( + rename = "connectedServiceMetaData", + default, + skip_serializing_if = "Option::is_none" + )] + pub connected_service_meta_data: Option<WebApiConnectedService>, + #[doc = "Credential info"] + #[serde( + rename = "credentialsXml", + default, + skip_serializing_if = "Option::is_none" + )] + pub credentials_xml: Option<String>, + #[doc = "Optional uri to connect directly to the service such as<https://windows>.azure.com"] + #[serde(rename = "endPoint", default, skip_serializing_if = "Option::is_none")] + pub end_point: Option<String>, } impl WebApiConnectedServiceDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiConnectedServiceRef { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WebApiConnectedServiceRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The representation of data needed to create a tag definition which is sent across the wire."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiCreateTagRequestData { - #[doc = "Name of the tag definition that will be created."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Name of the tag definition that will be created."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl WebApiCreateTagRequestData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WebApiProject { - #[serde(flatten)] - pub team_project_reference: TeamProjectReference, - #[doc = "Set of capabilities this project has"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub capabilities: Option<serde_json::Value>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub collection: Option<WebApiProjectCollectionRef>, - #[doc = ""] - #[serde( - rename = "defaultTeam", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_team: Option<WebApiTeamRef>, + #[serde(flatten)] + pub team_project_reference: TeamProjectReference, + #[doc = "Set of capabilities this project has"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub collection: Option<WebApiProjectCollectionRef>, + #[doc = ""] + #[serde( + rename = "defaultTeam", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_team: Option<WebApiTeamRef>, } impl WebApiProject { - pub fn new(team_project_reference: TeamProjectReference) -> Self { - Self { - team_project_reference, - capabilities: None, - collection: None, - default_team: None, - } + pub fn new(team_project_reference: TeamProjectReference) -> Self { + Self { + team_project_reference, + capabilities: None, + collection: None, + default_team: None, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiProjectCollection { - #[serde(flatten)] - pub web_api_project_collection_ref: WebApiProjectCollectionRef, - #[doc = "Project collection description"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Project collection state"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, + #[serde(flatten)] + pub web_api_project_collection_ref: WebApiProjectCollectionRef, + #[doc = "Project collection description"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Project collection state"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, } impl WebApiProjectCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiProjectCollectionRef { - #[doc = "Collection Tfs Url (Host Url)"] - #[serde( - rename = "collectionUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub collection_url: Option<String>, - #[doc = "Collection Guid"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Collection Name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Collection REST Url"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Collection Tfs Url (Host Url)"] + #[serde( + rename = "collectionUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub collection_url: Option<String>, + #[doc = "Collection Guid"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Collection Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Collection REST Url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WebApiProjectCollectionRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The representation of a tag definition which is sent across the wire."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiTagDefinition { - #[doc = "Whether or not the tag definition is active."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub active: Option<bool>, - #[doc = "ID of the tag definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The name of the tag definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Resource URL for the Tag Definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Whether or not the tag definition is active."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub active: Option<bool>, + #[doc = "ID of the tag definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The name of the tag definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Resource URL for the Tag Definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WebApiTagDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiTeam { - #[serde(flatten)] - pub web_api_team_ref: WebApiTeamRef, - #[doc = "Team description"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option<Identity>, - #[doc = "Identity REST API Url to this team"] - #[serde( - rename = "identityUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_url: Option<String>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, + #[serde(flatten)] + pub web_api_team_ref: WebApiTeamRef, + #[doc = "Team description"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option<Identity>, + #[doc = "Identity REST API Url to this team"] + #[serde( + rename = "identityUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_url: Option<String>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, } impl WebApiTeam { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiTeamList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WebApiTeam>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WebApiTeam>, } impl WebApiTeamList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiTeamRef { - #[doc = "Team (Identity) Guid. A Team Foundation ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Team name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Team REST API Url"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Team (Identity) Guid. A Team Foundation ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Team name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Team REST API Url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WebApiTeamRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/dashboard/mod.rs b/azure_devops_rust_api/src/dashboard/mod.rs index c5c3466c..8ce1d16a 100644 --- a/azure_devops_rust_api/src/dashboard/mod.rs +++ b/azure_devops_rust_api/src/dashboard/mod.rs @@ -9,2277 +9,2279 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + 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()) + } +} +pub mod widget_types { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_widget_types( + &self, + organization: impl Into<String>, + scope: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `contribution_id`: The ID of Contribution for the Widget"] + #[doc = "* `project`: Project ID or project name"] + pub fn get_widget_metadata( + &self, + organization: impl Into<String>, + contribution_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get_widget_types { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WidgetTypesResponse> { + let bytes = self.0.into_body().collect().await?; + let body: models::WidgetTypesResponse = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) scope: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/dashboard/widgettypes", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let scope = &this.scope; + req.url_mut().query_pairs_mut().append_pair("$scope", scope); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WidgetTypesResponse>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WidgetTypesResponse>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_widget_metadata { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WidgetMetadataResponse> { + let bytes = self.0.into_body().collect().await?; + let body: models::WidgetMetadataResponse = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) contribution_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/dashboard/widgettypes/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.contribution_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WidgetMetadataResponse>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WidgetMetadataResponse>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod dashboards { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of dashboards under a project."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Create the supplied dashboard."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The initial state of the dashboard"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::Dashboard>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn replace_dashboards( + &self, + organization: impl Into<String>, + body: impl Into<models::DashboardGroup>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + dashboard_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The Configuration of the dashboard to replace."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `dashboard_id`: ID of the dashboard to replace."] + #[doc = "* `team`: Team ID or team name"] + pub fn replace_dashboard( + &self, + organization: impl Into<String>, + body: impl Into<models::Dashboard>, + project: impl Into<String>, + dashboard_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `dashboard_id`: ID of the dashboard to delete."] + #[doc = "* `team`: Team ID or team name"] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + dashboard_id: impl Into<String>, + team: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + dashboard_id: dashboard_id.into(), + team: team.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DashboardList> { + let bytes = self.0.into_body().collect().await?; + let body: models::DashboardList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DashboardList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DashboardList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Dashboard> { + let bytes = self.0.into_body().collect().await?; + let body: models::Dashboard = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Dashboard, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Dashboard>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Dashboard>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod replace_dashboards { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DashboardGroup> { + let bytes = self.0.into_body().collect().await?; + let body: models::DashboardGroup = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::DashboardGroup, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DashboardGroup>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DashboardGroup>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Dashboard> { + let bytes = self.0.into_body().collect().await?; + let body: models::Dashboard = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) dashboard_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.dashboard_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Dashboard>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Dashboard>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod replace_dashboard { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Dashboard> { + let bytes = self.0.into_body().collect().await?; + let body: models::Dashboard = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Dashboard, + pub(crate) project: String, + pub(crate) dashboard_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.dashboard_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Dashboard>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Dashboard>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) dashboard_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.dashboard_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod widgets { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get widgets contained on the specified dashboard."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `dashboard_id`: ID of the dashboard to read."] + #[doc = "* `team`: Team ID or team name"] + pub fn get_widgets( + &self, + organization: impl Into<String>, + project: impl Into<String>, + dashboard_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: State of the widget to add"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `dashboard_id`: ID of dashboard the widget will be added to."] + #[doc = "* `team`: Team ID or team name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::Widget>, + project: impl Into<String>, + dashboard_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Revised state of widgets to store for the dashboard."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `dashboard_id`: ID of the Dashboard to modify."] + #[doc = "* `team`: Team ID or team name"] + pub fn replace_widgets( + &self, + organization: impl Into<String>, + body: Vec<models::Widget>, + project: impl Into<String>, + dashboard_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The set of widget states to update on the dashboard."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `dashboard_id`: ID of the Dashboard to modify."] + #[doc = "* `team`: Team ID or team name"] + pub fn update_widgets( + &self, + organization: impl Into<String>, + body: Vec<models::Widget>, + project: impl Into<String>, + dashboard_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `dashboard_id`: ID of the dashboard containing the widget."] + #[doc = "* `widget_id`: ID of the widget to read."] + #[doc = "* `team`: Team ID or team name"] + pub fn get_widget( + &self, + organization: impl Into<String>, + project: impl Into<String>, + dashboard_id: impl Into<String>, + widget_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: State to be written for the widget."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `dashboard_id`: ID of the dashboard containing the widget."] + #[doc = "* `widget_id`: ID of the widget to update."] + #[doc = "* `team`: Team ID or team name"] + pub fn replace_widget( + &self, + organization: impl Into<String>, + body: impl Into<models::Widget>, + project: impl Into<String>, + dashboard_id: impl Into<String>, + widget_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Description of the widget changes to apply. All non-null fields will be replaced."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `dashboard_id`: ID of the dashboard containing the widget."] + #[doc = "* `widget_id`: ID of the widget to update."] + #[doc = "* `team`: Team ID or team name"] + pub fn update_widget( + &self, + organization: impl Into<String>, + body: impl Into<models::Widget>, + project: impl Into<String>, + dashboard_id: impl Into<String>, + widget_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `dashboard_id`: ID of the dashboard containing the widget."] + #[doc = "* `widget_id`: ID of the widget to update."] + #[doc = "* `team`: Team ID or team name"] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + dashboard_id: impl Into<String>, + widget_id: impl Into<String>, + team: impl Into<String>, + ) -> 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(), + } + } + } + pub mod get_widgets { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WidgetList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WidgetList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn e_tag(&self) -> azure_core::Result<&str> { self + .0 + .get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) dashboard_id: String, + pub(crate) team: String, + pub(crate) e_tag: Option<String>, } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + impl RequestBuilder { + #[doc = "Dashboard Widgets Version"] + pub fn e_tag(mut self, e_tag: impl Into<String>) -> Self { + self.e_tag = Some(e_tag.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.dashboard_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(e_tag) = &this.e_tag { + req.insert_header("etag", e_tag); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WidgetList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WidgetList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Widget> { + let bytes = self.0.into_body().collect().await?; + let body: models::Widget = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Widget, + pub(crate) project: String, + pub(crate) dashboard_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.dashboard_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Widget>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Widget>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod replace_widgets { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WidgetList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WidgetList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn e_tag(&self) -> azure_core::Result<&str> { self + .0 + .get_str(&azure_core::headers::HeaderName::from_static("etag")) + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::Widget>, + pub(crate) project: String, + pub(crate) dashboard_id: String, + pub(crate) team: String, + pub(crate) e_tag: Option<String>, + } + impl RequestBuilder { + #[doc = "Dashboard Widgets Version"] + pub fn e_tag(mut self, e_tag: impl Into<String>) -> Self { + self.e_tag = Some(e_tag.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.dashboard_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WidgetList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WidgetList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_widgets { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WidgetList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WidgetList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn e_tag(&self) -> azure_core::Result<&str> { self + .0 + .get_str(&azure_core::headers::HeaderName::from_static("etag")) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::Widget>, + pub(crate) project: String, + pub(crate) dashboard_id: String, + pub(crate) team: String, + pub(crate) e_tag: Option<String>, } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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 RequestBuilder { + #[doc = "Dashboard Widgets Version"] + pub fn e_tag(mut self, e_tag: impl Into<String>) -> Self { + self.e_tag = Some(e_tag.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.dashboard_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } } -} -pub mod widget_types { + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WidgetList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WidgetList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_widget { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_widget_types( - &self, - organization: impl Into<String>, - scope: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `contribution_id`: The ID of Contribution for the Widget"] - #[doc = "* `project`: Project ID or project name"] - pub fn get_widget_metadata( - &self, - organization: impl Into<String>, - contribution_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get_widget_types { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WidgetTypesResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::WidgetTypesResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) scope: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/dashboard/widgettypes", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let scope = &this.scope; - req.url_mut().query_pairs_mut().append_pair("$scope", scope); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WidgetTypesResponse>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WidgetTypesResponse>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_widget_metadata { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WidgetMetadataResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::WidgetMetadataResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) contribution_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/dashboard/widgettypes/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.contribution_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WidgetMetadataResponse>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WidgetMetadataResponse>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Widget> { + let bytes = self.0.into_body().collect().await?; + let body: models::Widget = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod dashboards { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) dashboard_id: String, + pub(crate) widget_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.dashboard_id, + &this.widget_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Widget>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Widget>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod replace_widget { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of dashboards under a project."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - team: team.into(), - } - } - #[doc = "Create the supplied dashboard."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The initial state of the dashboard"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::Dashboard>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn replace_dashboards( - &self, - organization: impl Into<String>, - body: impl Into<models::DashboardGroup>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - dashboard_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The Configuration of the dashboard to replace."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `dashboard_id`: ID of the dashboard to replace."] - #[doc = "* `team`: Team ID or team name"] - pub fn replace_dashboard( - &self, - organization: impl Into<String>, - body: impl Into<models::Dashboard>, - project: impl Into<String>, - dashboard_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `dashboard_id`: ID of the dashboard to delete."] - #[doc = "* `team`: Team ID or team name"] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - dashboard_id: impl Into<String>, - team: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - dashboard_id: dashboard_id.into(), - team: team.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DashboardList> { - let bytes = self.0.into_body().collect().await?; - let body: models::DashboardList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DashboardList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::DashboardList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Dashboard> { - let bytes = self.0.into_body().collect().await?; - let body: models::Dashboard = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Dashboard, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Dashboard>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Dashboard>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod replace_dashboards { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DashboardGroup> { - let bytes = self.0.into_body().collect().await?; - let body: models::DashboardGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::DashboardGroup, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DashboardGroup>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::DashboardGroup>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Dashboard> { - let bytes = self.0.into_body().collect().await?; - let body: models::Dashboard = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) dashboard_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.dashboard_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Dashboard>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Dashboard>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod replace_dashboard { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Dashboard> { - let bytes = self.0.into_body().collect().await?; - let body: models::Dashboard = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Dashboard, - pub(crate) project: String, - pub(crate) dashboard_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.dashboard_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Dashboard>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Dashboard>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) dashboard_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.dashboard_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Widget> { + let bytes = self.0.into_body().collect().await?; + let body: models::Widget = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod widgets { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Widget, + pub(crate) project: String, + pub(crate) dashboard_id: String, + pub(crate) widget_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.dashboard_id, + &this.widget_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Widget>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Widget>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_widget { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get widgets contained on the specified dashboard."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `dashboard_id`: ID of the dashboard to read."] - #[doc = "* `team`: Team ID or team name"] - pub fn get_widgets( - &self, - organization: impl Into<String>, - project: impl Into<String>, - dashboard_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: State of the widget to add"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `dashboard_id`: ID of dashboard the widget will be added to."] - #[doc = "* `team`: Team ID or team name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::Widget>, - project: impl Into<String>, - dashboard_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Revised state of widgets to store for the dashboard."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `dashboard_id`: ID of the Dashboard to modify."] - #[doc = "* `team`: Team ID or team name"] - pub fn replace_widgets( - &self, - organization: impl Into<String>, - body: Vec<models::Widget>, - project: impl Into<String>, - dashboard_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The set of widget states to update on the dashboard."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `dashboard_id`: ID of the Dashboard to modify."] - #[doc = "* `team`: Team ID or team name"] - pub fn update_widgets( - &self, - organization: impl Into<String>, - body: Vec<models::Widget>, - project: impl Into<String>, - dashboard_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `dashboard_id`: ID of the dashboard containing the widget."] - #[doc = "* `widget_id`: ID of the widget to read."] - #[doc = "* `team`: Team ID or team name"] - pub fn get_widget( - &self, - organization: impl Into<String>, - project: impl Into<String>, - dashboard_id: impl Into<String>, - widget_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: State to be written for the widget."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `dashboard_id`: ID of the dashboard containing the widget."] - #[doc = "* `widget_id`: ID of the widget to update."] - #[doc = "* `team`: Team ID or team name"] - pub fn replace_widget( - &self, - organization: impl Into<String>, - body: impl Into<models::Widget>, - project: impl Into<String>, - dashboard_id: impl Into<String>, - widget_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Description of the widget changes to apply. All non-null fields will be replaced."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `dashboard_id`: ID of the dashboard containing the widget."] - #[doc = "* `widget_id`: ID of the widget to update."] - #[doc = "* `team`: Team ID or team name"] - pub fn update_widget( - &self, - organization: impl Into<String>, - body: impl Into<models::Widget>, - project: impl Into<String>, - dashboard_id: impl Into<String>, - widget_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `dashboard_id`: ID of the dashboard containing the widget."] - #[doc = "* `widget_id`: ID of the widget to update."] - #[doc = "* `team`: Team ID or team name"] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - dashboard_id: impl Into<String>, - widget_id: impl Into<String>, - team: impl Into<String>, - ) -> 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(), - } - } - } - pub mod get_widgets { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WidgetList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WidgetList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) dashboard_id: String, - pub(crate) team: String, - pub(crate) e_tag: Option<String>, - } - impl RequestBuilder { - #[doc = "Dashboard Widgets Version"] - pub fn e_tag(mut self, e_tag: impl Into<String>) -> Self { - self.e_tag = Some(e_tag.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.dashboard_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(e_tag) = &this.e_tag { - req.insert_header("etag", e_tag); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WidgetList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WidgetList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Widget> { - let bytes = self.0.into_body().collect().await?; - let body: models::Widget = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Widget, - pub(crate) project: String, - pub(crate) dashboard_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.dashboard_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Widget>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Widget>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod replace_widgets { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WidgetList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WidgetList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::Widget>, - pub(crate) project: String, - pub(crate) dashboard_id: String, - pub(crate) team: String, - pub(crate) e_tag: Option<String>, - } - impl RequestBuilder { - #[doc = "Dashboard Widgets Version"] - pub fn e_tag(mut self, e_tag: impl Into<String>) -> Self { - self.e_tag = Some(e_tag.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.dashboard_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WidgetList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WidgetList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_widgets { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WidgetList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WidgetList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::Widget>, - pub(crate) project: String, - pub(crate) dashboard_id: String, - pub(crate) team: String, - pub(crate) e_tag: Option<String>, - } - impl RequestBuilder { - #[doc = "Dashboard Widgets Version"] - pub fn e_tag(mut self, e_tag: impl Into<String>) -> Self { - self.e_tag = Some(e_tag.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.dashboard_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WidgetList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WidgetList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_widget { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Widget> { - let bytes = self.0.into_body().collect().await?; - let body: models::Widget = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) dashboard_id: String, - pub(crate) widget_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.dashboard_id, - &this.widget_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Widget>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Widget>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod replace_widget { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Widget> { - let bytes = self.0.into_body().collect().await?; - let body: models::Widget = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Widget, - pub(crate) project: String, - pub(crate) dashboard_id: String, - pub(crate) widget_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.dashboard_id, - &this.widget_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Widget>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Widget>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_widget { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Widget> { - let bytes = self.0.into_body().collect().await?; - let body: models::Widget = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Widget, - pub(crate) project: String, - pub(crate) dashboard_id: String, - pub(crate) widget_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.dashboard_id, - &this.widget_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Widget>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Widget>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Dashboard> { - let bytes = self.0.into_body().collect().await?; - let body: models::Dashboard = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) dashboard_id: String, - pub(crate) widget_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.dashboard_id, - &this.widget_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Dashboard>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Dashboard>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Widget> { + let bytes = self.0.into_body().collect().await?; + let body: models::Widget = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Widget, + pub(crate) project: String, + pub(crate) dashboard_id: String, + pub(crate) widget_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.dashboard_id, + &this.widget_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Widget>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Widget>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Dashboard> { + let bytes = self.0.into_body().collect().await?; + let body: models::Dashboard = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) dashboard_id: String, + pub(crate) widget_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.dashboard_id, + &this.widget_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Dashboard>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Dashboard>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/dashboard/models.rs b/azure_devops_rust_api/src/dashboard/models.rs index 4c2a4f20..af439f2b 100644 --- a/azure_devops_rust_api/src/dashboard/models.rs +++ b/azure_devops_rust_api/src/dashboard/models.rs @@ -8,770 +8,731 @@ use std::str::FromStr; #[doc = "Copy options of a Dashboard."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CopyDashboardOptions { - #[doc = "Dashboard Scope. Can be either Project or Project_Team"] - #[serde( - rename = "copyDashboardScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub copy_dashboard_scope: Option<copy_dashboard_options::CopyDashboardScope>, - #[doc = "When this flag is set to true,option to select the folder to copy Queries of copy dashboard will appear."] - #[serde( - rename = "copyQueriesFlag", - default, - skip_serializing_if = "Option::is_none" - )] - pub copy_queries_flag: Option<bool>, - #[doc = "Description of the dashboard"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Name of the dashboard"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "ID of the project. Provided by service at creation time."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "Path to which the queries should be copied of copy dashboard"] - #[serde( - rename = "queryFolderPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub query_folder_path: Option<String>, - #[doc = "Refresh interval of dashboard"] - #[serde( - rename = "refreshInterval", - default, - skip_serializing_if = "Option::is_none" - )] - pub refresh_interval: Option<i32>, - #[doc = "ID of the team. Provided by service at creation time"] - #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] - pub team_id: Option<String>, + #[doc = "Dashboard Scope. Can be either Project or Project_Team"] + #[serde( + rename = "copyDashboardScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub copy_dashboard_scope: Option<copy_dashboard_options::CopyDashboardScope>, + #[doc = "Description of the dashboard"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Name of the dashboard"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "ID of the project. Provided by service at creation time."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "Refresh interval of dashboard"] + #[serde( + rename = "refreshInterval", + default, + skip_serializing_if = "Option::is_none" + )] + pub refresh_interval: Option<i32>, + #[doc = "ID of the team. Provided by service at creation time"] + #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] + pub team_id: Option<String>, } impl CopyDashboardOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod copy_dashboard_options { - use super::*; - #[doc = "Dashboard Scope. Can be either Project or Project_Team"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum CopyDashboardScope { - #[serde(rename = "collection_User")] - CollectionUser, - #[serde(rename = "project_Team")] - ProjectTeam, - #[serde(rename = "project")] - Project, - } + use super::*; + #[doc = "Dashboard Scope. Can be either Project or Project_Team"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum CopyDashboardScope { + #[serde(rename = "collection_User")] + CollectionUser, + #[serde(rename = "project_Team")] + ProjectTeam, + #[serde(rename = "project")] + Project, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CopyDashboardResponse { - #[doc = "Model of a Dashboard."] - #[serde( - rename = "copiedDashboard", - default, - skip_serializing_if = "Option::is_none" - )] - pub copied_dashboard: Option<Dashboard>, - #[doc = "Copy options of a Dashboard."] - #[serde( - rename = "copyDashboardOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub copy_dashboard_options: Option<CopyDashboardOptions>, + #[doc = "Model of a Dashboard."] + #[serde( + rename = "copiedDashboard", + default, + skip_serializing_if = "Option::is_none" + )] + pub copied_dashboard: Option<Dashboard>, + #[doc = "Copy options of a Dashboard."] + #[serde( + rename = "copyDashboardOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub copy_dashboard_options: Option<CopyDashboardOptions>, } impl CopyDashboardResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Model of a Dashboard."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Dashboard { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "Entity to which the dashboard is scoped."] - #[serde( - rename = "dashboardScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub dashboard_scope: Option<dashboard::DashboardScope>, - #[doc = "Description of the dashboard."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Server defined version tracking value, used for edit collision detection."] - #[serde(rename = "eTag", default, skip_serializing_if = "Option::is_none")] - pub e_tag: Option<String>, - #[doc = "ID of the group for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards this property is empty."] - #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] - pub group_id: Option<String>, - #[doc = "ID of the Dashboard. Provided by service at creation time."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Dashboard Last Accessed Date."] - #[serde( - rename = "lastAccessedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_accessed_date: Option<time::OffsetDateTime>, - #[doc = "Id of the person who modified Dashboard."] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<String>, - #[doc = "Dashboard's last modified date."] - #[serde( - rename = "modifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_date: Option<time::OffsetDateTime>, - #[doc = "Name of the Dashboard."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "ID of the owner for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards, this is the unique identifier for the user identity associated with the dashboard."] - #[serde(rename = "ownerId", default, skip_serializing_if = "Option::is_none")] - pub owner_id: Option<String>, - #[doc = "Position of the dashboard, within a dashboard group. If unset at creation time, position is decided by the service."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub position: Option<i32>, - #[doc = "Interval for client to automatically refresh the dashboard. Expressed in minutes."] - #[serde( - rename = "refreshInterval", - default, - skip_serializing_if = "Option::is_none" - )] - pub refresh_interval: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "The set of Widgets on the dashboard."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub widgets: Vec<Widget>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "Entity to which the dashboard is scoped."] + #[serde( + rename = "dashboardScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub dashboard_scope: Option<dashboard::DashboardScope>, + #[doc = "Description of the dashboard."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Server defined version tracking value, used for edit collision detection."] + #[serde(rename = "eTag", default, skip_serializing_if = "Option::is_none")] + pub e_tag: Option<String>, + #[doc = "ID of the group for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards this property is empty."] + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option<String>, + #[doc = "ID of the Dashboard. Provided by service at creation time."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the Dashboard."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "ID of the owner for a dashboard. For team-scoped dashboards, this is the unique identifier for the team associated with the dashboard. For project-scoped dashboards, this is the unique identifier for the user identity associated with the dashboard."] + #[serde(rename = "ownerId", default, skip_serializing_if = "Option::is_none")] + pub owner_id: Option<String>, + #[doc = "Position of the dashboard, within a dashboard group. If unset at creation time, position is decided by the service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub position: Option<i32>, + #[doc = "Interval for client to automatically refresh the dashboard. Expressed in minutes."] + #[serde( + rename = "refreshInterval", + default, + skip_serializing_if = "Option::is_none" + )] + pub refresh_interval: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "The set of Widgets on the dashboard."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub widgets: Vec<Widget>, } impl Dashboard { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod dashboard { - use super::*; - #[doc = "Entity to which the dashboard is scoped."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DashboardScope { - #[serde(rename = "collection_User")] - CollectionUser, - #[serde(rename = "project_Team")] - ProjectTeam, - #[serde(rename = "project")] - Project, - } + use super::*; + #[doc = "Entity to which the dashboard is scoped."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DashboardScope { + #[serde(rename = "collection_User")] + CollectionUser, + #[serde(rename = "project_Team")] + ProjectTeam, + #[serde(rename = "project")] + Project, + } } #[doc = "Describes a list of dashboards associated to an owner. Currently, teams own dashboard groups."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DashboardGroup { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "A list of Dashboards held by the Dashboard Group"] - #[serde( - rename = "dashboardEntries", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dashboard_entries: Vec<DashboardGroupEntry>, - #[doc = "Deprecated: The old permission model describing the level of permissions for the current team. Pre-M125."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub permission: Option<dashboard_group::Permission>, - #[doc = "A permissions bit mask describing the security permissions of the current team for dashboards. When this permission is the value None, use GroupMemberPermission. Permissions are evaluated based on the presence of a value other than None, else the GroupMemberPermission will be saved."] - #[serde( - rename = "teamDashboardPermission", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_dashboard_permission: Option<dashboard_group::TeamDashboardPermission>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "A list of Dashboards held by the Dashboard Group"] + #[serde( + rename = "dashboardEntries", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dashboard_entries: Vec<DashboardGroupEntry>, + #[doc = "Deprecated: The old permission model describing the level of permissions for the current team. Pre-M125."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub permission: Option<dashboard_group::Permission>, + #[doc = "A permissions bit mask describing the security permissions of the current team for dashboards. When this permission is the value None, use GroupMemberPermission. Permissions are evaluated based on the presence of a value other than None, else the GroupMemberPermission will be saved."] + #[serde( + rename = "teamDashboardPermission", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_dashboard_permission: Option<dashboard_group::TeamDashboardPermission>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl DashboardGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod dashboard_group { - use super::*; - #[doc = "Deprecated: The old permission model describing the level of permissions for the current team. Pre-M125."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Permission { - #[serde(rename = "none")] - None, - #[serde(rename = "edit")] - Edit, - #[serde(rename = "manage")] - Manage, - #[serde(rename = "managePermissions")] - ManagePermissions, - } - #[doc = "A permissions bit mask describing the security permissions of the current team for dashboards. When this permission is the value None, use GroupMemberPermission. Permissions are evaluated based on the presence of a value other than None, else the GroupMemberPermission will be saved."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TeamDashboardPermission { - #[serde(rename = "none")] - None, - #[serde(rename = "read")] - Read, - #[serde(rename = "create")] - Create, - #[serde(rename = "edit")] - Edit, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "managePermissions")] - ManagePermissions, - } + use super::*; + #[doc = "Deprecated: The old permission model describing the level of permissions for the current team. Pre-M125."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Permission { + #[serde(rename = "none")] + None, + #[serde(rename = "edit")] + Edit, + #[serde(rename = "manage")] + Manage, + #[serde(rename = "managePermissions")] + ManagePermissions, + } + #[doc = "A permissions bit mask describing the security permissions of the current team for dashboards. When this permission is the value None, use GroupMemberPermission. Permissions are evaluated based on the presence of a value other than None, else the GroupMemberPermission will be saved."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum TeamDashboardPermission { + #[serde(rename = "none")] + None, + #[serde(rename = "read")] + Read, + #[serde(rename = "create")] + Create, + #[serde(rename = "edit")] + Edit, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "managePermissions")] + ManagePermissions, + } } #[doc = "Dashboard group entry, wrapping around Dashboard (needed?)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DashboardGroupEntry { - #[serde(flatten)] - pub dashboard: Dashboard, + #[serde(flatten)] + pub dashboard: Dashboard, } impl DashboardGroupEntry { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Response from RestAPI when saving and editing DashboardGroupEntry"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DashboardGroupEntryResponse { - #[serde(flatten)] - pub dashboard_group_entry: DashboardGroupEntry, + #[serde(flatten)] + pub dashboard_group_entry: DashboardGroupEntry, } impl DashboardGroupEntryResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DashboardList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Dashboard>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Dashboard>, } impl DashboardList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DashboardResponse { - #[serde(flatten)] - pub dashboard_group_entry: DashboardGroupEntry, + #[serde(flatten)] + pub dashboard_group_entry: DashboardGroupEntry, } impl DashboardResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Lightbox configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LightboxOptions { - #[doc = "Height of desired lightbox, in pixels"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub height: Option<i32>, - #[doc = "Set to true to allow lightbox resizing, false to disallow lightbox resizing, defaults to false."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resizable: Option<bool>, - #[doc = "Width of desired lightbox, in pixels"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub width: Option<i32>, + #[doc = "Height of desired lightbox, in pixels"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub height: Option<i32>, + #[doc = "Set to true to allow lightbox resizing, false to disallow lightbox resizing, defaults to false."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resizable: Option<bool>, + #[doc = "Width of desired lightbox, in pixels"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub width: Option<i32>, } impl LightboxOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "versioning for an artifact as described at:<http://semver>.org/, of the form major.minor.patch."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SemanticVersion { - #[doc = "Major version when you make incompatible API changes"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub major: Option<i32>, - #[doc = "Minor version when you add functionality in a backwards-compatible manner"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub minor: Option<i32>, - #[doc = "Patch version when you make backwards-compatible bug fixes"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub patch: Option<i32>, + #[doc = "Major version when you make incompatible API changes"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub major: Option<i32>, + #[doc = "Minor version when you add functionality in a backwards-compatible manner"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub minor: Option<i32>, + #[doc = "Patch version when you make backwards-compatible bug fixes"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub patch: Option<i32>, } impl SemanticVersion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The Team Context for an operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamContext { - #[doc = "The team project Id or name. Ignored if ProjectId is set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<String>, - #[doc = "The Team Project ID. Required if Project is not set."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "The Team Id or name. Ignored if TeamId is set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub team: Option<String>, - #[doc = "The Team Id"] - #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] - pub team_id: Option<String>, + #[doc = "The team project Id or name. Ignored if ProjectId is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<String>, + #[doc = "The Team Project ID. Required if Project is not set."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "The Team Id or name. Ignored if TeamId is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub team: Option<String>, + #[doc = "The Team Id"] + #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] + pub team_id: Option<String>, } impl TeamContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Widget data"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Widget { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "Refers to the allowed sizes for the widget. This gets populated when user wants to configure the widget"] - #[serde( - rename = "allowedSizes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub allowed_sizes: Vec<WidgetSize>, - #[doc = "Read-Only Property from Dashboard Service. Indicates if settings are blocked for the current user."] - #[serde( - rename = "areSettingsBlockedForUser", - default, - skip_serializing_if = "Option::is_none" - )] - pub are_settings_blocked_for_user: Option<bool>, - #[doc = "Refers to unique identifier of a feature artifact. Used for pinning+unpinning a specific artifact."] - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<String>, - #[serde( - rename = "configurationContributionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub configuration_contribution_id: Option<String>, - #[serde( - rename = "configurationContributionRelativeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub configuration_contribution_relative_id: Option<String>, - #[serde( - rename = "contentUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_uri: Option<String>, - #[doc = "The id of the underlying contribution defining the supplied Widget Configuration."] - #[serde( - rename = "contributionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub contribution_id: Option<String>, - #[doc = "Model of a Dashboard."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub dashboard: Option<Dashboard>, - #[serde(rename = "eTag", default, skip_serializing_if = "Option::is_none")] - pub e_tag: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_enabled: Option<bool>, - #[serde( - rename = "isNameConfigurable", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_name_configurable: Option<bool>, - #[doc = "Lightbox configuration"] - #[serde( - rename = "lightboxOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub lightbox_options: Option<LightboxOptions>, - #[serde( - rename = "loadingImageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub loading_image_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub position: Option<WidgetPosition>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option<String>, - #[doc = "versioning for an artifact as described at:<http://semver>.org/, of the form major.minor.patch."] - #[serde( - rename = "settingsVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub settings_version: Option<SemanticVersion>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<WidgetSize>, - #[serde(rename = "typeId", default, skip_serializing_if = "Option::is_none")] - pub type_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "Refers to the allowed sizes for the widget. This gets populated when user wants to configure the widget"] + #[serde( + rename = "allowedSizes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub allowed_sizes: Vec<WidgetSize>, + #[doc = "Read-Only Property from Dashboard Service. Indicates if settings are blocked for the current user."] + #[serde( + rename = "areSettingsBlockedForUser", + default, + skip_serializing_if = "Option::is_none" + )] + pub are_settings_blocked_for_user: Option<bool>, + #[doc = "Refers to unique identifier of a feature artifact. Used for pinning+unpinning a specific artifact."] + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<String>, + #[serde( + rename = "configurationContributionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub configuration_contribution_id: Option<String>, + #[serde( + rename = "configurationContributionRelativeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub configuration_contribution_relative_id: Option<String>, + #[serde( + rename = "contentUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_uri: Option<String>, + #[doc = "The id of the underlying contribution defining the supplied Widget Configuration."] + #[serde( + rename = "contributionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub contribution_id: Option<String>, + #[doc = "Model of a Dashboard."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dashboard: Option<Dashboard>, + #[serde(rename = "eTag", default, skip_serializing_if = "Option::is_none")] + pub e_tag: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option<bool>, + #[serde( + rename = "isNameConfigurable", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_name_configurable: Option<bool>, + #[doc = "Lightbox configuration"] + #[serde( + rename = "lightboxOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub lightbox_options: Option<LightboxOptions>, + #[serde( + rename = "loadingImageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub loading_image_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub position: Option<WidgetPosition>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub settings: Option<String>, + #[doc = "versioning for an artifact as described at:<http://semver>.org/, of the form major.minor.patch."] + #[serde( + rename = "settingsVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub settings_version: Option<SemanticVersion>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<WidgetSize>, + #[serde(rename = "typeId", default, skip_serializing_if = "Option::is_none")] + pub type_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Widget { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WidgetList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Widget>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Widget>, } impl WidgetList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contribution based information describing Dashboard Widgets."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WidgetMetadata { - #[doc = "Sizes supported by the Widget."] - #[serde( - rename = "allowedSizes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub allowed_sizes: Vec<WidgetSize>, - #[doc = "Opt-in boolean that indicates if the widget requires the Analytics Service to function. Widgets requiring the analytics service are hidden from the catalog if the Analytics Service is not available."] - #[serde( - rename = "analyticsServiceRequired", - default, - skip_serializing_if = "Option::is_none" - )] - pub analytics_service_required: Option<bool>, - #[doc = "Resource for an icon in the widget catalog."] - #[serde( - rename = "catalogIconUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub catalog_icon_url: Option<String>, - #[doc = "Opt-in URL string pointing at widget information. Defaults to extension marketplace URL if omitted"] - #[serde( - rename = "catalogInfoUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub catalog_info_url: Option<String>, - #[doc = "The id of the underlying contribution defining the supplied Widget custom configuration UI. Null if custom configuration UI is not available."] - #[serde( - rename = "configurationContributionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub configuration_contribution_id: Option<String>, - #[doc = "The relative id of the underlying contribution defining the supplied Widget custom configuration UI. Null if custom configuration UI is not available."] - #[serde( - rename = "configurationContributionRelativeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub configuration_contribution_relative_id: Option<String>, - #[doc = "Indicates if the widget requires configuration before being added to dashboard."] - #[serde( - rename = "configurationRequired", - default, - skip_serializing_if = "Option::is_none" - )] - pub configuration_required: Option<bool>, - #[doc = "Uri for the widget content to be loaded from ."] - #[serde( - rename = "contentUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_uri: Option<String>, - #[doc = "The id of the underlying contribution defining the supplied Widget."] - #[serde( - rename = "contributionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub contribution_id: Option<String>, - #[doc = "Optional default settings to be copied into widget settings."] - #[serde( - rename = "defaultSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_settings: Option<String>, - #[doc = "Summary information describing the widget."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Widgets can be disabled by the app store. We'll need to gracefully handle for: - persistence (Allow) - Requests (Tag as disabled, and provide context)"] - #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_enabled: Option<bool>, - #[doc = "Opt-out boolean that indicates if the widget supports widget name/title configuration. Widgets ignoring the name should set it to false in the manifest."] - #[serde( - rename = "isNameConfigurable", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_name_configurable: Option<bool>, - #[doc = "Opt-out boolean indicating if the widget is hidden from the catalog. Commonly, this is used to allow developers to disable creation of a deprecated widget. A widget must have a functional default state, or have a configuration experience, in order to be visible from the catalog."] - #[serde( - rename = "isVisibleFromCatalog", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_visible_from_catalog: Option<bool>, - #[doc = "Keywords associated with this widget, non-filterable and invisible"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub keywords: Vec<String>, - #[doc = "Lightbox configuration"] - #[serde( - rename = "lightboxOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub lightbox_options: Option<LightboxOptions>, - #[doc = "Resource for a loading placeholder image on dashboard"] - #[serde( - rename = "loadingImageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub loading_image_url: Option<String>, - #[doc = "User facing name of the widget type. Each widget must use a unique value here."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Publisher Name of this kind of widget."] - #[serde( - rename = "publisherName", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_name: Option<String>, - #[doc = "Data contract required for the widget to function and to work in its container."] - #[serde( - rename = "supportedScopes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub supported_scopes: Vec<serde_json::Value>, - #[doc = "Tags associated with this widget, visible on each widget and filterable."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[doc = "Contribution target IDs"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub targets: Vec<String>, - #[doc = "Deprecated: locally unique developer-facing id of this kind of widget. ContributionId provides a globally unique identifier for widget types."] - #[serde(rename = "typeId", default, skip_serializing_if = "Option::is_none")] - pub type_id: Option<String>, + #[doc = "Sizes supported by the Widget."] + #[serde( + rename = "allowedSizes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub allowed_sizes: Vec<WidgetSize>, + #[doc = "Opt-in boolean that indicates if the widget requires the Analytics Service to function. Widgets requiring the analytics service are hidden from the catalog if the Analytics Service is not available."] + #[serde( + rename = "analyticsServiceRequired", + default, + skip_serializing_if = "Option::is_none" + )] + pub analytics_service_required: Option<bool>, + #[doc = "Resource for an icon in the widget catalog."] + #[serde( + rename = "catalogIconUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub catalog_icon_url: Option<String>, + #[doc = "Opt-in URL string pointing at widget information. Defaults to extension marketplace URL if omitted"] + #[serde( + rename = "catalogInfoUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub catalog_info_url: Option<String>, + #[doc = "The id of the underlying contribution defining the supplied Widget custom configuration UI. Null if custom configuration UI is not available."] + #[serde( + rename = "configurationContributionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub configuration_contribution_id: Option<String>, + #[doc = "The relative id of the underlying contribution defining the supplied Widget custom configuration UI. Null if custom configuration UI is not available."] + #[serde( + rename = "configurationContributionRelativeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub configuration_contribution_relative_id: Option<String>, + #[doc = "Indicates if the widget requires configuration before being added to dashboard."] + #[serde( + rename = "configurationRequired", + default, + skip_serializing_if = "Option::is_none" + )] + pub configuration_required: Option<bool>, + #[doc = "Uri for the widget content to be loaded from ."] + #[serde( + rename = "contentUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_uri: Option<String>, + #[doc = "The id of the underlying contribution defining the supplied Widget."] + #[serde( + rename = "contributionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub contribution_id: Option<String>, + #[doc = "Optional default settings to be copied into widget settings."] + #[serde( + rename = "defaultSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_settings: Option<String>, + #[doc = "Summary information describing the widget."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Widgets can be disabled by the app store. We'll need to gracefully handle for: - persistence (Allow) - Requests (Tag as disabled, and provide context)"] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option<bool>, + #[doc = "Opt-out boolean that indicates if the widget supports widget name/title configuration. Widgets ignoring the name should set it to false in the manifest."] + #[serde( + rename = "isNameConfigurable", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_name_configurable: Option<bool>, + #[doc = "Opt-out boolean indicating if the widget is hidden from the catalog. Commonly, this is used to allow developers to disable creation of a deprecated widget. A widget must have a functional default state, or have a configuration experience, in order to be visible from the catalog."] + #[serde( + rename = "isVisibleFromCatalog", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_visible_from_catalog: Option<bool>, + #[doc = "Keywords associated with this widget, non-filterable and invisible"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub keywords: Vec<String>, + #[doc = "Lightbox configuration"] + #[serde( + rename = "lightboxOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub lightbox_options: Option<LightboxOptions>, + #[doc = "Resource for a loading placeholder image on dashboard"] + #[serde( + rename = "loadingImageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub loading_image_url: Option<String>, + #[doc = "User facing name of the widget type. Each widget must use a unique value here."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Publisher Name of this kind of widget."] + #[serde( + rename = "publisherName", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_name: Option<String>, + #[doc = "Data contract required for the widget to function and to work in its container."] + #[serde( + rename = "supportedScopes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub supported_scopes: Vec<serde_json::Value>, + #[doc = "Tags associated with this widget, visible on each widget and filterable."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[doc = "Contribution target IDs"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub targets: Vec<String>, + #[doc = "Deprecated: locally unique developer-facing id of this kind of widget. ContributionId provides a globally unique identifier for widget types."] + #[serde(rename = "typeId", default, skip_serializing_if = "Option::is_none")] + pub type_id: Option<String>, } impl WidgetMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WidgetMetadataResponse { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, - #[doc = "Contribution based information describing Dashboard Widgets."] - #[serde( - rename = "widgetMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub widget_metadata: Option<WidgetMetadata>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, + #[doc = "Contribution based information describing Dashboard Widgets."] + #[serde( + rename = "widgetMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub widget_metadata: Option<WidgetMetadata>, } impl WidgetMetadataResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WidgetPosition { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub column: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub row: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub column: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub row: Option<i32>, } impl WidgetPosition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Response from RestAPI when saving and editing Widget"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WidgetResponse { - #[serde(flatten)] - pub widget: Widget, + #[serde(flatten)] + pub widget: Widget, } impl WidgetResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WidgetSize { - #[doc = "The Width of the widget, expressed in dashboard grid columns."] - #[serde( - rename = "columnSpan", - default, - skip_serializing_if = "Option::is_none" - )] - pub column_span: Option<i32>, - #[doc = "The height of the widget, expressed in dashboard grid rows."] - #[serde(rename = "rowSpan", default, skip_serializing_if = "Option::is_none")] - pub row_span: Option<i32>, + #[doc = "The Width of the widget, expressed in dashboard grid columns."] + #[serde( + rename = "columnSpan", + default, + skip_serializing_if = "Option::is_none" + )] + pub column_span: Option<i32>, + #[doc = "The height of the widget, expressed in dashboard grid rows."] + #[serde(rename = "rowSpan", default, skip_serializing_if = "Option::is_none")] + pub row_span: Option<i32>, } impl WidgetSize { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WidgetTypesResponse { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, - #[serde( - rename = "widgetTypes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub widget_types: Vec<WidgetMetadata>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, + #[serde( + rename = "widgetTypes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub widget_types: Vec<WidgetMetadata>, } impl WidgetTypesResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Wrapper class to support HTTP header generation using CreateResponse, ClientHeaderParameter and ClientResponseType in WidgetV2Controller"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WidgetsVersionedList { - #[serde( - rename = "eTag", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub e_tag: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub widgets: Vec<Widget>, + #[serde( + rename = "eTag", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub e_tag: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub widgets: Vec<Widget>, } impl WidgetsVersionedList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/date_time.rs b/azure_devops_rust_api/src/date_time.rs index c1dda868..31d8df6b 100644 --- a/azure_devops_rust_api/src/date_time.rs +++ b/azure_devops_rust_api/src/date_time.rs @@ -17,210 +17,210 @@ use time::OffsetDateTime; /// Returns the given date-time as a String in RFC3339 format pub fn format_date_time(date_time: &OffsetDateTime) -> azure_core::error::Result<String> { - date_time - .format(&Rfc3339) - .with_context(ErrorKind::DataConversion, || { - format!("Failed to format date_time: {date_time}") - }) + date_time + .format(&Rfc3339) + .with_context(ErrorKind::DataConversion, || { + format!("Failed to format date_time: {date_time}") + }) } pub mod rfc3339 { - use super::*; + use super::*; - pub use time::serde::rfc3339::serialize; + pub use time::serde::rfc3339::serialize; - #[allow(dead_code)] - pub fn deserialize<'de, D>(d: D) -> Result<OffsetDateTime, D::Error> - where - D: de::Deserializer<'de>, - { - d.deserialize_str(DateTimeVisitor) - } + #[allow(dead_code)] + pub fn deserialize<'de, D>(d: D) -> Result<OffsetDateTime, D::Error> + where + D: de::Deserializer<'de>, + { + d.deserialize_str(DateTimeVisitor) + } - struct DateTimeVisitor; + struct DateTimeVisitor; - impl<'de> de::Visitor<'de> for DateTimeVisitor { - type Value = OffsetDateTime; + impl<'de> de::Visitor<'de> for DateTimeVisitor { + type Value = OffsetDateTime; - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "RFC3339 datetime string or 0001-01-01T00:00:00") - } + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "RFC3339 datetime string or 0001-01-01T00:00:00") + } - fn visit_str<E>(self, value: &str) -> Result<Self::Value, E> - where - E: de::Error, - { - let value = match value { - "0001-01-01T00:00:00" => "0001-01-01T00:00:00Z", - _ => value, - }; - - // Some services return a time without an offset, which is not RFC3339 compliant. - // If the parse fails, try adding a Z to the end and try again. - match OffsetDateTime::parse(value, &Rfc3339) { - Ok(dt) => Ok(dt), - Err(e) => { - if let Ok(dt) = OffsetDateTime::parse(&format!("{}Z", value), &Rfc3339) { - Ok(dt) - } else { - Err(E::custom(format!("Parse error {e} for {value}"))) - } - } - } + fn visit_str<E>(self, value: &str) -> Result<Self::Value, E> + where + E: de::Error, + { + let value = match value { + "0001-01-01T00:00:00" => "0001-01-01T00:00:00Z", + _ => value, + }; + + // Some services return a time without an offset, which is not RFC3339 compliant. + // If the parse fails, try adding a Z to the end and try again. + match OffsetDateTime::parse(value, &Rfc3339) { + Ok(dt) => Ok(dt), + Err(e) => { + if let Ok(dt) = OffsetDateTime::parse(&format!("{}Z", value), &Rfc3339) { + Ok(dt) + } else { + Err(E::custom(format!("Parse error {e} for {value}"))) + } } + } } + } - pub mod option { - use super::*; - pub use time::serde::rfc3339::option::serialize; + pub mod option { + use super::*; + pub use time::serde::rfc3339::option::serialize; - #[allow(dead_code)] - pub fn deserialize<'de, D>(d: D) -> Result<Option<OffsetDateTime>, D::Error> - where - D: de::Deserializer<'de>, - { - d.deserialize_option(OptionalDateTimeVisitor) - } + #[allow(dead_code)] + pub fn deserialize<'de, D>(d: D) -> Result<Option<OffsetDateTime>, D::Error> + where + D: de::Deserializer<'de>, + { + d.deserialize_option(OptionalDateTimeVisitor) + } - struct OptionalDateTimeVisitor; + struct OptionalDateTimeVisitor; - impl<'de> de::Visitor<'de> for OptionalDateTimeVisitor { - type Value = Option<OffsetDateTime>; + impl<'de> de::Visitor<'de> for OptionalDateTimeVisitor { + type Value = Option<OffsetDateTime>; - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "null or a datetime string") - } + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "null or a datetime string") + } - fn visit_none<E>(self) -> Result<Self::Value, E> - where - E: de::Error, - { - Ok(None) - } + fn visit_none<E>(self) -> Result<Self::Value, E> + where + E: de::Error, + { + Ok(None) + } - fn visit_some<D>(self, d: D) -> Result<Option<OffsetDateTime>, D::Error> - where - D: de::Deserializer<'de>, - { - Ok(Some(d.deserialize_str(DateTimeVisitor)?)) - } - } + fn visit_some<D>(self, d: D) -> Result<Option<OffsetDateTime>, D::Error> + where + D: de::Deserializer<'de>, + { + Ok(Some(d.deserialize_str(DateTimeVisitor)?)) + } } + } } #[cfg(test)] mod tests { - use super::*; - use azure_core::error::{ErrorKind, ResultExt}; - use serde::{Deserialize, Serialize}; - use serde_json; - - pub fn parse_rfc3339(s: &str) -> azure_core::Result<OffsetDateTime> { - OffsetDateTime::parse(s, &Rfc3339).with_context(ErrorKind::DataConversion, || { - format!("unable to parse rfc3339 date '{s}") - }) - } - - #[derive(Serialize, Deserialize)] - struct ExampleState { - #[serde(with = "crate::date_time::rfc3339")] - created_time: time::OffsetDateTime, - - #[serde(default, with = "crate::date_time::rfc3339::option")] - deleted_time: Option<time::OffsetDateTime>, - } - - #[test] - fn test_serde_datetime() { - let json_state = r#"{ + use super::*; + use azure_core::error::{ErrorKind, ResultExt}; + use serde::{Deserialize, Serialize}; + use serde_json; + + pub fn parse_rfc3339(s: &str) -> azure_core::Result<OffsetDateTime> { + OffsetDateTime::parse(s, &Rfc3339).with_context(ErrorKind::DataConversion, || { + format!("unable to parse rfc3339 date '{s}") + }) + } + + #[derive(Serialize, Deserialize)] + struct ExampleState { + #[serde(with = "crate::date_time::rfc3339")] + created_time: time::OffsetDateTime, + + #[serde(default, with = "crate::date_time::rfc3339::option")] + deleted_time: Option<time::OffsetDateTime>, + } + + #[test] + fn test_serde_datetime() { + let json_state = r#"{ "created_time": "2021-07-01T10:45:02Z" }"#; - let state: ExampleState = serde_json::from_str(json_state).unwrap(); - assert_eq!( - parse_rfc3339("2021-07-01T10:45:02Z").unwrap(), - state.created_time - ); - assert_eq!(state.deleted_time, None); - } - - #[test] - fn test_serde_datetime_beginning_of_time_without_offset() { - let json_state = r#"{ + let state: ExampleState = serde_json::from_str(json_state).unwrap(); + assert_eq!( + parse_rfc3339("2021-07-01T10:45:02Z").unwrap(), + state.created_time + ); + assert_eq!(state.deleted_time, None); + } + + #[test] + fn test_serde_datetime_beginning_of_time_without_offset() { + let json_state = r#"{ "created_time": "0001-01-01T00:00:00" }"#; - let state: ExampleState = serde_json::from_str(json_state).unwrap(); - assert_eq!( - parse_rfc3339("0001-01-01T00:00:00Z").unwrap(), - state.created_time - ); - assert_eq!(state.deleted_time, None); - } - - #[test] - fn test_serde_datetime_beginning_of_time_with_offset() { - let json_state = r#"{ + let state: ExampleState = serde_json::from_str(json_state).unwrap(); + assert_eq!( + parse_rfc3339("0001-01-01T00:00:00Z").unwrap(), + state.created_time + ); + assert_eq!(state.deleted_time, None); + } + + #[test] + fn test_serde_datetime_beginning_of_time_with_offset() { + let json_state = r#"{ "created_time": "0001-01-01T00:00:00Z" }"#; - let state: ExampleState = serde_json::from_str(json_state).unwrap(); - assert_eq!( - state.created_time, - parse_rfc3339("0001-01-01T00:00:00Z").unwrap() - ); - assert_eq!(state.deleted_time, None); - } - - #[test] - fn test_serde_datetime_invalid_time() { - let json_state = r#"{ + let state: ExampleState = serde_json::from_str(json_state).unwrap(); + assert_eq!( + state.created_time, + parse_rfc3339("0001-01-01T00:00:00Z").unwrap() + ); + assert_eq!(state.deleted_time, None); + } + + #[test] + fn test_serde_datetime_invalid_time() { + let json_state = r#"{ "created_time": "0002-01-01T00:0000" }"#; - let result: Result<ExampleState, _> = serde_json::from_str(json_state); - assert!(result.is_err()); - } + let result: Result<ExampleState, _> = serde_json::from_str(json_state); + assert!(result.is_err()); + } - #[test] - fn test_serde_datetime_without_offset() { - let json_state = r#"{ + #[test] + fn test_serde_datetime_without_offset() { + let json_state = r#"{ "created_time": "2023-05-03T20:09:17.5460824" }"#; - let state: ExampleState = serde_json::from_str(json_state).unwrap(); - assert_eq!( - state.created_time, - parse_rfc3339("2023-05-03T20:09:17.5460824Z").unwrap() - ); - } - - #[test] - fn test_serde_datetime_optional_time() { - let json_state = r#"{ + let state: ExampleState = serde_json::from_str(json_state).unwrap(); + assert_eq!( + state.created_time, + parse_rfc3339("2023-05-03T20:09:17.5460824Z").unwrap() + ); + } + + #[test] + fn test_serde_datetime_optional_time() { + let json_state = r#"{ "created_time": "2022-03-04T00:01:02Z", "deleted_time": "2022-03-04T01:02:03Z" }"#; - let state: ExampleState = serde_json::from_str(json_state).unwrap(); - assert_eq!( - state.created_time, - parse_rfc3339("2022-03-04T00:01:02Z").unwrap() - ); - assert_eq!( - state.deleted_time, - Some(parse_rfc3339("2022-03-04T01:02:03Z").unwrap()) - ); - } - - #[test] - fn test_serde_datetime_optional_beginning_of_time() { - let json_state = r#"{ + let state: ExampleState = serde_json::from_str(json_state).unwrap(); + assert_eq!( + state.created_time, + parse_rfc3339("2022-03-04T00:01:02Z").unwrap() + ); + assert_eq!( + state.deleted_time, + Some(parse_rfc3339("2022-03-04T01:02:03Z").unwrap()) + ); + } + + #[test] + fn test_serde_datetime_optional_beginning_of_time() { + let json_state = r#"{ "created_time": "2022-03-04T00:01:02Z", "deleted_time": "0001-01-01T00:00:00" }"#; - let state: ExampleState = serde_json::from_str(json_state).unwrap(); - assert_eq!( - state.created_time, - parse_rfc3339("2022-03-04T00:01:02Z").unwrap() - ); - assert_eq!( - state.deleted_time, - Some(parse_rfc3339("0001-01-01T00:00:00Z").unwrap()) - ); - } + let state: ExampleState = serde_json::from_str(json_state).unwrap(); + assert_eq!( + state.created_time, + parse_rfc3339("2022-03-04T00:01:02Z").unwrap() + ); + assert_eq!( + state.deleted_time, + Some(parse_rfc3339("0001-01-01T00:00:00Z").unwrap()) + ); + } } diff --git a/azure_devops_rust_api/src/distributed_task/mod.rs b/azure_devops_rust_api/src/distributed_task/mod.rs index 8c27b32c..0fdccec8 100644 --- a/azure_devops_rust_api/src/distributed_task/mod.rs +++ b/azure_devops_rust_api/src/distributed_task/mod.rs @@ -9,8518 +9,8591 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, + scopes: Vec<String>, options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + 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 kubernetes_client(&self) -> kubernetes::Client { + kubernetes::Client(self.clone()) + } + pub fn nodes_client(&self) -> nodes::Client { + nodes::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 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()) + } +} +pub mod pools { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of agent pools."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get_agent_pools( + &self, + organization: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `pool_ids`: pool Ids to fetch"] + pub fn get_agent_pools_by_ids( + &self, + organization: impl Into<String>, + pool_ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Details about the new agent pool"] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::TaskAgentPool>, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Get information about an agent pool."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `pool_id`: An agent pool ID"] + pub fn get(&self, organization: impl Into<String>, 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Updated agent pool details"] + #[doc = "* `pool_id`: The agent pool to update"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TaskAgentPool>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `pool_id`: ID of the agent pool to delete"] + pub fn delete(&self, organization: impl Into<String>, pool_id: i32) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_id, + } + } + } + pub mod get_agent_pools { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentPoolList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentPoolList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) pool_name: Option<String>, + pub(crate) properties: Option<String>, + pub(crate) pool_type: Option<String>, + pub(crate) action_filter: Option<String>, + } + impl RequestBuilder { + #[doc = "Filter by name"] + pub fn pool_name(mut self, pool_name: impl Into<String>) -> Self { + self.pool_name = Some(pool_name.into()); + self + } + #[doc = "Filter by agent pool properties (comma-separated)"] + pub fn properties(mut self, properties: impl Into<String>) -> Self { + self.properties = Some(properties.into()); + self + } + #[doc = "Filter by pool type"] + pub fn pool_type(mut self, pool_type: impl Into<String>) -> Self { + self.pool_type = Some(pool_type.into()); + self + } + #[doc = "Filter by whether the calling user has use or manage permissions"] + pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools?", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + if let Some(action_filter) = &this.action_filter { + req + .url_mut() + .query_pairs_mut() + .append_pair("actionFilter", action_filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentPoolList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentPoolList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_agent_pools_by_ids { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentPoolList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentPoolList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) pool_ids: String, + pub(crate) action_filter: Option<String>, + } + impl RequestBuilder { + #[doc = "Filter by whether the calling user has use or manage permissions"] + pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentPoolList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentPoolList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentPool> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentPool = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TaskAgentPool, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentPool>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentPool>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentPool> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentPool = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) pool_id: i32, + pub(crate) properties: Option<String>, + pub(crate) action_filter: Option<String>, + } + impl RequestBuilder { + #[doc = "Agent pool properties (comma-separated)"] + pub fn properties(mut self, properties: impl Into<String>) -> Self { + self.properties = Some(properties.into()); + self + } + #[doc = "Filter by whether the calling user has use or manage permissions"] + pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}", + this.client.endpoint(), + &this.organization, + &this.pool_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentPool>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentPool>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentPool> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentPool = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TaskAgentPool, + pub(crate) pool_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}", + this.client.endpoint(), + &this.organization, + &this.pool_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentPool>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentPool>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) pool_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}", + this.client.endpoint(), + &this.organization, + &this.pool_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod queues { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of agent queues by their names"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `queue_names`: A comma-separated list of agent names to retrieve"] + #[doc = "* `project`: Project ID or project name"] + pub fn get_agent_queues_by_names( + &self, + organization: impl Into<String>, + queue_names: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `queue_ids`: A comma-separated list of agent queue IDs to retrieve"] + #[doc = "* `project`: Project ID or project name"] + pub fn get_agent_queues_by_ids( + &self, + organization: impl Into<String>, + queue_ids: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_agent_queues( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `pool_ids`: A comma-separated list of pool ids to get the corresponding queues for"] + #[doc = "* `project`: Project ID or project name"] + pub fn get_agent_queues_for_pools( + &self, + organization: impl Into<String>, + pool_ids: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Details about the queue to create"] + #[doc = "* `project`: Project ID or project name"] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::TaskAgentQueue>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `queue_id`: The agent queue to get information about"] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + queue_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `queue_id`: The agent queue to remove"] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + queue_id: i32, + project: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + queue_id, + project: project.into(), + } + } + } + pub mod get_agent_queues_by_names { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentQueueList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentQueueList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) queue_names: String, + pub(crate) project: String, + pub(crate) action_filter: Option<String>, + } + impl RequestBuilder { + #[doc = "Filter by whether the calling user has use or manage permissions"] + pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues?queueNames={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.queue_names + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentQueueList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentQueueList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_agent_queues_by_ids { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentQueueList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentQueueList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) queue_ids: String, + pub(crate) project: String, + pub(crate) action_filter: Option<String>, + } + impl RequestBuilder { + #[doc = "Filter by whether the calling user has use or manage permissions"] + pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues?queueIds={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.queue_ids + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentQueueList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentQueueList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_agent_queues { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentQueueList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentQueueList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) queue_name: Option<String>, + pub(crate) action_filter: Option<String>, + } + impl RequestBuilder { + #[doc = "Filter on the agent queue name"] + pub fn queue_name(mut self, queue_name: impl Into<String>) -> Self { + self.queue_name = Some(queue_name.into()); + self + } + #[doc = "Filter by whether the calling user has use or manage permissions"] + pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues?", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentQueueList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentQueueList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_agent_queues_for_pools { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentQueueList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentQueueList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) pool_ids: String, + pub(crate) project: String, + pub(crate) action_filter: Option<String>, + } + impl RequestBuilder { + #[doc = "Filter by whether the calling user has use or manage permissions"] + pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentQueueList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentQueueList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentQueue> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentQueue = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TaskAgentQueue, + pub(crate) project: String, + pub(crate) authorize_pipelines: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentQueue>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentQueue>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentQueue> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentQueue = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) queue_id: i32, + pub(crate) project: String, + pub(crate) action_filter: Option<String>, + } + impl RequestBuilder { + #[doc = "Filter by whether the calling user has use or manage permissions"] + pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.queue_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(action_filter) = &this.action_filter { + req + .url_mut() + .query_pairs_mut() + .append_pair("actionFilter", action_filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentQueue>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentQueue>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) queue_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.queue_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod variablegroups { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get variable groups."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_variable_groups( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::VariableGroupParameters>, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Add a variable group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn share_variable_group( + &self, + organization: impl Into<String>, + body: Vec<models::VariableGroupProjectReference>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `group_id`: Id of the variable group to update."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::VariableGroupParameters>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `group_id`: Id of the variable group."] + pub fn delete( + &self, + organization: impl Into<String>, + group_id: i32, + project_ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `group_ids`: Comma separated list of Ids of variable groups."] + pub fn get_variable_groups_by_id( + &self, + organization: impl Into<String>, + project: impl Into<String>, + group_ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `group_id`: Id of the variable group."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + group_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + group_id, + } + } + } + pub mod get_variable_groups { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::VariableGroupList> { + let bytes = self.0.into_body().collect().await?; + let body: models::VariableGroupList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) group_name: Option<String>, + pub(crate) action_filter: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<i32>, + pub(crate) query_order: Option<String>, + } + impl RequestBuilder { + #[doc = "Name of variable group."] + pub fn group_name(mut self, group_name: impl Into<String>) -> Self { + self.group_name = Some(group_name.into()); + self + } + #[doc = "Action filter for the variable group. It specifies the action which can be performed on the variable groups."] + pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { + self.action_filter = Some(action_filter.into()); + self + } + #[doc = "Number of variable groups to get."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Gets the variable groups after the continuation token provided."] + pub fn continuation_token(mut self, continuation_token: i32) -> Self { + self.continuation_token = Some(continuation_token); + self + } + #[doc = "Gets the results in the defined order. Default is 'IdDescending'."] + pub fn query_order(mut self, query_order: impl Into<String>) -> Self { + self.query_order = Some(query_order.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/variablegroups?", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::VariableGroupList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::VariableGroupList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::VariableGroup> { + let bytes = self.0.into_body().collect().await?; + let body: models::VariableGroup = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::VariableGroupParameters, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/variablegroups", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::VariableGroup>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::VariableGroup>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod share_variable_group { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::VariableGroupProjectReference>, + pub(crate) variable_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/variablegroups", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::VariableGroup> { + let bytes = self.0.into_body().collect().await?; + let body: models::VariableGroup = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/variablegroups/{}", + this.client.endpoint(), + &this.organization, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::VariableGroup>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::VariableGroup>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) group_id: i32, + pub(crate) project_ids: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/variablegroups/{}", + this.client.endpoint(), + &this.organization, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let project_ids = &this.project_ids; + req + .url_mut() + .query_pairs_mut() + .append_pair("projectIds", project_ids); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_variable_groups_by_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::VariableGroupList> { + let bytes = self.0.into_body().collect().await?; + let body: models::VariableGroupList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) group_ids: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/variablegroups", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let group_ids = &this.group_ids; + req + .url_mut() + .query_pairs_mut() + .append_pair("groupIds", group_ids); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::VariableGroupList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::VariableGroupList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::VariableGroup> { + let bytes = self.0.into_body().collect().await?; + let body: models::VariableGroup = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/variablegroups/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::VariableGroup>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::VariableGroup>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod agentclouds { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::TaskAgentCloud>, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get(&self, organization: impl Into<String>, agent_cloud_id: i32) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + agent_cloud_id, + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TaskAgentCloud>, + agent_cloud_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + agent_cloud_id, + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn delete( + &self, + organization: impl Into<String>, + agent_cloud_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + agent_cloud_id, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloudList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentCloudList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/agentclouds", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentCloudList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentCloudList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloud> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentCloud = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TaskAgentCloud, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/agentclouds", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentCloud>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentCloud>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloud> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentCloud = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/agentclouds/{}", + this.client.endpoint(), + &this.organization, + &this.agent_cloud_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentCloud>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentCloud>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloud> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentCloud = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TaskAgentCloud, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/agentclouds/{}", + this.client.endpoint(), + &this.organization, + &this.agent_cloud_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentCloud>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentCloud>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloud> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentCloud = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/agentclouds/{}", + this.client.endpoint(), + &this.organization, + &this.agent_cloud_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentCloud>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentCloud>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod requests { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list( + &self, + organization: impl Into<String>, + agent_cloud_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + agent_cloud_id, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloudRequestList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentCloudRequestList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/agentclouds/{}/requests", + this.client.endpoint(), + &this.organization, + &this.agent_cloud_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentCloudRequestList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentCloudRequestList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod agentcloudtypes { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get agent cloud types."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloudTypeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentCloudTypeList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/agentcloudtypes", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentCloudTypeList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentCloudTypeList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod agents { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of agents."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `pool_id`: The agent pool containing the agents"] + pub fn list(&self, organization: impl Into<String>, 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Details about the agent being added"] + #[doc = "* `pool_id`: The agent pool in which to add the agent"] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::TaskAgent>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `pool_id`: The agent pool containing the agent"] + #[doc = "* `agent_id`: The agent ID to get information about"] + pub fn get( + &self, + organization: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Updated details about the replacing agent"] + #[doc = "* `pool_id`: The agent pool to use"] + #[doc = "* `agent_id`: The agent to replace"] + pub fn replace_agent( + &self, + organization: impl Into<String>, + body: impl Into<models::TaskAgent>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Updated details about the agent"] + #[doc = "* `pool_id`: The agent pool to use"] + #[doc = "* `agent_id`: The agent to update"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TaskAgent>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `pool_id`: The pool ID to remove the agent from"] + #[doc = "* `agent_id`: The agent ID to remove"] + pub fn delete( + &self, + organization: impl Into<String>, + pool_id: i32, + agent_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_id, + agent_id, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgentList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) pool_id: i32, + pub(crate) agent_name: Option<String>, + pub(crate) include_capabilities: Option<bool>, + pub(crate) include_assigned_request: Option<bool>, + pub(crate) include_last_completed_request: Option<bool>, + pub(crate) property_filters: Option<String>, + pub(crate) demands: Option<String>, + } + impl RequestBuilder { + #[doc = "Filter on agent name"] + pub fn agent_name(mut self, agent_name: impl Into<String>) -> Self { + self.agent_name = Some(agent_name.into()); + self + } + #[doc = "Whether to include the agents' capabilities in the response"] + pub fn include_capabilities(mut self, include_capabilities: bool) -> Self { + self.include_capabilities = Some(include_capabilities); + self + } + #[doc = "Whether to include details about the agents' current work"] + pub fn include_assigned_request(mut self, include_assigned_request: bool) -> Self { + self.include_assigned_request = Some(include_assigned_request); + self + } + #[doc = "Whether to include details about the agents' most recent completed work"] + pub fn include_last_completed_request( + mut self, + include_last_completed_request: bool, + ) -> Self { + self.include_last_completed_request = Some(include_last_completed_request); + self + } + #[doc = "Filter which custom properties will be returned"] + pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { + self.property_filters = Some(property_filters.into()); + self + } + #[doc = "Filter by demands the agents can satisfy"] + pub fn demands(mut self, demands: impl Into<String>) -> Self { + self.demands = Some(demands.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}/agents", + this.client.endpoint(), + &this.organization, + &this.pool_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgent> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgent = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TaskAgent, + pub(crate) pool_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}/agents", + this.client.endpoint(), + &this.organization, + &this.pool_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgent>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgent>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgent> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgent = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) pool_id: i32, + pub(crate) agent_id: i32, + pub(crate) include_capabilities: Option<bool>, + pub(crate) include_assigned_request: Option<bool>, + pub(crate) include_last_completed_request: Option<bool>, + pub(crate) property_filters: Option<String>, + } + 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); + self + } + #[doc = "Whether to include details about the agent's current work"] + pub fn include_assigned_request(mut self, include_assigned_request: bool) -> Self { + self.include_assigned_request = Some(include_assigned_request); + self + } + #[doc = "Whether to include details about the agents' most recent completed work"] + pub fn include_last_completed_request( + mut self, + include_last_completed_request: bool, + ) -> Self { + self.include_last_completed_request = Some(include_last_completed_request); + self + } + #[doc = "Filter which custom properties will be returned"] + pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { + self.property_filters = Some(property_filters.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}/agents/{}", + this.client.endpoint(), + &this.organization, + &this.pool_id, + &this.agent_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgent>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgent>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod replace_agent { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgent> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgent = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TaskAgent, + pub(crate) pool_id: i32, + pub(crate) agent_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}/agents/{}", + this.client.endpoint(), + &this.organization, + &this.pool_id, + &this.agent_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgent>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgent>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskAgent> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskAgent = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TaskAgent, + pub(crate) pool_id: i32, + pub(crate) agent_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}/agents/{}", + this.client.endpoint(), + &this.organization, + &this.pool_id, + &this.agent_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskAgent>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgent>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) pool_id: i32, + pub(crate) agent_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}/agents/{}", + this.client.endpoint(), + &this.organization, + &this.pool_id, + &this.agent_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } -pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; -impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self +pub mod yamlschema { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "GET the Yaml schema used for Yaml file validation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get(&self, organization: impl Into<String>) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + validate_task_names: None, + } } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<serde_json::Value> { + let bytes = self.0.into_body().collect().await?; + let body: serde_json::Value = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) validate_task_names: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/yamlschema", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(validate_task_names) = &this.validate_task_names { + req + .url_mut() + .query_pairs_mut() + .append_pair("validateTaskNames", &validate_task_names.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<serde_json::Value>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<serde_json::Value>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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 kubernetes_client(&self) -> kubernetes::Client { - kubernetes::Client(self.clone()) - } - pub fn nodes_client(&self) -> nodes::Client { - nodes::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 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()) +pub mod deploymentgroups { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of deployment groups by name or IDs."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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, + } } -} -pub mod pools { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of agent pools."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get_agent_pools( - &self, - organization: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `pool_ids`: pool Ids to fetch"] - pub fn get_agent_pools_by_ids( - &self, - organization: impl Into<String>, - pool_ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Details about the new agent pool"] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::TaskAgentPool>, - ) -> add::RequestBuilder { - add::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - #[doc = "Get information about an agent pool."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `pool_id`: An agent pool ID"] - pub fn get(&self, organization: impl Into<String>, 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Updated agent pool details"] - #[doc = "* `pool_id`: The agent pool to update"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TaskAgentPool>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `pool_id`: ID of the agent pool to delete"] - pub fn delete( - &self, - organization: impl Into<String>, - pool_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - pool_id, - } - } - } - pub mod get_agent_pools { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentPoolList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentPoolList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) pool_name: Option<String>, - pub(crate) properties: Option<String>, - pub(crate) pool_type: Option<String>, - pub(crate) action_filter: Option<String>, - } - impl RequestBuilder { - #[doc = "Filter by name"] - pub fn pool_name(mut self, pool_name: impl Into<String>) -> Self { - self.pool_name = Some(pool_name.into()); - self - } - #[doc = "Filter by agent pool properties (comma-separated)"] - pub fn properties(mut self, properties: impl Into<String>) -> Self { - self.properties = Some(properties.into()); - self - } - #[doc = "Filter by pool type"] - pub fn pool_type(mut self, pool_type: impl Into<String>) -> Self { - self.pool_type = Some(pool_type.into()); - self - } - #[doc = "Filter by whether the calling user has use or manage permissions"] - pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools?", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", action_filter); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentPoolList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentPoolList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_agent_pools_by_ids { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentPoolList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentPoolList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) pool_ids: String, - pub(crate) action_filter: Option<String>, - } - impl RequestBuilder { - #[doc = "Filter by whether the calling user has use or manage permissions"] - pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentPoolList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentPoolList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentPool> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentPool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TaskAgentPool, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentPool>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentPool>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentPool> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentPool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) pool_id: i32, - pub(crate) properties: Option<String>, - pub(crate) action_filter: Option<String>, - } - impl RequestBuilder { - #[doc = "Agent pool properties (comma-separated)"] - pub fn properties(mut self, properties: impl Into<String>) -> Self { - self.properties = Some(properties.into()); - self - } - #[doc = "Filter by whether the calling user has use or manage permissions"] - pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}", - this.client.endpoint(), - &this.organization, - &this.pool_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentPool>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentPool>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentPool> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentPool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TaskAgentPool, - pub(crate) pool_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}", - this.client.endpoint(), - &this.organization, - &this.pool_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentPool>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentPool>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) pool_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}", - this.client.endpoint(), - &this.organization, - &this.pool_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + #[doc = "Create a deployment group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Deployment group to create."] + #[doc = "* `project`: Project ID or project name"] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::DeploymentGroupCreateParameter>, + project: impl Into<String>, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } } -} -pub mod queues { + #[doc = "Get a deployment group by its ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `deployment_group_id`: ID of the deployment group."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Deployment group to update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `deployment_group_id`: ID of the deployment group."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::DeploymentGroupUpdateParameter>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `deployment_group_id`: ID of the deployment group to be deleted."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + deployment_group_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + deployment_group_id, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of agent queues by their names"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `queue_names`: A comma-separated list of agent names to retrieve"] - #[doc = "* `project`: Project ID or project name"] - pub fn get_agent_queues_by_names( - &self, - organization: impl Into<String>, - queue_names: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `queue_ids`: A comma-separated list of agent queue IDs to retrieve"] - #[doc = "* `project`: Project ID or project name"] - pub fn get_agent_queues_by_ids( - &self, - organization: impl Into<String>, - queue_ids: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_agent_queues( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `pool_ids`: A comma-separated list of pool ids to get the corresponding queues for"] - #[doc = "* `project`: Project ID or project name"] - pub fn get_agent_queues_for_pools( - &self, - organization: impl Into<String>, - pool_ids: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Details about the queue to create"] - #[doc = "* `project`: Project ID or project name"] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::TaskAgentQueue>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `queue_id`: The agent queue to get information about"] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - queue_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `queue_id`: The agent queue to remove"] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - queue_id: i32, - project: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - queue_id, - project: project.into(), - } - } - } - pub mod get_agent_queues_by_names { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentQueueList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentQueueList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) queue_names: String, - pub(crate) project: String, - pub(crate) action_filter: Option<String>, - } - impl RequestBuilder { - #[doc = "Filter by whether the calling user has use or manage permissions"] - pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues?queueNames={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.queue_names - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentQueueList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentQueueList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_agent_queues_by_ids { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentQueueList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentQueueList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) queue_ids: String, - pub(crate) project: String, - pub(crate) action_filter: Option<String>, - } - impl RequestBuilder { - #[doc = "Filter by whether the calling user has use or manage permissions"] - pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues?queueIds={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.queue_ids - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentQueueList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentQueueList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_agent_queues { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentQueueList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentQueueList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) queue_name: Option<String>, - pub(crate) action_filter: Option<String>, - } - impl RequestBuilder { - #[doc = "Filter on the agent queue name"] - pub fn queue_name(mut self, queue_name: impl Into<String>) -> Self { - self.queue_name = Some(queue_name.into()); - self - } - #[doc = "Filter by whether the calling user has use or manage permissions"] - pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues?", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentQueueList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentQueueList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_agent_queues_for_pools { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentQueueList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentQueueList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) pool_ids: String, - pub(crate) project: String, - pub(crate) action_filter: Option<String>, - } - impl RequestBuilder { - #[doc = "Filter by whether the calling user has use or manage permissions"] - pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentQueueList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentQueueList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentQueue> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentQueue = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TaskAgentQueue, - pub(crate) project: String, - pub(crate) authorize_pipelines: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentQueue>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentQueue>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentQueue> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentQueue = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) queue_id: i32, - pub(crate) project: String, - pub(crate) action_filter: Option<String>, - } - impl RequestBuilder { - #[doc = "Filter by whether the calling user has use or manage permissions"] - pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.queue_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", action_filter); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentQueue>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentQueue>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) queue_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.queue_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DeploymentGroupList> { + let bytes = self.0.into_body().collect().await?; + let body: models::DeploymentGroupList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod variablegroups { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) name: Option<String>, + pub(crate) action_filter: Option<String>, + pub(crate) expand: Option<String>, + pub(crate) continuation_token: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) ids: Option<String>, + } + impl RequestBuilder { + #[doc = "Name of the deployment group."] + pub fn name(mut self, name: impl Into<String>) -> Self { + self.name = Some(name.into()); + self + } + #[doc = "Get only deployment groups on which this action can be performed."] + pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { + self.action_filter = Some(action_filter.into()); + self + } + #[doc = "Include these additional details in the returned objects."] + pub fn expand(mut self, expand: impl Into<String>) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "Get deployment groups with names greater than this continuation token lexicographically."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "Maximum number of deployment groups to return. Default is **1000**."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Comma separated list of IDs of the deployment groups."] + pub fn ids(mut self, ids: impl Into<String>) -> Self { + self.ids = Some(ids.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DeploymentGroupList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentGroupList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get variable groups."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_variable_groups( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::VariableGroupParameters>, - ) -> add::RequestBuilder { - add::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - #[doc = "Add a variable group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn share_variable_group( - &self, - organization: impl Into<String>, - body: Vec<models::VariableGroupProjectReference>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `group_id`: Id of the variable group to update."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::VariableGroupParameters>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `group_id`: Id of the variable group."] - pub fn delete( - &self, - organization: impl Into<String>, - group_id: i32, - project_ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `group_ids`: Comma separated list of Ids of variable groups."] - pub fn get_variable_groups_by_id( - &self, - organization: impl Into<String>, - project: impl Into<String>, - group_ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `group_id`: Id of the variable group."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - group_id: i32, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - group_id, - } - } - } - pub mod get_variable_groups { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::VariableGroupList> { - let bytes = self.0.into_body().collect().await?; - let body: models::VariableGroupList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) group_name: Option<String>, - pub(crate) action_filter: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<i32>, - pub(crate) query_order: Option<String>, - } - impl RequestBuilder { - #[doc = "Name of variable group."] - pub fn group_name(mut self, group_name: impl Into<String>) -> Self { - self.group_name = Some(group_name.into()); - self - } - #[doc = "Action filter for the variable group. It specifies the action which can be performed on the variable groups."] - pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { - self.action_filter = Some(action_filter.into()); - self - } - #[doc = "Number of variable groups to get."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Gets the variable groups after the continuation token provided."] - pub fn continuation_token(mut self, continuation_token: i32) -> Self { - self.continuation_token = Some(continuation_token); - self - } - #[doc = "Gets the results in the defined order. Default is 'IdDescending'."] - pub fn query_order(mut self, query_order: impl Into<String>) -> Self { - self.query_order = Some(query_order.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/variablegroups?", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::VariableGroupList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::VariableGroupList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::VariableGroup> { - let bytes = self.0.into_body().collect().await?; - let body: models::VariableGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::VariableGroupParameters, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/variablegroups", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::VariableGroup>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::VariableGroup>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod share_variable_group { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::VariableGroupProjectReference>, - pub(crate) variable_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/variablegroups", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::VariableGroup> { - let bytes = self.0.into_body().collect().await?; - let body: models::VariableGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/variablegroups/{}", - this.client.endpoint(), - &this.organization, - &this.group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::VariableGroup>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::VariableGroup>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) group_id: i32, - pub(crate) project_ids: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/variablegroups/{}", - this.client.endpoint(), - &this.organization, - &this.group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let project_ids = &this.project_ids; - req.url_mut() - .query_pairs_mut() - .append_pair("projectIds", project_ids); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_variable_groups_by_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::VariableGroupList> { - let bytes = self.0.into_body().collect().await?; - let body: models::VariableGroupList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) group_ids: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/variablegroups", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let group_ids = &this.group_ids; - req.url_mut() - .query_pairs_mut() - .append_pair("groupIds", group_ids); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::VariableGroupList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::VariableGroupList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::VariableGroup> { - let bytes = self.0.into_body().collect().await?; - let body: models::VariableGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/variablegroups/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::VariableGroup>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::VariableGroup>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DeploymentGroup> { + let bytes = self.0.into_body().collect().await?; + let body: models::DeploymentGroup = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod agentclouds { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::DeploymentGroupCreateParameter, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DeploymentGroup>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentGroup>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::TaskAgentCloud>, - ) -> add::RequestBuilder { - add::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get( - &self, - organization: impl Into<String>, - agent_cloud_id: i32, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - agent_cloud_id, - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TaskAgentCloud>, - agent_cloud_id: i32, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - agent_cloud_id, - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn delete( - &self, - organization: impl Into<String>, - agent_cloud_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - agent_cloud_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloudList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloudList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/agentclouds", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentCloudList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentCloudList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloud> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloud = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TaskAgentCloud, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/agentclouds", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentCloud>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentCloud>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloud> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloud = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/agentclouds/{}", - this.client.endpoint(), - &this.organization, - &this.agent_cloud_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentCloud>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentCloud>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloud> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloud = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TaskAgentCloud, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/agentclouds/{}", - this.client.endpoint(), - &this.organization, - &this.agent_cloud_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentCloud>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentCloud>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloud> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloud = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/agentclouds/{}", - this.client.endpoint(), - &this.organization, - &this.agent_cloud_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentCloud>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentCloud>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DeploymentGroup> { + let bytes = self.0.into_body().collect().await?; + let body: models::DeploymentGroup = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod requests { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) deployment_group_id: i32, + pub(crate) action_filter: Option<String>, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "Get the deployment group only if this action can be performed on it."] + pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { + self.action_filter = Some(action_filter.into()); + self + } + #[doc = "Include these additional details in the returned object."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.deployment_group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(action_filter) = &this.action_filter { + req + .url_mut() + .query_pairs_mut() + .append_pair("actionFilter", action_filter); + } + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DeploymentGroup>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentGroup>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list( - &self, - organization: impl Into<String>, - agent_cloud_id: i32, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - agent_cloud_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloudRequestList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloudRequestList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/agentclouds/{}/requests", - this.client.endpoint(), - &this.organization, - &this.agent_cloud_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentCloudRequestList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TaskAgentCloudRequestList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DeploymentGroup> { + let bytes = self.0.into_body().collect().await?; + let body: models::DeploymentGroup = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod agentcloudtypes { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::DeploymentGroupUpdateParameter, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.deployment_group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DeploymentGroup>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentGroup>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get agent cloud types."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentCloudTypeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentCloudTypeList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/agentcloudtypes", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentCloudTypeList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TaskAgentCloudTypeList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.deployment_group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } -pub mod agents { +pub mod targets { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of deployment targets in a deployment group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `deployment_group_id`: ID of the deployment group."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Deployment targets with tags to udpdate."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `deployment_group_id`: ID of the deployment group in which deployment targets are updated."] + pub fn update( + &self, + organization: impl Into<String>, + body: Vec<models::DeploymentTargetUpdateParameter>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `deployment_group_id`: ID of the deployment group to which deployment target belongs."] + #[doc = "* `target_id`: ID of the deployment target to return."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `deployment_group_id`: ID of the deployment group in which deployment target is deleted."] + #[doc = "* `target_id`: ID of the deployment target to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of agents."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `pool_id`: The agent pool containing the agents"] - pub fn list(&self, organization: impl Into<String>, 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Details about the agent being added"] - #[doc = "* `pool_id`: The agent pool in which to add the agent"] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::TaskAgent>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `pool_id`: The agent pool containing the agent"] - #[doc = "* `agent_id`: The agent ID to get information about"] - pub fn get( - &self, - organization: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Updated details about the replacing agent"] - #[doc = "* `pool_id`: The agent pool to use"] - #[doc = "* `agent_id`: The agent to replace"] - pub fn replace_agent( - &self, - organization: impl Into<String>, - body: impl Into<models::TaskAgent>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Updated details about the agent"] - #[doc = "* `pool_id`: The agent pool to use"] - #[doc = "* `agent_id`: The agent to update"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TaskAgent>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `pool_id`: The pool ID to remove the agent from"] - #[doc = "* `agent_id`: The agent ID to remove"] - pub fn delete( - &self, - organization: impl Into<String>, - pool_id: i32, - agent_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - pool_id, - agent_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) pool_id: i32, - pub(crate) agent_name: Option<String>, - pub(crate) include_capabilities: Option<bool>, - pub(crate) include_assigned_request: Option<bool>, - pub(crate) include_last_completed_request: Option<bool>, - pub(crate) property_filters: Option<String>, - pub(crate) demands: Option<String>, - } - impl RequestBuilder { - #[doc = "Filter on agent name"] - pub fn agent_name(mut self, agent_name: impl Into<String>) -> Self { - self.agent_name = Some(agent_name.into()); - self - } - #[doc = "Whether to include the agents' capabilities in the response"] - pub fn include_capabilities(mut self, include_capabilities: bool) -> Self { - self.include_capabilities = Some(include_capabilities); - self - } - #[doc = "Whether to include details about the agents' current work"] - pub fn include_assigned_request(mut self, include_assigned_request: bool) -> Self { - self.include_assigned_request = Some(include_assigned_request); - self - } - #[doc = "Whether to include details about the agents' most recent completed work"] - pub fn include_last_completed_request( - mut self, - include_last_completed_request: bool, - ) -> Self { - self.include_last_completed_request = Some(include_last_completed_request); - self - } - #[doc = "Filter which custom properties will be returned"] - pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { - self.property_filters = Some(property_filters.into()); - self - } - #[doc = "Filter by demands the agents can satisfy"] - pub fn demands(mut self, demands: impl Into<String>) -> Self { - self.demands = Some(demands.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}/agents", - this.client.endpoint(), - &this.organization, - &this.pool_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgentList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgentList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgent> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgent = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TaskAgent, - pub(crate) pool_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}/agents", - this.client.endpoint(), - &this.organization, - &this.pool_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgent>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgent>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgent> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgent = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) pool_id: i32, - pub(crate) agent_id: i32, - pub(crate) include_capabilities: Option<bool>, - pub(crate) include_assigned_request: Option<bool>, - pub(crate) include_last_completed_request: Option<bool>, - pub(crate) property_filters: Option<String>, - } - 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); - self - } - #[doc = "Whether to include details about the agent's current work"] - pub fn include_assigned_request(mut self, include_assigned_request: bool) -> Self { - self.include_assigned_request = Some(include_assigned_request); - self - } - #[doc = "Whether to include details about the agents' most recent completed work"] - pub fn include_last_completed_request( - mut self, - include_last_completed_request: bool, - ) -> Self { - self.include_last_completed_request = Some(include_last_completed_request); - self - } - #[doc = "Filter which custom properties will be returned"] - pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { - self.property_filters = Some(property_filters.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}/agents/{}", - this.client.endpoint(), - &this.organization, - &this.pool_id, - &this.agent_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgent>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgent>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod replace_agent { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgent> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgent = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TaskAgent, - pub(crate) pool_id: i32, - pub(crate) agent_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}/agents/{}", - this.client.endpoint(), - &this.organization, - &this.pool_id, - &this.agent_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgent>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgent>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskAgent> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskAgent = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TaskAgent, - pub(crate) pool_id: i32, - pub(crate) agent_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}/agents/{}", - this.client.endpoint(), - &this.organization, - &this.pool_id, - &this.agent_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskAgent>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskAgent>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) pool_id: i32, - pub(crate) agent_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}/agents/{}", - this.client.endpoint(), - &this.organization, - &this.pool_id, - &this.agent_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DeploymentMachineList> { + let bytes = self.0.into_body().collect().await?; + let body: models::DeploymentMachineList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod yamlschema { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) deployment_group_id: i32, + pub(crate) tags: Option<String>, + pub(crate) name: Option<String>, + pub(crate) partial_name_match: Option<bool>, + pub(crate) expand: Option<String>, + pub(crate) agent_status: Option<String>, + pub(crate) agent_job_result: Option<String>, + pub(crate) continuation_token: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) enabled: Option<bool>, + pub(crate) property_filters: Option<String>, + } + 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<String>) -> Self { + self.tags = Some(tags.into()); + self + } + #[doc = "Name pattern of the deployment targets to return."] + pub fn name(mut self, name: impl Into<String>) -> Self { + self.name = Some(name.into()); + self + } + #[doc = "When set to true, treats **name** as pattern. Else treats it as absolute match. Default is **false**."] + pub fn partial_name_match(mut self, partial_name_match: bool) -> Self { + self.partial_name_match = Some(partial_name_match); + self + } + #[doc = "Include these additional details in the returned objects."] + pub fn expand(mut self, expand: impl Into<String>) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "Get only deployment targets that have this status."] + pub fn agent_status(mut self, agent_status: impl Into<String>) -> Self { + self.agent_status = Some(agent_status.into()); + self + } + #[doc = "Get only deployment targets that have this last job result."] + pub fn agent_job_result(mut self, agent_job_result: impl Into<String>) -> Self { + self.agent_job_result = Some(agent_job_result.into()); + self + } + #[doc = "Get deployment targets with names greater than this continuation token lexicographically."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "Maximum number of deployment targets to return. Default is **1000**."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Get only deployment targets that are enabled or disabled. Default is 'null' which returns all the targets."] + pub fn enabled(mut self, enabled: bool) -> Self { + self.enabled = Some(enabled); + self + } + pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { + self.property_filters = Some(property_filters.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets", + this.client.endpoint(), + &this.organization, + &this.project, + &this.deployment_group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + if let Some(agent_status) = &this.agent_status { + req + .url_mut() + .query_pairs_mut() + .append_pair("agentStatus", agent_status); + } + if let Some(agent_job_result) = &this.agent_job_result { + req + .url_mut() + .query_pairs_mut() + .append_pair("agentJobResult", agent_job_result); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DeploymentMachineList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentMachineList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "GET the Yaml schema used for Yaml file validation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get(&self, organization: impl Into<String>) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - validate_task_names: None, - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<serde_json::Value> { - let bytes = self.0.into_body().collect().await?; - let body: serde_json::Value = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) validate_task_names: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/yamlschema", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(validate_task_names) = &this.validate_task_names { - req.url_mut() - .query_pairs_mut() - .append_pair("validateTaskNames", &validate_task_names.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<serde_json::Value>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<serde_json::Value>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DeploymentMachineList> { + let bytes = self.0.into_body().collect().await?; + let body: models::DeploymentMachineList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod deploymentgroups { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::DeploymentTargetUpdateParameter>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets", + this.client.endpoint(), + &this.organization, + &this.project, + &this.deployment_group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DeploymentMachineList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentMachineList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of deployment groups by name or IDs."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Deployment group to create."] - #[doc = "* `project`: Project ID or project name"] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::DeploymentGroupCreateParameter>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `deployment_group_id`: ID of the deployment group."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Deployment group to update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `deployment_group_id`: ID of the deployment group."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::DeploymentGroupUpdateParameter>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `deployment_group_id`: ID of the deployment group to be deleted."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - deployment_group_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - deployment_group_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DeploymentGroupList> { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentGroupList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) name: Option<String>, - pub(crate) action_filter: Option<String>, - pub(crate) expand: Option<String>, - pub(crate) continuation_token: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) ids: Option<String>, - } - impl RequestBuilder { - #[doc = "Name of the deployment group."] - pub fn name(mut self, name: impl Into<String>) -> Self { - self.name = Some(name.into()); - self - } - #[doc = "Get only deployment groups on which this action can be performed."] - pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { - self.action_filter = Some(action_filter.into()); - self - } - #[doc = "Include these additional details in the returned objects."] - pub fn expand(mut self, expand: impl Into<String>) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Get deployment groups with names greater than this continuation token lexicographically."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Maximum number of deployment groups to return. Default is **1000**."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Comma separated list of IDs of the deployment groups."] - pub fn ids(mut self, ids: impl Into<String>) -> Self { - self.ids = Some(ids.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DeploymentGroupList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::DeploymentGroupList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DeploymentGroup> { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentGroup = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::DeploymentGroupCreateParameter, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DeploymentGroup>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentGroup>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DeploymentGroup> { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentGroup = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) deployment_group_id: i32, - pub(crate) action_filter: Option<String>, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "Get the deployment group only if this action can be performed on it."] - pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self { - self.action_filter = Some(action_filter.into()); - self - } - #[doc = "Include these additional details in the returned object."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.deployment_group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", action_filter); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DeploymentGroup>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentGroup>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DeploymentGroup> { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentGroup = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::DeploymentGroupUpdateParameter, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.deployment_group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DeploymentGroup>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentGroup>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.deployment_group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DeploymentMachine> { + let bytes = self.0.into_body().collect().await?; + let body: models::DeploymentMachine = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod targets { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) deployment_group_id: i32, + pub(crate) target_id: i32, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "Include these additional details in the returned objects."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.deployment_group_id, + &this.target_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DeploymentMachine>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentMachine>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of deployment targets in a deployment group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `deployment_group_id`: ID of the deployment group."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Deployment targets with tags to udpdate."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `deployment_group_id`: ID of the deployment group in which deployment targets are updated."] - pub fn update( - &self, - organization: impl Into<String>, - body: Vec<models::DeploymentTargetUpdateParameter>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `deployment_group_id`: ID of the deployment group to which deployment target belongs."] - #[doc = "* `target_id`: ID of the deployment target to return."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `deployment_group_id`: ID of the deployment group in which deployment target is deleted."] - #[doc = "* `target_id`: ID of the deployment target to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DeploymentMachineList> { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentMachineList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) deployment_group_id: i32, - pub(crate) tags: Option<String>, - pub(crate) name: Option<String>, - pub(crate) partial_name_match: Option<bool>, - pub(crate) expand: Option<String>, - pub(crate) agent_status: Option<String>, - pub(crate) agent_job_result: Option<String>, - pub(crate) continuation_token: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) enabled: Option<bool>, - pub(crate) property_filters: Option<String>, - } - 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<String>) -> Self { - self.tags = Some(tags.into()); - self - } - #[doc = "Name pattern of the deployment targets to return."] - pub fn name(mut self, name: impl Into<String>) -> Self { - self.name = Some(name.into()); - self - } - #[doc = "When set to true, treats **name** as pattern. Else treats it as absolute match. Default is **false**."] - pub fn partial_name_match(mut self, partial_name_match: bool) -> Self { - self.partial_name_match = Some(partial_name_match); - self - } - #[doc = "Include these additional details in the returned objects."] - pub fn expand(mut self, expand: impl Into<String>) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Get only deployment targets that have this status."] - pub fn agent_status(mut self, agent_status: impl Into<String>) -> Self { - self.agent_status = Some(agent_status.into()); - self - } - #[doc = "Get only deployment targets that have this last job result."] - pub fn agent_job_result(mut self, agent_job_result: impl Into<String>) -> Self { - self.agent_job_result = Some(agent_job_result.into()); - self - } - #[doc = "Get deployment targets with names greater than this continuation token lexicographically."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Maximum number of deployment targets to return. Default is **1000**."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Get only deployment targets that are enabled or disabled. Default is 'null' which returns all the targets."] - pub fn enabled(mut self, enabled: bool) -> Self { - self.enabled = Some(enabled); - self - } - pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { - self.property_filters = Some(property_filters.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets", - this.client.endpoint(), - &this.organization, - &this.project, - &this.deployment_group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - if let Some(agent_status) = &this.agent_status { - req.url_mut() - .query_pairs_mut() - .append_pair("agentStatus", agent_status); - } - if let Some(agent_job_result) = &this.agent_job_result { - req.url_mut() - .query_pairs_mut() - .append_pair("agentJobResult", agent_job_result); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DeploymentMachineList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::DeploymentMachineList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DeploymentMachineList> { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentMachineList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::DeploymentTargetUpdateParameter>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets", - this.client.endpoint(), - &this.organization, - &this.project, - &this.deployment_group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DeploymentMachineList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::DeploymentMachineList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DeploymentMachine> { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentMachine = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) deployment_group_id: i32, - pub(crate) target_id: i32, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "Include these additional details in the returned objects."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.deployment_group_id, - &this.target_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DeploymentMachine>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentMachine>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) deployment_group_id: i32, - pub(crate) target_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.deployment_group_id, - &this.target_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) deployment_group_id: i32, + pub(crate) target_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.deployment_group_id, + &this.target_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } pub mod environments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all environments."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Environment to create."] + #[doc = "* `project`: Project ID or project name"] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::EnvironmentCreateParameter>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `environment_id`: ID of the environment."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Environment data to update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `environment_id`: ID of the environment."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::EnvironmentUpdateParameter>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `environment_id`: ID of the environment."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + environment_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + environment_id, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::EnvironmentInstanceList> { + let bytes = self.0.into_body().collect().await?; + let body: models::EnvironmentInstanceList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) name: Option<String>, + pub(crate) continuation_token: Option<String>, + pub(crate) top: Option<i32>, + } + impl RequestBuilder { + pub fn name(mut self, name: impl Into<String>) -> Self { + self.name = Some(name.into()); + self + } + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::EnvironmentInstanceList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::EnvironmentInstanceList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::EnvironmentInstance> { + let bytes = self.0.into_body().collect().await?; + let body: models::EnvironmentInstance = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::EnvironmentCreateParameter, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::EnvironmentInstance>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::EnvironmentInstance>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::EnvironmentInstance> { + let bytes = self.0.into_body().collect().await?; + let body: models::EnvironmentInstance = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) environment_id: i32, + pub(crate) expands: Option<String>, + } + impl RequestBuilder { + #[doc = "Include these additional details in the returned objects."] + pub fn expands(mut self, expands: impl Into<String>) -> Self { + self.expands = Some(expands.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.environment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expands) = &this.expands { + req + .url_mut() + .query_pairs_mut() + .append_pair("expands", expands); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::EnvironmentInstance>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::EnvironmentInstance>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::EnvironmentInstance> { + let bytes = self.0.into_body().collect().await?; + let body: models::EnvironmentInstance = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::EnvironmentUpdateParameter, + pub(crate) project: String, + pub(crate) environment_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.environment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::EnvironmentInstance>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::EnvironmentInstance>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get all environments."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Environment to create."] - #[doc = "* `project`: Project ID or project name"] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::EnvironmentCreateParameter>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `environment_id`: ID of the environment."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Environment data to update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `environment_id`: ID of the environment."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::EnvironmentUpdateParameter>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `environment_id`: ID of the environment."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - environment_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - environment_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::EnvironmentInstanceList> { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentInstanceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) name: Option<String>, - pub(crate) continuation_token: Option<String>, - pub(crate) top: Option<i32>, - } - impl RequestBuilder { - pub fn name(mut self, name: impl Into<String>) -> Self { - self.name = Some(name.into()); - self - } - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::EnvironmentInstanceList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::EnvironmentInstanceList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::EnvironmentInstance> { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentInstance = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::EnvironmentCreateParameter, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::EnvironmentInstance>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::EnvironmentInstance>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::EnvironmentInstance> { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentInstance = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) environment_id: i32, - pub(crate) expands: Option<String>, - } - impl RequestBuilder { - #[doc = "Include these additional details in the returned objects."] - pub fn expands(mut self, expands: impl Into<String>) -> Self { - self.expands = Some(expands.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.environment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expands) = &this.expands { - req.url_mut() - .query_pairs_mut() - .append_pair("expands", expands); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::EnvironmentInstance>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::EnvironmentInstance>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::EnvironmentInstance> { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentInstance = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::EnvironmentUpdateParameter, - pub(crate) project: String, - pub(crate) environment_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.environment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::EnvironmentInstance>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::EnvironmentInstance>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) environment_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.environment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) environment_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.environment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod environmentdeployment_records { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get environment deployment execution history"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get environment deployment execution history"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::EnvironmentDeploymentExecutionRecordList> { - let bytes = self.0.into_body().collect().await?; - let body: models::EnvironmentDeploymentExecutionRecordList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) environment_id: i32, - pub(crate) continuation_token: Option<String>, - pub(crate) top: Option<i32>, - } - impl RequestBuilder { - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/distributedtask/environments/{}/environmentdeploymentrecords" , this . client . endpoint () , & this . organization , & this . project , & this . environment_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::EnvironmentDeploymentExecutionRecordList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::EnvironmentDeploymentExecutionRecordList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::EnvironmentDeploymentExecutionRecordList> { + let bytes = self.0.into_body().collect().await?; + let body: models::EnvironmentDeploymentExecutionRecordList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) environment_id: i32, + pub(crate) continuation_token: Option<String>, + pub(crate) top: Option<i32>, + } + impl RequestBuilder { + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}/environmentdeploymentrecords", + this.client.endpoint(), + &this.organization, + &this.project, + &this.environment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::EnvironmentDeploymentExecutionRecordList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::EnvironmentDeploymentExecutionRecordList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod kubernetes { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::KubernetesResourceCreateParameters>, + project: impl Into<String>, + environment_id: i32, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + environment_id, + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::KubernetesResource> { + let bytes = self.0.into_body().collect().await?; + let body: models::KubernetesResource = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::KubernetesResourceCreateParameters, + pub(crate) project: String, + pub(crate) environment_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes", + this.client.endpoint(), + &this.organization, + &this.project, + &this.environment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::KubernetesResource>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::KubernetesResource>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::KubernetesResource> { + let bytes = self.0.into_body().collect().await?; + let body: models::KubernetesResource = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) environment_id: i32, + pub(crate) resource_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.environment_id, + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::KubernetesResource>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::KubernetesResource>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::KubernetesResourceCreateParameters>, - project: impl Into<String>, - environment_id: i32, - ) -> add::RequestBuilder { - add::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - environment_id, - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::KubernetesResource> { - let bytes = self.0.into_body().collect().await?; - let body: models::KubernetesResource = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::KubernetesResourceCreateParameters, - pub(crate) project: String, - pub(crate) environment_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes", - this.client.endpoint(), - &this.organization, - &this.project, - &this.environment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::KubernetesResource>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::KubernetesResource>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::KubernetesResource> { - let bytes = self.0.into_body().collect().await?; - let body: models::KubernetesResource = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) environment_id: i32, - pub(crate) resource_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes/{}" , this . client . endpoint () , & this . organization , & this . project , & this . environment_id , & this . resource_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::KubernetesResource>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::KubernetesResource>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) environment_id: i32, - pub(crate) resource_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes/{}" , this . client . endpoint () , & this . organization , & this . project , & this . environment_id , & this . resource_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) environment_id: i32, + pub(crate) resource_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.environment_id, + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod taskgroups { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Create a task group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Task group object to create."] + #[doc = "* `project`: Project ID or project name"] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::TaskGroupCreateParameter>, + project: impl Into<String>, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "List task groups."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `task_group_id`: Id of the task group."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + task_group_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Task group to update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `task_group_id`: Id of the task group to update."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TaskGroupUpdateParameter>, + project: impl Into<String>, + task_group_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `task_group_id`: Id of the task group to be deleted."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + task_group_id: impl Into<String>, + ) -> 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 add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskGroup> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskGroup = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TaskGroupCreateParameter, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/taskgroups", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskGroup>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TaskGroup>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskGroupList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskGroupList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) task_group_id: String, + pub(crate) expanded: Option<bool>, + pub(crate) task_id_filter: Option<String>, + pub(crate) deleted: Option<bool>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<time::OffsetDateTime>, + pub(crate) query_order: Option<String>, + } + impl RequestBuilder { + #[doc = "'true' to recursively expand task groups. Default is 'false'."] + pub fn expanded(mut self, expanded: bool) -> Self { + self.expanded = Some(expanded); + self + } + #[doc = "Guid of the taskId to filter."] + pub fn task_id_filter(mut self, task_id_filter: impl Into<String>) -> Self { + self.task_id_filter = Some(task_id_filter.into()); + self + } + #[doc = "'true'to include deleted task groups. Default is 'false'."] + pub fn deleted(mut self, deleted: bool) -> Self { + self.deleted = Some(deleted); + self + } + #[doc = "Number of task groups to get."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Gets the task groups after the continuation token provided."] + pub fn continuation_token( + mut self, + continuation_token: impl Into<time::OffsetDateTime>, + ) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "Gets the results in the defined order. Default is 'CreatedOnDescending'."] + pub fn query_order(mut self, query_order: impl Into<String>) -> Self { + self.query_order = Some(query_order.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/taskgroups/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.task_group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskGroupList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskGroupList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskGroup> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskGroup = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TaskGroupUpdateParameter, + pub(crate) project: String, + pub(crate) task_group_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/taskgroups/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.task_group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskGroup>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TaskGroup>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Create a task group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Task group object to create."] - #[doc = "* `project`: Project ID or project name"] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::TaskGroupCreateParameter>, - project: impl Into<String>, - ) -> add::RequestBuilder { - add::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - #[doc = "List task groups."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `task_group_id`: Id of the task group."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - task_group_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Task group to update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `task_group_id`: Id of the task group to update."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TaskGroupUpdateParameter>, - project: impl Into<String>, - task_group_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `task_group_id`: Id of the task group to be deleted."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - task_group_id: impl Into<String>, - ) -> 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 add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskGroup> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TaskGroupCreateParameter, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/taskgroups", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskGroup>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskGroup>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskGroupList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskGroupList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) task_group_id: String, - pub(crate) expanded: Option<bool>, - pub(crate) task_id_filter: Option<String>, - pub(crate) deleted: Option<bool>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<time::OffsetDateTime>, - pub(crate) query_order: Option<String>, - } - impl RequestBuilder { - #[doc = "'true' to recursively expand task groups. Default is 'false'."] - pub fn expanded(mut self, expanded: bool) -> Self { - self.expanded = Some(expanded); - self - } - #[doc = "Guid of the taskId to filter."] - pub fn task_id_filter(mut self, task_id_filter: impl Into<String>) -> Self { - self.task_id_filter = Some(task_id_filter.into()); - self - } - #[doc = "'true'to include deleted task groups. Default is 'false'."] - pub fn deleted(mut self, deleted: bool) -> Self { - self.deleted = Some(deleted); - self - } - #[doc = "Number of task groups to get."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Gets the task groups after the continuation token provided."] - pub fn continuation_token( - mut self, - continuation_token: impl Into<time::OffsetDateTime>, - ) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Gets the results in the defined order. Default is 'CreatedOnDescending'."] - pub fn query_order(mut self, query_order: impl Into<String>) -> Self { - self.query_order = Some(query_order.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/taskgroups/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.task_group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskGroupList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskGroupList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskGroup> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TaskGroupUpdateParameter, - pub(crate) project: String, - pub(crate) task_group_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/taskgroups/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.task_group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskGroup>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskGroup>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) task_group_id: String, - pub(crate) comment: Option<String>, - } - impl RequestBuilder { - #[doc = "Comments to delete."] - pub fn comment(mut self, comment: impl Into<String>) -> Self { - self.comment = Some(comment.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/taskgroups/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.task_group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(comment) = &this.comment { - req.url_mut() - .query_pairs_mut() - .append_pair("comment", comment); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) task_group_id: String, + pub(crate) comment: Option<String>, + } + impl RequestBuilder { + #[doc = "Comments to delete."] + pub fn comment(mut self, comment: impl Into<String>) -> Self { + self.comment = Some(comment.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/taskgroups/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.task_group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(comment) = &this.comment { + req + .url_mut() + .query_pairs_mut() + .append_pair("comment", comment); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod elasticpools { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of all Elastic Pools."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Elastic pool to create. Contains the properties necessary for configuring a new ElasticPool."] + #[doc = "* `pool_name`: Name to use for the new TaskAgentPool"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::ElasticPool>, + pool_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `pool_id`: Pool Id of the associated TaskAgentPool"] + pub fn get(&self, organization: impl Into<String>, 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: New Elastic Pool settings data"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::ElasticPoolSettings>, + pool_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + pool_id, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ElasticPoolList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ElasticPoolList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/elasticpools", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ElasticPoolList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ElasticPoolList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ElasticPoolCreationResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::ElasticPoolCreationResult = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ElasticPool, + pub(crate) pool_name: String, + pub(crate) authorize_all_pipelines: Option<bool>, + pub(crate) auto_provision_project_pools: Option<bool>, + pub(crate) project_id: Option<String>, + } + 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); + self + } + #[doc = "Setting to automatically provision TaskAgentQueues in every project for the new pool."] + pub fn auto_provision_project_pools(mut self, auto_provision_project_pools: bool) -> Self { + self.auto_provision_project_pools = Some(auto_provision_project_pools); + self + } + #[doc = "Optional: If provided, a new TaskAgentQueue will be created in the specified project."] + pub fn project_id(mut self, project_id: impl Into<String>) -> Self { + self.project_id = Some(project_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/elasticpools", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ElasticPoolCreationResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ElasticPoolCreationResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ElasticPool> { + let bytes = self.0.into_body().collect().await?; + let body: models::ElasticPool = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) pool_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/elasticpools/{}", + this.client.endpoint(), + &this.organization, + &this.pool_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ElasticPool>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ElasticPool>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of all Elastic Pools."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Elastic pool to create. Contains the properties necessary for configuring a new ElasticPool."] - #[doc = "* `pool_name`: Name to use for the new TaskAgentPool"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::ElasticPool>, - pool_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `pool_id`: Pool Id of the associated TaskAgentPool"] - pub fn get(&self, organization: impl Into<String>, 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: New Elastic Pool settings data"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::ElasticPoolSettings>, - pool_id: i32, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - pool_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ElasticPoolList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticPoolList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/elasticpools", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ElasticPoolList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ElasticPoolList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ElasticPoolCreationResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticPoolCreationResult = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ElasticPool, - pub(crate) pool_name: String, - pub(crate) authorize_all_pipelines: Option<bool>, - pub(crate) auto_provision_project_pools: Option<bool>, - pub(crate) project_id: Option<String>, - } - 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); - self - } - #[doc = "Setting to automatically provision TaskAgentQueues in every project for the new pool."] - pub fn auto_provision_project_pools( - mut self, - auto_provision_project_pools: bool, - ) -> Self { - self.auto_provision_project_pools = Some(auto_provision_project_pools); - self - } - #[doc = "Optional: If provided, a new TaskAgentQueue will be created in the specified project."] - pub fn project_id(mut self, project_id: impl Into<String>) -> Self { - self.project_id = Some(project_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/elasticpools", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ElasticPoolCreationResult>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ElasticPoolCreationResult>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ElasticPool> { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticPool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) pool_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/elasticpools/{}", - this.client.endpoint(), - &this.organization, - &this.pool_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ElasticPool>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ElasticPool>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ElasticPool> { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticPool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ElasticPoolSettings, - pub(crate) pool_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/elasticpools/{}", - this.client.endpoint(), - &this.organization, - &this.pool_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ElasticPool>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ElasticPool>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ElasticPool> { + let bytes = self.0.into_body().collect().await?; + let body: models::ElasticPool = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ElasticPoolSettings, + pub(crate) pool_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/elasticpools/{}", + this.client.endpoint(), + &this.organization, + &this.pool_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ElasticPool>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ElasticPool>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod elasticpoollogs { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get elastic pool diagnostics logs for a specified Elastic Pool."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `pool_id`: Pool Id of the Elastic Pool"] + pub fn list(&self, organization: impl Into<String>, pool_id: i32) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_id, + top: None, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get elastic pool diagnostics logs for a specified Elastic Pool."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `pool_id`: Pool Id of the Elastic Pool"] - pub fn list(&self, organization: impl Into<String>, pool_id: i32) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - pool_id, - top: None, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ElasticPoolLogList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticPoolLogList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) pool_id: i32, - pub(crate) top: Option<i32>, - } - impl RequestBuilder { - #[doc = "Number of elastic pool logs to retrieve"] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/elasticpools/{}/logs", - this.client.endpoint(), - &this.organization, - &this.pool_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ElasticPoolLogList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ElasticPoolLogList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ElasticPoolLogList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ElasticPoolLogList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) pool_id: i32, + pub(crate) top: Option<i32>, + } + impl RequestBuilder { + #[doc = "Number of elastic pool logs to retrieve"] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/elasticpools/{}/logs", + this.client.endpoint(), + &this.organization, + &this.pool_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(top) = &this.top { + req + .url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ElasticPoolLogList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ElasticPoolLogList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod nodes { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of ElasticNodes currently in the ElasticPool"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `pool_id`: Pool id of the ElasticPool"] + pub fn list(&self, organization: impl Into<String>, 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::ElasticNodeSettings>, + 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, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ElasticNodeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ElasticNodeList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) pool_id: i32, + pub(crate) state: Option<String>, + } + impl RequestBuilder { + #[doc = "Optional: Filter to only retrieve ElasticNodes in the given ElasticNodeState"] + pub fn state(mut self, state: impl Into<String>) -> Self { + self.state = Some(state.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/elasticpools/{}/nodes", + this.client.endpoint(), + &this.organization, + &this.pool_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(state) = &this.state { + req.url_mut().query_pairs_mut().append_pair("$state", state); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ElasticNodeList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ElasticNodeList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of ElasticNodes currently in the ElasticPool"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `pool_id`: Pool id of the ElasticPool"] - pub fn list(&self, organization: impl Into<String>, 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::ElasticNodeSettings>, - 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, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ElasticNodeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticNodeList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) pool_id: i32, - pub(crate) state: Option<String>, - } - impl RequestBuilder { - #[doc = "Optional: Filter to only retrieve ElasticNodes in the given ElasticNodeState"] - pub fn state(mut self, state: impl Into<String>) -> Self { - self.state = Some(state.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/elasticpools/{}/nodes", - this.client.endpoint(), - &this.organization, - &this.pool_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(state) = &this.state { - req.url_mut().query_pairs_mut().append_pair("$state", state); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ElasticNodeList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ElasticNodeList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ElasticNode> { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticNode = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ElasticNodeSettings, - pub(crate) pool_id: i32, - pub(crate) elastic_node_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/distributedtask/elasticpools/{}/nodes/{}", - this.client.endpoint(), - &this.organization, - &this.pool_id, - &this.elastic_node_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ElasticNode>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ElasticNode>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ElasticNode> { + let bytes = self.0.into_body().collect().await?; + let body: models::ElasticNode = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ElasticNodeSettings, + pub(crate) pool_id: i32, + pub(crate) elastic_node_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/distributedtask/elasticpools/{}/nodes/{}", + this.client.endpoint(), + &this.organization, + &this.pool_id, + &this.elastic_node_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ElasticNode>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ElasticNode>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/distributed_task/models.rs b/azure_devops_rust_api/src/distributed_task/models.rs index f7a536b6..8d7b724e 100644 --- a/azure_devops_rust_api/src/distributed_task/models.rs +++ b/azure_devops_rust_api/src/distributed_task/models.rs @@ -8,7990 +8,7833 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AadOauthTokenRequest { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub refresh: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option<String>, - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub token: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub refresh: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option<String>, + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option<String>, } impl AadOauthTokenRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AadOauthTokenResult { - #[serde( - rename = "accessToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub access_token: Option<String>, - #[serde( - rename = "refreshTokenCache", - default, - skip_serializing_if = "Option::is_none" - )] - pub refresh_token_cache: Option<String>, + #[serde( + rename = "accessToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub access_token: Option<String>, + #[serde( + rename = "refreshTokenCache", + default, + skip_serializing_if = "Option::is_none" + )] + pub refresh_token_cache: Option<String>, } impl AadOauthTokenResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentChangeEvent { - #[doc = "A task agent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub agent: Option<TaskAgent>, - #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] - pub event_type: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pool: Option<TaskAgentPoolReference>, + #[doc = "A task agent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub agent: Option<TaskAgent>, + #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] + pub event_type: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pool: Option<TaskAgentPoolReference>, } impl AgentChangeEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentJobRequestMessage { - #[serde(flatten)] - pub job_request_message: JobRequestMessage, - #[serde( - rename = "lockedUntil", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub locked_until: Option<time::OffsetDateTime>, - #[serde(rename = "lockToken", default, skip_serializing_if = "Option::is_none")] - pub lock_token: Option<String>, - #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] - pub request_id: Option<i64>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tasks: Vec<TaskInstance>, + #[serde(flatten)] + pub job_request_message: JobRequestMessage, + #[serde( + rename = "lockedUntil", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub locked_until: Option<time::OffsetDateTime>, + #[serde(rename = "lockToken", default, skip_serializing_if = "Option::is_none")] + pub lock_token: Option<String>, + #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] + pub request_id: Option<i64>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tasks: Vec<TaskInstance>, } impl AgentJobRequestMessage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentPoolEvent { - #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] - pub event_type: Option<String>, - #[doc = "An organization-level grouping of agents."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pool: Option<TaskAgentPool>, + #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] + pub event_type: Option<String>, + #[doc = "An organization-level grouping of agents."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pool: Option<TaskAgentPool>, } impl AgentPoolEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentQueueEvent { - #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] - pub event_type: Option<String>, - #[doc = "An agent queue."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub queue: Option<TaskAgentQueue>, + #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] + pub event_type: Option<String>, + #[doc = "An agent queue."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub queue: Option<TaskAgentQueue>, } impl AgentQueueEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentQueuesEvent { - #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] - pub event_type: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub queues: Vec<TaskAgentQueue>, + #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] + pub event_type: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub queues: Vec<TaskAgentQueue>, } impl AgentQueuesEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentRefreshMessage { - #[serde(rename = "agentId", default, skip_serializing_if = "Option::is_none")] - pub agent_id: Option<i32>, - #[serde( - rename = "targetVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_version: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option<String>, + #[serde(rename = "agentId", default, skip_serializing_if = "Option::is_none")] + pub agent_id: Option<i32>, + #[serde( + rename = "targetVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_version: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout: Option<String>, } impl AgentRefreshMessage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuthenticationSchemeReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option<serde_json::Value>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inputs: Option<serde_json::Value>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl AuthenticationSchemeReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuthorizationHeader { - #[doc = "Gets or sets the name of authorization header."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the value of authorization header."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Gets or sets the name of authorization header."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the value of authorization header."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl AuthorizationHeader { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureKeyVaultPermission { - #[serde(flatten)] - pub azure_resource_permission: AzureResourcePermission, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub vault: Option<String>, + #[serde(flatten)] + pub azure_resource_permission: AzureResourcePermission, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vault: Option<String>, } impl AzureKeyVaultPermission { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureKeyVaultVariableGroupProviderData { - #[serde(flatten)] - pub variable_group_provider_data: VariableGroupProviderData, - #[serde( - rename = "lastRefreshedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_refreshed_on: Option<time::OffsetDateTime>, - #[serde( - rename = "serviceEndpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub vault: Option<String>, + #[serde(flatten)] + pub variable_group_provider_data: VariableGroupProviderData, + #[serde( + rename = "lastRefreshedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_refreshed_on: Option<time::OffsetDateTime>, + #[serde( + rename = "serviceEndpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vault: Option<String>, } impl AzureKeyVaultVariableGroupProviderData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureKeyVaultVariableValue { - #[serde(flatten)] - pub variable_value: VariableValue, - #[serde( - rename = "contentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_type: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub expires: Option<time::OffsetDateTime>, + #[serde(flatten)] + pub variable_value: VariableValue, + #[serde( + rename = "contentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_type: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub expires: Option<time::OffsetDateTime>, } impl AzureKeyVaultVariableValue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Azure Management Group"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureManagementGroup { - #[doc = "Display name of azure management group"] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Id of azure management group"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Azure management group name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Id of tenant from which azure management group belongs"] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option<String>, + #[doc = "Display name of azure management group"] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Id of azure management group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Azure management group name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Id of tenant from which azure management group belongs"] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option<String>, } impl AzureManagementGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Azure management group query result"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureManagementGroupQueryResult { - #[doc = "Error message in case of an exception"] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "List of azure management groups"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<AzureManagementGroup>, + #[doc = "Error message in case of an exception"] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "List of azure management groups"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<AzureManagementGroup>, } impl AzureManagementGroupQueryResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzurePermission { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub provisioned: Option<bool>, - #[serde( - rename = "resourceProvider", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_provider: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provisioned: Option<bool>, + #[serde( + rename = "resourceProvider", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_provider: Option<String>, } impl AzurePermission { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureResourcePermission { - #[serde(flatten)] - pub azure_permission: AzurePermission, - #[serde( - rename = "resourceGroup", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_group: Option<String>, + #[serde(flatten)] + pub azure_permission: AzurePermission, + #[serde( + rename = "resourceGroup", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_group: Option<String>, } impl AzureResourcePermission { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureRoleAssignmentPermission { - #[serde(flatten)] - pub azure_permission: AzurePermission, - #[serde( - rename = "roleAssignmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub role_assignment_id: Option<String>, + #[serde(flatten)] + pub azure_permission: AzurePermission, + #[serde( + rename = "roleAssignmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub role_assignment_id: Option<String>, } impl AzureRoleAssignmentPermission { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureSpnOperationStatus { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde( - rename = "statusMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_message: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde( + rename = "statusMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_message: Option<String>, } impl AzureSpnOperationStatus { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureSubscription { - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde( - rename = "subscriptionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_id: Option<String>, - #[serde( - rename = "subscriptionTenantId", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_tenant_id: Option<String>, - #[serde( - rename = "subscriptionTenantName", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_tenant_name: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde( + rename = "subscriptionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_id: Option<String>, + #[serde( + rename = "subscriptionTenantId", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_tenant_id: Option<String>, + #[serde( + rename = "subscriptionTenantName", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_tenant_name: Option<String>, } impl AzureSubscription { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureSubscriptionQueryResult { - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<AzureSubscription>, + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<AzureSubscription>, } impl AzureSubscriptionQueryResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ClientCertificate { - #[doc = "Gets or sets the value of client certificate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Gets or sets the value of client certificate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl ClientCertificate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CounterVariable { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub prefix: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub seed: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub prefix: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub seed: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<i32>, } impl CounterVariable { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataSource { - #[doc = ""] - #[serde( - rename = "authenticationScheme", - default, - skip_serializing_if = "Option::is_none" - )] - pub authentication_scheme: Option<AuthenticationSchemeReference>, - #[serde( - rename = "endpointUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_url: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub headers: Vec<AuthorizationHeader>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "resourceUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_url: Option<String>, - #[serde( - rename = "resultSelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_selector: Option<String>, + #[doc = ""] + #[serde( + rename = "authenticationScheme", + default, + skip_serializing_if = "Option::is_none" + )] + pub authentication_scheme: Option<AuthenticationSchemeReference>, + #[serde( + rename = "endpointUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_url: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub headers: Vec<AuthorizationHeader>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "resourceUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_url: Option<String>, + #[serde( + rename = "resultSelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_selector: Option<String>, } impl DataSource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataSourceBinding { - #[serde(flatten)] - pub data_source_binding_base: DataSourceBindingBase, + #[serde(flatten)] + pub data_source_binding_base: DataSourceBindingBase, } impl DataSourceBinding { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents binding of data source for the service endpoint request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataSourceBindingBase { - #[doc = "Pagination format supported by this data source(ContinuationToken/SkipTop)."] - #[serde( - rename = "callbackContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_context_template: Option<String>, - #[doc = "Subsequent calls needed?"] - #[serde( - rename = "callbackRequiredTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_required_template: Option<String>, - #[doc = "Gets or sets the name of the data source."] - #[serde( - rename = "dataSourceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub data_source_name: Option<String>, - #[doc = "Gets or sets the endpoint Id."] - #[serde( - rename = "endpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_id: Option<String>, - #[doc = "Gets or sets the url of the service endpoint."] - #[serde( - rename = "endpointUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_url: Option<String>, - #[doc = "Gets or sets the authorization headers."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub headers: Vec<AuthorizationHeader>, - #[doc = "Defines the initial value of the query params"] - #[serde( - rename = "initialContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub initial_context_template: Option<String>, - #[doc = "Gets or sets the parameters for the data source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<serde_json::Value>, - #[doc = "Gets or sets http request body"] - #[serde( - rename = "requestContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_content: Option<String>, - #[doc = "Gets or sets http request verb"] - #[serde( - rename = "requestVerb", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_verb: Option<String>, - #[doc = "Gets or sets the result selector."] - #[serde( - rename = "resultSelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_selector: Option<String>, - #[doc = "Gets or sets the result template."] - #[serde( - rename = "resultTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_template: Option<String>, - #[doc = "Gets or sets the target of the data source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<String>, + #[doc = "Pagination format supported by this data source(ContinuationToken/SkipTop)."] + #[serde( + rename = "callbackContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_context_template: Option<String>, + #[doc = "Subsequent calls needed?"] + #[serde( + rename = "callbackRequiredTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_required_template: Option<String>, + #[doc = "Gets or sets the name of the data source."] + #[serde( + rename = "dataSourceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub data_source_name: Option<String>, + #[doc = "Gets or sets the endpoint Id."] + #[serde( + rename = "endpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_id: Option<String>, + #[doc = "Gets or sets the url of the service endpoint."] + #[serde( + rename = "endpointUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_url: Option<String>, + #[doc = "Gets or sets the authorization headers."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub headers: Vec<AuthorizationHeader>, + #[doc = "Defines the initial value of the query params"] + #[serde( + rename = "initialContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub initial_context_template: Option<String>, + #[doc = "Gets or sets the parameters for the data source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<serde_json::Value>, + #[doc = "Gets or sets http request body"] + #[serde( + rename = "requestContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_content: Option<String>, + #[doc = "Gets or sets http request verb"] + #[serde( + rename = "requestVerb", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_verb: Option<String>, + #[doc = "Gets or sets the result selector."] + #[serde( + rename = "resultSelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_selector: Option<String>, + #[doc = "Gets or sets the result template."] + #[serde( + rename = "resultTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_template: Option<String>, + #[doc = "Gets or sets the target of the data source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<String>, } impl DataSourceBindingBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataSourceDetails { - #[serde( - rename = "dataSourceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub data_source_name: Option<String>, - #[serde( - rename = "dataSourceUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub data_source_url: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub headers: Vec<AuthorizationHeader>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<serde_json::Value>, - #[serde( - rename = "resourceUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_url: Option<String>, - #[serde( - rename = "resultSelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_selector: Option<String>, + #[serde( + rename = "dataSourceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub data_source_name: Option<String>, + #[serde( + rename = "dataSourceUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub data_source_url: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub headers: Vec<AuthorizationHeader>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<serde_json::Value>, + #[serde( + rename = "resourceUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_url: Option<String>, + #[serde( + rename = "resultSelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_selector: Option<String>, } impl DataSourceDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Demand { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl Demand { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DemandEquals { - #[serde(flatten)] - pub demand: Demand, + #[serde(flatten)] + pub demand: Demand, } impl DemandEquals { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DemandExists { - #[serde(flatten)] - pub demand: Demand, + #[serde(flatten)] + pub demand: Demand, } impl DemandExists { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DemandMinimumVersion { - #[serde(flatten)] - pub demand: Demand, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<DemandSource>, + #[serde(flatten)] + pub demand: Demand, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<DemandSource>, } impl DemandMinimumVersion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DemandSource { - #[serde( - rename = "sourceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_name: Option<String>, - #[serde( - rename = "sourceType", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_type: Option<demand_source::SourceType>, - #[serde( - rename = "sourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_version: Option<String>, + #[serde( + rename = "sourceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_name: Option<String>, + #[serde( + rename = "sourceType", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_type: Option<demand_source::SourceType>, + #[serde( + rename = "sourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_version: Option<String>, } impl DemandSource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod demand_source { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SourceType { - #[serde(rename = "task")] - Task, - #[serde(rename = "feature")] - Feature, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SourceType { + #[serde(rename = "task")] + Task, + #[serde(rename = "feature")] + Feature, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DependencyBinding { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub key: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl DependencyBinding { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DependencyData { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub input: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub map: Vec<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub input: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub map: Vec<serde_json::Value>, } impl DependencyData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DependsOn { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub input: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub map: Vec<DependencyBinding>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub input: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub map: Vec<DependencyBinding>, } impl DependsOn { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentGatesChangeEvent { - #[serde( - rename = "gateNames", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub gate_names: Vec<String>, + #[serde( + rename = "gateNames", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub gate_names: Vec<String>, } impl DeploymentGatesChangeEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deployment group."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentGroup { - #[serde(flatten)] - pub deployment_group_reference: DeploymentGroupReference, - #[doc = "Description of the deployment group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Number of deployment targets in the deployment group."] - #[serde( - rename = "machineCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub machine_count: Option<i32>, - #[doc = "List of deployment targets in the deployment group."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub machines: Vec<DeploymentMachine>, - #[doc = "List of unique tags across all deployment targets in the deployment group."] - #[serde( - rename = "machineTags", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub machine_tags: Vec<String>, + #[serde(flatten)] + pub deployment_group_reference: DeploymentGroupReference, + #[doc = "Description of the deployment group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Number of deployment targets in the deployment group."] + #[serde( + rename = "machineCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_count: Option<i32>, + #[doc = "List of deployment targets in the deployment group."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub machines: Vec<DeploymentMachine>, + #[doc = "List of unique tags across all deployment targets in the deployment group."] + #[serde( + rename = "machineTags", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub machine_tags: Vec<String>, } impl DeploymentGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Properties to create Deployment group."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentGroupCreateParameter { - #[doc = "Description of the deployment group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Name of the deployment group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Identifier of the deployment pool in which deployment agents are registered."] - #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] - pub pool_id: Option<i32>, + #[doc = "Description of the deployment group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Name of the deployment group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Identifier of the deployment pool in which deployment agents are registered."] + #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] + pub pool_id: Option<i32>, } impl DeploymentGroupCreateParameter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Properties of Deployment pool to create Deployment group."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentGroupCreateParameterPoolProperty { - #[doc = "Deployment pool identifier."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, + #[doc = "Deployment pool identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, } impl DeploymentGroupCreateParameterPoolProperty { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentGroupList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<DeploymentGroup>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<DeploymentGroup>, } impl DeploymentGroupList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deployment group metrics."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentGroupMetrics { - #[doc = "Metrics columns header"] - #[serde( - rename = "columnsHeader", - default, - skip_serializing_if = "Option::is_none" - )] - pub columns_header: Option<MetricsColumnsHeader>, - #[doc = "Deployment group reference. This is useful for referring a deployment group in another object."] - #[serde( - rename = "deploymentGroup", - default, - skip_serializing_if = "Option::is_none" - )] - pub deployment_group: Option<DeploymentGroupReference>, - #[doc = "Values of properties and the metrics. E.g. 1: total count of deployment targets for which 'TargetState' is 'offline'. E.g. 2: Average time of deployment to the deployment targets for which 'LastJobStatus' is 'passed' and 'TargetState' is 'online'."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub rows: Vec<MetricsRow>, + #[doc = "Metrics columns header"] + #[serde( + rename = "columnsHeader", + default, + skip_serializing_if = "Option::is_none" + )] + pub columns_header: Option<MetricsColumnsHeader>, + #[doc = "Deployment group reference. This is useful for referring a deployment group in another object."] + #[serde( + rename = "deploymentGroup", + default, + skip_serializing_if = "Option::is_none" + )] + pub deployment_group: Option<DeploymentGroupReference>, + #[doc = "Values of properties and the metrics. E.g. 1: total count of deployment targets for which 'TargetState' is 'offline'. E.g. 2: Average time of deployment to the deployment targets for which 'LastJobStatus' is 'passed' and 'TargetState' is 'online'."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub rows: Vec<MetricsRow>, } impl DeploymentGroupMetrics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deployment group reference. This is useful for referring a deployment group in another object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentGroupReference { - #[doc = "Deployment group identifier."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the deployment group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pool: Option<TaskAgentPoolReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, + #[doc = "Deployment group identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the deployment group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pool: Option<TaskAgentPoolReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, } impl DeploymentGroupReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deployment group update parameter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentGroupUpdateParameter { - #[doc = "Description of the deployment group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Name of the deployment group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Description of the deployment group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Name of the deployment group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl DeploymentGroupUpdateParameter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deployment target."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentMachine { - #[doc = "A task agent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub agent: Option<TaskAgent>, - #[doc = "Deployment target Identifier."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "Tags of the deployment target."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, + #[doc = "A task agent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub agent: Option<TaskAgent>, + #[doc = "Deployment target Identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "Tags of the deployment target."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, } impl DeploymentMachine { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentMachineChangedData { - #[serde(flatten)] - pub deployment_machine: DeploymentMachine, - #[serde( - rename = "addedTags", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub added_tags: Vec<String>, - #[serde( - rename = "deletedTags", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub deleted_tags: Vec<String>, + #[serde(flatten)] + pub deployment_machine: DeploymentMachine, + #[serde( + rename = "addedTags", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub added_tags: Vec<String>, + #[serde( + rename = "deletedTags", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub deleted_tags: Vec<String>, } impl DeploymentMachineChangedData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentMachineGroup { - #[serde(flatten)] - pub deployment_machine_group_reference: DeploymentMachineGroupReference, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub machines: Vec<DeploymentMachine>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i32>, + #[serde(flatten)] + pub deployment_machine_group_reference: DeploymentMachineGroupReference, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub machines: Vec<DeploymentMachine>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i32>, } impl DeploymentMachineGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentMachineGroupReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pool: Option<TaskAgentPoolReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pool: Option<TaskAgentPoolReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, } impl DeploymentMachineGroupReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentMachineList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<DeploymentMachine>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<DeploymentMachine>, } impl DeploymentMachineList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentMachinesChangeEvent { - #[doc = "Deployment group reference. This is useful for referring a deployment group in another object."] - #[serde( - rename = "machineGroupReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub machine_group_reference: Option<DeploymentGroupReference>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub machines: Vec<DeploymentMachineChangedData>, + #[doc = "Deployment group reference. This is useful for referring a deployment group in another object."] + #[serde( + rename = "machineGroupReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_group_reference: Option<DeploymentGroupReference>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub machines: Vec<DeploymentMachineChangedData>, } impl DeploymentMachinesChangeEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deployment pool summary."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentPoolSummary { - #[doc = "List of deployment groups referring to the deployment pool."] - #[serde( - rename = "deploymentGroups", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub deployment_groups: Vec<DeploymentGroupReference>, - #[doc = "Number of deployment agents that are offline."] - #[serde( - rename = "offlineAgentsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub offline_agents_count: Option<i32>, - #[doc = "Number of deployment agents that are online."] - #[serde( - rename = "onlineAgentsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub online_agents_count: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pool: Option<TaskAgentPoolReference>, - #[doc = "EnvironmentResourceReference."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option<EnvironmentResourceReference>, + #[doc = "List of deployment groups referring to the deployment pool."] + #[serde( + rename = "deploymentGroups", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub deployment_groups: Vec<DeploymentGroupReference>, + #[doc = "Number of deployment agents that are offline."] + #[serde( + rename = "offlineAgentsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub offline_agents_count: Option<i32>, + #[doc = "Number of deployment agents that are online."] + #[serde( + rename = "onlineAgentsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub online_agents_count: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pool: Option<TaskAgentPoolReference>, + #[doc = "EnvironmentResourceReference."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option<EnvironmentResourceReference>, } impl DeploymentPoolSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Deployment target update parameter."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentTargetUpdateParameter { - #[doc = "Identifier of the deployment target."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, + #[doc = "Identifier of the deployment target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, } impl DeploymentTargetUpdateParameter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DiagnosticLogMetadata { - #[serde(rename = "agentId", default, skip_serializing_if = "Option::is_none")] - pub agent_id: Option<i32>, - #[serde(rename = "agentName", default, skip_serializing_if = "Option::is_none")] - pub agent_name: Option<String>, - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[serde(rename = "phaseName", default, skip_serializing_if = "Option::is_none")] - pub phase_name: Option<String>, - #[serde( - rename = "phaseResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub phase_result: Option<String>, - #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] - pub pool_id: Option<i32>, + #[serde(rename = "agentId", default, skip_serializing_if = "Option::is_none")] + pub agent_id: Option<i32>, + #[serde(rename = "agentName", default, skip_serializing_if = "Option::is_none")] + pub agent_name: Option<String>, + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[serde(rename = "phaseName", default, skip_serializing_if = "Option::is_none")] + pub phase_name: Option<String>, + #[serde( + rename = "phaseResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub phase_result: Option<String>, + #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] + pub pool_id: Option<i32>, } impl DiagnosticLogMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ElasticAgentPoolResizedEvent { - #[serde(rename = "newSize", default, skip_serializing_if = "Option::is_none")] - pub new_size: Option<i32>, - #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] - pub pool_id: Option<i32>, - #[serde(rename = "poolName", default, skip_serializing_if = "Option::is_none")] - pub pool_name: Option<String>, - #[serde( - rename = "previousSize", - default, - skip_serializing_if = "Option::is_none" - )] - pub previous_size: Option<i32>, - #[serde( - rename = "resourceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_id: Option<String>, + #[serde(rename = "newSize", default, skip_serializing_if = "Option::is_none")] + pub new_size: Option<i32>, + #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] + pub pool_id: Option<i32>, + #[serde(rename = "poolName", default, skip_serializing_if = "Option::is_none")] + pub pool_name: Option<String>, + #[serde( + rename = "previousSize", + default, + skip_serializing_if = "Option::is_none" + )] + pub previous_size: Option<i32>, + #[serde( + rename = "resourceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_id: Option<String>, } impl ElasticAgentPoolResizedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data and settings for an elastic node"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ElasticNode { - #[doc = "Distributed Task's Agent Id"] - #[serde(rename = "agentId", default, skip_serializing_if = "Option::is_none")] - pub agent_id: Option<i32>, - #[doc = "Summary of the state of the agent"] - #[serde( - rename = "agentState", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_state: Option<elastic_node::AgentState>, - #[doc = "Compute Id. VMSS's InstanceId"] - #[serde(rename = "computeId", default, skip_serializing_if = "Option::is_none")] - pub compute_id: Option<String>, - #[doc = "State of the compute host"] - #[serde( - rename = "computeState", - default, - skip_serializing_if = "Option::is_none" - )] - pub compute_state: Option<elastic_node::ComputeState>, - #[doc = "Users can force state changes to specific states (ToReimage, ToDelete, Save)"] - #[serde( - rename = "desiredState", - default, - skip_serializing_if = "Option::is_none" - )] - pub desired_state: Option<elastic_node::DesiredState>, - #[doc = "Unique identifier since the agent and/or VM may be null"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Computer name. Used to match a scaleset VM with an agent"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Pool Id that this node belongs to"] - #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] - pub pool_id: Option<i32>, - #[doc = "Last job RequestId assigned to this agent"] - #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] - pub request_id: Option<i64>, - #[doc = "State of the ElasticNode"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<elastic_node::State>, - #[doc = "Last state change. Only updated by SQL."] - #[serde( - rename = "stateChangedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub state_changed_on: Option<time::OffsetDateTime>, + #[doc = "Distributed Task's Agent Id"] + #[serde(rename = "agentId", default, skip_serializing_if = "Option::is_none")] + pub agent_id: Option<i32>, + #[doc = "Summary of the state of the agent"] + #[serde( + rename = "agentState", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_state: Option<elastic_node::AgentState>, + #[doc = "Compute Id. VMSS's InstanceId"] + #[serde(rename = "computeId", default, skip_serializing_if = "Option::is_none")] + pub compute_id: Option<String>, + #[doc = "State of the compute host"] + #[serde( + rename = "computeState", + default, + skip_serializing_if = "Option::is_none" + )] + pub compute_state: Option<elastic_node::ComputeState>, + #[doc = "Users can force state changes to specific states (ToReimage, ToDelete, Save)"] + #[serde( + rename = "desiredState", + default, + skip_serializing_if = "Option::is_none" + )] + pub desired_state: Option<elastic_node::DesiredState>, + #[doc = "Unique identifier since the agent and/or VM may be null"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Computer name. Used to match a scaleset VM with an agent"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Pool Id that this node belongs to"] + #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] + pub pool_id: Option<i32>, + #[doc = "Last job RequestId assigned to this agent"] + #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] + pub request_id: Option<i64>, + #[doc = "State of the ElasticNode"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<elastic_node::State>, + #[doc = "Last state change. Only updated by SQL."] + #[serde( + rename = "stateChangedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub state_changed_on: Option<time::OffsetDateTime>, } impl ElasticNode { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod elastic_node { - use super::*; - #[doc = "Summary of the state of the agent"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AgentState { - #[serde(rename = "none")] - None, - #[serde(rename = "enabled")] - Enabled, - #[serde(rename = "online")] - Online, - #[serde(rename = "assigned")] - Assigned, - } - #[doc = "State of the compute host"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ComputeState { - #[serde(rename = "none")] - None, - #[serde(rename = "healthy")] - Healthy, - #[serde(rename = "creating")] - Creating, - #[serde(rename = "deleting")] - Deleting, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "stopped")] - Stopped, - #[serde(rename = "reimaging")] - Reimaging, - } - #[doc = "Users can force state changes to specific states (ToReimage, ToDelete, Save)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DesiredState { - #[serde(rename = "none")] - None, - #[serde(rename = "new")] - New, - #[serde(rename = "creatingCompute")] - CreatingCompute, - #[serde(rename = "startingAgent")] - StartingAgent, - #[serde(rename = "idle")] - Idle, - #[serde(rename = "assigned")] - Assigned, - #[serde(rename = "offline")] - Offline, - #[serde(rename = "pendingReimage")] - PendingReimage, - #[serde(rename = "pendingDelete")] - PendingDelete, - #[serde(rename = "saved")] - Saved, - #[serde(rename = "deletingCompute")] - DeletingCompute, - #[serde(rename = "deleted")] - Deleted, - #[serde(rename = "lost")] - Lost, - #[serde(rename = "reimagingCompute")] - ReimagingCompute, - #[serde(rename = "restartingAgent")] - RestartingAgent, - #[serde(rename = "failedToStartPendingDelete")] - FailedToStartPendingDelete, - #[serde(rename = "failedToRestartPendingDelete")] - FailedToRestartPendingDelete, - #[serde(rename = "failedVMPendingDelete")] - FailedVmPendingDelete, - #[serde(rename = "assignedPendingDelete")] - AssignedPendingDelete, - #[serde(rename = "retryDelete")] - RetryDelete, - } - #[doc = "State of the ElasticNode"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "none")] - None, - #[serde(rename = "new")] - New, - #[serde(rename = "creatingCompute")] - CreatingCompute, - #[serde(rename = "startingAgent")] - StartingAgent, - #[serde(rename = "idle")] - Idle, - #[serde(rename = "assigned")] - Assigned, - #[serde(rename = "offline")] - Offline, - #[serde(rename = "pendingReimage")] - PendingReimage, - #[serde(rename = "pendingDelete")] - PendingDelete, - #[serde(rename = "saved")] - Saved, - #[serde(rename = "deletingCompute")] - DeletingCompute, - #[serde(rename = "deleted")] - Deleted, - #[serde(rename = "lost")] - Lost, - #[serde(rename = "reimagingCompute")] - ReimagingCompute, - #[serde(rename = "restartingAgent")] - RestartingAgent, - #[serde(rename = "failedToStartPendingDelete")] - FailedToStartPendingDelete, - #[serde(rename = "failedToRestartPendingDelete")] - FailedToRestartPendingDelete, - #[serde(rename = "failedVMPendingDelete")] - FailedVmPendingDelete, - #[serde(rename = "assignedPendingDelete")] - AssignedPendingDelete, - #[serde(rename = "retryDelete")] - RetryDelete, - } + use super::*; + #[doc = "Summary of the state of the agent"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AgentState { + #[serde(rename = "none")] + None, + #[serde(rename = "enabled")] + Enabled, + #[serde(rename = "online")] + Online, + #[serde(rename = "assigned")] + Assigned, + } + #[doc = "State of the compute host"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ComputeState { + #[serde(rename = "none")] + None, + #[serde(rename = "healthy")] + Healthy, + #[serde(rename = "creating")] + Creating, + #[serde(rename = "deleting")] + Deleting, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "stopped")] + Stopped, + } + #[doc = "Users can force state changes to specific states (ToReimage, ToDelete, Save)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DesiredState { + #[serde(rename = "none")] + None, + #[serde(rename = "new")] + New, + #[serde(rename = "creatingCompute")] + CreatingCompute, + #[serde(rename = "startingAgent")] + StartingAgent, + #[serde(rename = "idle")] + Idle, + #[serde(rename = "assigned")] + Assigned, + #[serde(rename = "offline")] + Offline, + #[serde(rename = "pendingReimage")] + PendingReimage, + #[serde(rename = "pendingDelete")] + PendingDelete, + #[serde(rename = "saved")] + Saved, + #[serde(rename = "deletingCompute")] + DeletingCompute, + #[serde(rename = "deleted")] + Deleted, + #[serde(rename = "lost")] + Lost, + } + #[doc = "State of the ElasticNode"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "none")] + None, + #[serde(rename = "new")] + New, + #[serde(rename = "creatingCompute")] + CreatingCompute, + #[serde(rename = "startingAgent")] + StartingAgent, + #[serde(rename = "idle")] + Idle, + #[serde(rename = "assigned")] + Assigned, + #[serde(rename = "offline")] + Offline, + #[serde(rename = "pendingReimage")] + PendingReimage, + #[serde(rename = "pendingDelete")] + PendingDelete, + #[serde(rename = "saved")] + Saved, + #[serde(rename = "deletingCompute")] + DeletingCompute, + #[serde(rename = "deleted")] + Deleted, + #[serde(rename = "lost")] + Lost, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ElasticNodeList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ElasticNode>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ElasticNode>, } impl ElasticNodeList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Class used for updating an elastic node where only certain members are populated"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ElasticNodeSettings { - #[doc = "State of the ElasticNode"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<elastic_node_settings::State>, + #[doc = "State of the ElasticNode"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<elastic_node_settings::State>, } impl ElasticNodeSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod elastic_node_settings { - use super::*; - #[doc = "State of the ElasticNode"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "none")] - None, - #[serde(rename = "new")] - New, - #[serde(rename = "creatingCompute")] - CreatingCompute, - #[serde(rename = "startingAgent")] - StartingAgent, - #[serde(rename = "idle")] - Idle, - #[serde(rename = "assigned")] - Assigned, - #[serde(rename = "offline")] - Offline, - #[serde(rename = "pendingReimage")] - PendingReimage, - #[serde(rename = "pendingDelete")] - PendingDelete, - #[serde(rename = "saved")] - Saved, - #[serde(rename = "deletingCompute")] - DeletingCompute, - #[serde(rename = "deleted")] - Deleted, - #[serde(rename = "lost")] - Lost, - #[serde(rename = "reimagingCompute")] - ReimagingCompute, - #[serde(rename = "restartingAgent")] - RestartingAgent, - #[serde(rename = "failedToStartPendingDelete")] - FailedToStartPendingDelete, - #[serde(rename = "failedToRestartPendingDelete")] - FailedToRestartPendingDelete, - #[serde(rename = "failedVMPendingDelete")] - FailedVmPendingDelete, - #[serde(rename = "assignedPendingDelete")] - AssignedPendingDelete, - #[serde(rename = "retryDelete")] - RetryDelete, - } + use super::*; + #[doc = "State of the ElasticNode"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "none")] + None, + #[serde(rename = "new")] + New, + #[serde(rename = "creatingCompute")] + CreatingCompute, + #[serde(rename = "startingAgent")] + StartingAgent, + #[serde(rename = "idle")] + Idle, + #[serde(rename = "assigned")] + Assigned, + #[serde(rename = "offline")] + Offline, + #[serde(rename = "pendingReimage")] + PendingReimage, + #[serde(rename = "pendingDelete")] + PendingDelete, + #[serde(rename = "saved")] + Saved, + #[serde(rename = "deletingCompute")] + DeletingCompute, + #[serde(rename = "deleted")] + Deleted, + #[serde(rename = "lost")] + Lost, + } } #[doc = "Data and settings for an elastic pool"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ElasticPool { - #[doc = "Set whether agents should be configured to run with interactive UI"] - #[serde( - rename = "agentInteractiveUI", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_interactive_ui: Option<bool>, - #[doc = "Azure string representing to location of the resource"] - #[serde(rename = "azureId", default, skip_serializing_if = "Option::is_none")] - pub azure_id: Option<String>, - #[doc = "Number of agents to have ready waiting for jobs"] - #[serde( - rename = "desiredIdle", - default, - skip_serializing_if = "Option::is_none" - )] - pub desired_idle: Option<i32>, - #[doc = "The desired size of the pool"] - #[serde( - rename = "desiredSize", - default, - skip_serializing_if = "Option::is_none" - )] - pub desired_size: Option<i32>, - #[doc = "Maximum number of nodes that will exist in the elastic pool"] - #[serde( - rename = "maxCapacity", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_capacity: Option<i32>, - #[doc = "Keep nodes in the pool on failure for investigation"] - #[serde( - rename = "maxSavedNodeCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_saved_node_count: Option<i32>, - #[doc = "Timestamp the pool was first detected to be offline"] - #[serde( - rename = "offlineSince", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub offline_since: Option<time::OffsetDateTime>, - #[doc = "Operating system type of the nodes in the pool"] - #[serde( - rename = "orchestrationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub orchestration_type: Option<elastic_pool::OrchestrationType>, - #[doc = "Operating system type of the nodes in the pool"] - #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] - pub os_type: Option<elastic_pool::OsType>, - #[doc = "Id of the associated TaskAgentPool"] - #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] - pub pool_id: Option<i32>, - #[doc = "Discard node after each job completes"] - #[serde( - rename = "recycleAfterEachUse", - default, - skip_serializing_if = "Option::is_none" - )] - pub recycle_after_each_use: Option<bool>, - #[doc = "Id of the Service Endpoint used to connect to Azure"] - #[serde( - rename = "serviceEndpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_id: Option<String>, - #[doc = "Scope the Service Endpoint belongs to"] - #[serde( - rename = "serviceEndpointScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_scope: Option<String>, - #[doc = "The number of sizing attempts executed while trying to achieve a desired size"] - #[serde( - rename = "sizingAttempts", - default, - skip_serializing_if = "Option::is_none" - )] - pub sizing_attempts: Option<i32>, - #[doc = "State of the pool"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<elastic_pool::State>, - #[doc = "The minimum time in minutes to keep idle agents alive"] - #[serde( - rename = "timeToLiveMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub time_to_live_minutes: Option<i32>, + #[doc = "Set whether agents should be configured to run with interactive UI"] + #[serde( + rename = "agentInteractiveUI", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_interactive_ui: Option<bool>, + #[doc = "Azure string representing to location of the resource"] + #[serde(rename = "azureId", default, skip_serializing_if = "Option::is_none")] + pub azure_id: Option<String>, + #[doc = "Number of agents to have ready waiting for jobs"] + #[serde( + rename = "desiredIdle", + default, + skip_serializing_if = "Option::is_none" + )] + pub desired_idle: Option<i32>, + #[doc = "The desired size of the pool"] + #[serde( + rename = "desiredSize", + default, + skip_serializing_if = "Option::is_none" + )] + pub desired_size: Option<i32>, + #[doc = "Maximum number of nodes that will exist in the elastic pool"] + #[serde( + rename = "maxCapacity", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_capacity: Option<i32>, + #[doc = "Keep nodes in the pool on failure for investigation"] + #[serde( + rename = "maxSavedNodeCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_saved_node_count: Option<i32>, + #[doc = "Timestamp the pool was first detected to be offline"] + #[serde( + rename = "offlineSince", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub offline_since: Option<time::OffsetDateTime>, + #[doc = "Operating system type of the nodes in the pool"] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: Option<elastic_pool::OsType>, + #[doc = "Id of the associated TaskAgentPool"] + #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] + pub pool_id: Option<i32>, + #[doc = "Discard node after each job completes"] + #[serde( + rename = "recycleAfterEachUse", + default, + skip_serializing_if = "Option::is_none" + )] + pub recycle_after_each_use: Option<bool>, + #[doc = "Id of the Service Endpoint used to connect to Azure"] + #[serde( + rename = "serviceEndpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_id: Option<String>, + #[doc = "Scope the Service Endpoint belongs to"] + #[serde( + rename = "serviceEndpointScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_scope: Option<String>, + #[doc = "The number of sizing attempts executed while trying to achieve a desired size"] + #[serde( + rename = "sizingAttempts", + default, + skip_serializing_if = "Option::is_none" + )] + pub sizing_attempts: Option<i32>, + #[doc = "State of the pool"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<elastic_pool::State>, + #[doc = "The minimum time in minutes to keep idle agents alive"] + #[serde( + rename = "timeToLiveMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub time_to_live_minutes: Option<i32>, } impl ElasticPool { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod elastic_pool { - use super::*; - #[doc = "Operating system type of the nodes in the pool"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum OrchestrationType { - #[serde(rename = "uniform")] - Uniform, - #[serde(rename = "flexible")] - Flexible, - } - #[doc = "Operating system type of the nodes in the pool"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum OsType { - #[serde(rename = "windows")] - Windows, - #[serde(rename = "linux")] - Linux, - } - #[doc = "State of the pool"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "online")] - Online, - #[serde(rename = "offline")] - Offline, - #[serde(rename = "unhealthy")] - Unhealthy, - #[serde(rename = "new")] - New, - } + use super::*; + #[doc = "Operating system type of the nodes in the pool"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum OsType { + #[serde(rename = "windows")] + Windows, + #[serde(rename = "linux")] + Linux, + } + #[doc = "State of the pool"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "online")] + Online, + #[serde(rename = "offline")] + Offline, + #[serde(rename = "unhealthy")] + Unhealthy, + #[serde(rename = "new")] + New, + } } #[doc = "Returned result from creating a new elastic pool"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ElasticPoolCreationResult { - #[doc = "An organization-level grouping of agents."] - #[serde(rename = "agentPool", default, skip_serializing_if = "Option::is_none")] - pub agent_pool: Option<TaskAgentPool>, - #[doc = "An agent queue."] - #[serde( - rename = "agentQueue", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_queue: Option<TaskAgentQueue>, - #[doc = "Data and settings for an elastic pool"] - #[serde( - rename = "elasticPool", - default, - skip_serializing_if = "Option::is_none" - )] - pub elastic_pool: Option<ElasticPool>, + #[doc = "An organization-level grouping of agents."] + #[serde(rename = "agentPool", default, skip_serializing_if = "Option::is_none")] + pub agent_pool: Option<TaskAgentPool>, + #[doc = "An agent queue."] + #[serde( + rename = "agentQueue", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_queue: Option<TaskAgentQueue>, + #[doc = "Data and settings for an elastic pool"] + #[serde( + rename = "elasticPool", + default, + skip_serializing_if = "Option::is_none" + )] + pub elastic_pool: Option<ElasticPool>, } impl ElasticPoolCreationResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ElasticPoolList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ElasticPool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ElasticPool>, } impl ElasticPoolList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Log data for an Elastic Pool"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ElasticPoolLog { - #[doc = "Log Id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i64>, - #[doc = "E.g. error, warning, info"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option<elastic_pool_log::Level>, - #[doc = "Log contents"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "Operation that triggered the message being logged"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option<elastic_pool_log::Operation>, - #[doc = "Id of the associated TaskAgentPool"] - #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] - pub pool_id: Option<i32>, - #[doc = "Datetime that the log occurred"] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub timestamp: Option<time::OffsetDateTime>, + #[doc = "Log Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i64>, + #[doc = "E.g. error, warning, info"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub level: Option<elastic_pool_log::Level>, + #[doc = "Log contents"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "Operation that triggered the message being logged"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option<elastic_pool_log::Operation>, + #[doc = "Id of the associated TaskAgentPool"] + #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] + pub pool_id: Option<i32>, + #[doc = "Datetime that the log occurred"] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub timestamp: Option<time::OffsetDateTime>, } impl ElasticPoolLog { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod elastic_pool_log { - use super::*; - #[doc = "E.g. error, warning, info"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Level { - #[serde(rename = "error")] - Error, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "info")] - Info, - } - #[doc = "Operation that triggered the message being logged"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Operation { - #[serde(rename = "configurationJob")] - ConfigurationJob, - #[serde(rename = "sizingJob")] - SizingJob, - #[serde(rename = "increaseCapacity")] - IncreaseCapacity, - #[serde(rename = "reimage")] - Reimage, - #[serde(rename = "deleteVMs")] - DeleteVMs, - } + use super::*; + #[doc = "E.g. error, warning, info"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Level { + #[serde(rename = "error")] + Error, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "info")] + Info, + } + #[doc = "Operation that triggered the message being logged"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Operation { + #[serde(rename = "configurationJob")] + ConfigurationJob, + #[serde(rename = "sizingJob")] + SizingJob, + #[serde(rename = "increaseCapacity")] + IncreaseCapacity, + #[serde(rename = "reimage")] + Reimage, + #[serde(rename = "deleteVMs")] + DeleteVMs, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ElasticPoolLogList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ElasticPoolLog>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ElasticPoolLog>, } impl ElasticPoolLogList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Class used for updating an elastic pool where only certain members are populated"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ElasticPoolSettings { - #[doc = "Set whether agents should be configured to run with interactive UI"] - #[serde( - rename = "agentInteractiveUI", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_interactive_ui: Option<bool>, - #[doc = "Azure string representing to location of the resource"] - #[serde(rename = "azureId", default, skip_serializing_if = "Option::is_none")] - pub azure_id: Option<String>, - #[doc = "Number of machines to have ready waiting for jobs"] - #[serde( - rename = "desiredIdle", - default, - skip_serializing_if = "Option::is_none" - )] - pub desired_idle: Option<i32>, - #[doc = "Maximum number of machines that will exist in the elastic pool"] - #[serde( - rename = "maxCapacity", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_capacity: Option<i32>, - #[doc = "Keep machines in the pool on failure for investigation"] - #[serde( - rename = "maxSavedNodeCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_saved_node_count: Option<i32>, - #[doc = "Operating system type of the machines in the pool"] - #[serde( - rename = "orchestrationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub orchestration_type: Option<elastic_pool_settings::OrchestrationType>, - #[doc = "Operating system type of the machines in the pool"] - #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] - pub os_type: Option<elastic_pool_settings::OsType>, - #[doc = "Discard machines after each job completes"] - #[serde( - rename = "recycleAfterEachUse", - default, - skip_serializing_if = "Option::is_none" - )] - pub recycle_after_each_use: Option<bool>, - #[doc = "Id of the Service Endpoint used to connect to Azure"] - #[serde( - rename = "serviceEndpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_id: Option<String>, - #[doc = "Scope the Service Endpoint belongs to"] - #[serde( - rename = "serviceEndpointScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_scope: Option<String>, - #[doc = "The minimum time in minutes to keep idle agents alive"] - #[serde( - rename = "timeToLiveMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub time_to_live_minutes: Option<i32>, + #[doc = "Set whether agents should be configured to run with interactive UI"] + #[serde( + rename = "agentInteractiveUI", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_interactive_ui: Option<bool>, + #[doc = "Azure string representing to location of the resource"] + #[serde(rename = "azureId", default, skip_serializing_if = "Option::is_none")] + pub azure_id: Option<String>, + #[doc = "Number of machines to have ready waiting for jobs"] + #[serde( + rename = "desiredIdle", + default, + skip_serializing_if = "Option::is_none" + )] + pub desired_idle: Option<i32>, + #[doc = "Maximum number of machines that will exist in the elastic pool"] + #[serde( + rename = "maxCapacity", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_capacity: Option<i32>, + #[doc = "Keep machines in the pool on failure for investigation"] + #[serde( + rename = "maxSavedNodeCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_saved_node_count: Option<i32>, + #[doc = "Operating system type of the machines in the pool"] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: Option<elastic_pool_settings::OsType>, + #[doc = "Discard machines after each job completes"] + #[serde( + rename = "recycleAfterEachUse", + default, + skip_serializing_if = "Option::is_none" + )] + pub recycle_after_each_use: Option<bool>, + #[doc = "Id of the Service Endpoint used to connect to Azure"] + #[serde( + rename = "serviceEndpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_id: Option<String>, + #[doc = "Scope the Service Endpoint belongs to"] + #[serde( + rename = "serviceEndpointScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_scope: Option<String>, + #[doc = "The minimum time in minutes to keep idle agents alive"] + #[serde( + rename = "timeToLiveMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub time_to_live_minutes: Option<i32>, } impl ElasticPoolSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod elastic_pool_settings { - use super::*; - #[doc = "Operating system type of the machines in the pool"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum OrchestrationType { - #[serde(rename = "uniform")] - Uniform, - #[serde(rename = "flexible")] - Flexible, - } - #[doc = "Operating system type of the machines in the pool"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum OsType { - #[serde(rename = "windows")] - Windows, - #[serde(rename = "linux")] - Linux, - } + use super::*; + #[doc = "Operating system type of the machines in the pool"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum OsType { + #[serde(rename = "windows")] + Windows, + #[serde(rename = "linux")] + Linux, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EndpointAuthorization { - #[doc = "Gets or sets the parameters for the selected authorization scheme."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<serde_json::Value>, - #[doc = "Gets or sets the scheme used for service endpoint authentication."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scheme: Option<String>, + #[doc = "Gets or sets the parameters for the selected authorization scheme."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<serde_json::Value>, + #[doc = "Gets or sets the scheme used for service endpoint authentication."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scheme: Option<String>, } impl EndpointAuthorization { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents url of the service endpoint."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EndpointUrl { - #[doc = ""] - #[serde(rename = "dependsOn", default, skip_serializing_if = "Option::is_none")] - pub depends_on: Option<DependsOn>, - #[doc = "Gets or sets the display name of service endpoint url."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Gets or sets the help text of service endpoint url."] - #[serde(rename = "helpText", default, skip_serializing_if = "Option::is_none")] - pub help_text: Option<String>, - #[doc = "Gets or sets the visibility of service endpoint url."] - #[serde(rename = "isVisible", default, skip_serializing_if = "Option::is_none")] - pub is_visible: Option<String>, - #[doc = "Gets or sets the value of service endpoint url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = ""] + #[serde(rename = "dependsOn", default, skip_serializing_if = "Option::is_none")] + pub depends_on: Option<DependsOn>, + #[doc = "Gets or sets the display name of service endpoint url."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Gets or sets the help text of service endpoint url."] + #[serde(rename = "helpText", default, skip_serializing_if = "Option::is_none")] + pub help_text: Option<String>, + #[doc = "Gets or sets the visibility of service endpoint url."] + #[serde(rename = "isVisible", default, skip_serializing_if = "Option::is_none")] + pub is_visible: Option<String>, + #[doc = "Gets or sets the value of service endpoint url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl EndpointUrl { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Properties to create Environment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentCreateParameter { - #[doc = "Description of the environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Name of the environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Description of the environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Name of the environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl EnvironmentCreateParameter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "EnvironmentDeploymentExecutionRecord."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentDeploymentExecutionRecord { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub definition: Option<TaskOrchestrationOwner>, - #[doc = "Id of the Environment"] - #[serde( - rename = "environmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_id: Option<i32>, - #[doc = "Finish time of the environment deployment execution"] - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = "Id of the Environment deployment execution history record"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i64>, - #[doc = "Job Attempt"] - #[serde( - rename = "jobAttempt", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_attempt: Option<i32>, - #[doc = "Job name"] - #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] - pub job_name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<TaskOrchestrationOwner>, - #[doc = "Plan Id"] - #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] - pub plan_id: Option<String>, - #[doc = "Plan type of the environment deployment execution record"] - #[serde(rename = "planType", default, skip_serializing_if = "Option::is_none")] - pub plan_type: Option<String>, - #[doc = "Queue time of the environment deployment execution"] - #[serde( - rename = "queueTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub queue_time: Option<time::OffsetDateTime>, - #[doc = "Request identifier of the Environment deployment execution history record"] - #[serde( - rename = "requestIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_identifier: Option<String>, - #[doc = "Resource Id"] - #[serde( - rename = "resourceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_id: Option<i32>, - #[doc = "Result of the environment deployment execution"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<environment_deployment_execution_record::Result>, - #[doc = "Project Id"] - #[serde(rename = "scopeId", default, skip_serializing_if = "Option::is_none")] - pub scope_id: Option<String>, - #[doc = "Service owner Id"] - #[serde( - rename = "serviceOwner", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_owner: Option<String>, - #[doc = "Stage Attempt"] - #[serde( - rename = "stageAttempt", - default, - skip_serializing_if = "Option::is_none" - )] - pub stage_attempt: Option<i32>, - #[doc = "Stage name"] - #[serde(rename = "stageName", default, skip_serializing_if = "Option::is_none")] - pub stage_name: Option<String>, - #[doc = "Start time of the environment deployment execution"] - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option<TaskOrchestrationOwner>, + #[doc = "Id of the Environment"] + #[serde( + rename = "environmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_id: Option<i32>, + #[doc = "Finish time of the environment deployment execution"] + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[doc = "Id of the Environment deployment execution history record"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i64>, + #[doc = "Job Attempt"] + #[serde( + rename = "jobAttempt", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_attempt: Option<i32>, + #[doc = "Job name"] + #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] + pub job_name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<TaskOrchestrationOwner>, + #[doc = "Plan Id"] + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option<String>, + #[doc = "Plan type of the environment deployment execution record"] + #[serde(rename = "planType", default, skip_serializing_if = "Option::is_none")] + pub plan_type: Option<String>, + #[doc = "Queue time of the environment deployment execution"] + #[serde( + rename = "queueTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub queue_time: Option<time::OffsetDateTime>, + #[doc = "Request identifier of the Environment deployment execution history record"] + #[serde( + rename = "requestIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_identifier: Option<String>, + #[doc = "Resource Id"] + #[serde( + rename = "resourceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_id: Option<i32>, + #[doc = "Result of the environment deployment execution"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<environment_deployment_execution_record::Result>, + #[doc = "Project Id"] + #[serde(rename = "scopeId", default, skip_serializing_if = "Option::is_none")] + pub scope_id: Option<String>, + #[doc = "Service owner Id"] + #[serde( + rename = "serviceOwner", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_owner: Option<String>, + #[doc = "Stage Attempt"] + #[serde( + rename = "stageAttempt", + default, + skip_serializing_if = "Option::is_none" + )] + pub stage_attempt: Option<i32>, + #[doc = "Stage name"] + #[serde(rename = "stageName", default, skip_serializing_if = "Option::is_none")] + pub stage_name: Option<String>, + #[doc = "Start time of the environment deployment execution"] + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, } impl EnvironmentDeploymentExecutionRecord { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod environment_deployment_execution_record { - use super::*; - #[doc = "Result of the environment deployment execution"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "succeededWithIssues")] - SucceededWithIssues, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[doc = "Result of the environment deployment execution"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "succeededWithIssues")] + SucceededWithIssues, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentDeploymentExecutionRecordList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<EnvironmentDeploymentExecutionRecord>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<EnvironmentDeploymentExecutionRecord>, } impl EnvironmentDeploymentExecutionRecordList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Environment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentInstance { - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Creation time of the Environment"] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Description of the Environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Id of the Environment"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = ""] - #[serde( - rename = "lastModifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_modified_by: Option<IdentityRef>, - #[doc = "Last modified time of the Environment"] - #[serde( - rename = "lastModifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified_on: Option<time::OffsetDateTime>, - #[doc = "Name of the Environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub resources: Vec<EnvironmentResourceReference>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "Creation time of the Environment"] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Description of the Environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Id of the Environment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = ""] + #[serde( + rename = "lastModifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_modified_by: Option<IdentityRef>, + #[doc = "Last modified time of the Environment"] + #[serde( + rename = "lastModifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified_on: Option<time::OffsetDateTime>, + #[doc = "Name of the Environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub resources: Vec<EnvironmentResourceReference>, } impl EnvironmentInstance { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentInstanceList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<EnvironmentInstance>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<EnvironmentInstance>, } impl EnvironmentInstanceList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "EnvironmentLinkedResourceReference."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentLinkedResourceReference { - #[doc = "Id of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Type of resource."] - #[serde(rename = "typeName", default, skip_serializing_if = "Option::is_none")] - pub type_name: Option<String>, + #[doc = "Id of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Type of resource."] + #[serde(rename = "typeName", default, skip_serializing_if = "Option::is_none")] + pub type_name: Option<String>, } impl EnvironmentLinkedResourceReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl EnvironmentReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentResource { - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "environmentReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_reference: Option<EnvironmentReference>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = ""] - #[serde( - rename = "lastModifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_modified_by: Option<IdentityRef>, - #[serde( - rename = "lastModifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified_on: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Tags of the Environment Resource."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[doc = "Environment resource type"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<environment_resource::Type>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "environmentReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_reference: Option<EnvironmentReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = ""] + #[serde( + rename = "lastModifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_modified_by: Option<IdentityRef>, + #[serde( + rename = "lastModifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified_on: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Tags of the Environment Resource."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[doc = "Environment resource type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<environment_resource::Type>, } impl EnvironmentResource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod environment_resource { - use super::*; - #[doc = "Environment resource type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "generic")] - Generic, - #[serde(rename = "virtualMachine")] - VirtualMachine, - #[serde(rename = "kubernetes")] - Kubernetes, - } + use super::*; + #[doc = "Environment resource type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "generic")] + Generic, + #[serde(rename = "virtualMachine")] + VirtualMachine, + #[serde(rename = "kubernetes")] + Kubernetes, + } } #[doc = "EnvironmentResourceDeploymentExecutionRecord."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentResourceDeploymentExecutionRecord { - #[doc = "Id of the Environment"] - #[serde( - rename = "environmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_id: Option<i32>, - #[doc = "Finish time of the environment resource deployment execution"] - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = "Id of the Environment deployment execution history record"] - #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] - pub request_id: Option<i64>, - #[doc = "Resource Id"] - #[serde( - rename = "resourceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_id: Option<i32>, - #[doc = "Result of the environment deployment execution"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<environment_resource_deployment_execution_record::Result>, - #[doc = "Start time of the environment resource deployment execution"] - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, + #[doc = "Id of the Environment"] + #[serde( + rename = "environmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_id: Option<i32>, + #[doc = "Finish time of the environment resource deployment execution"] + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[doc = "Id of the Environment deployment execution history record"] + #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] + pub request_id: Option<i64>, + #[doc = "Resource Id"] + #[serde( + rename = "resourceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_id: Option<i32>, + #[doc = "Result of the environment deployment execution"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<environment_resource_deployment_execution_record::Result>, + #[doc = "Start time of the environment resource deployment execution"] + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, } impl EnvironmentResourceDeploymentExecutionRecord { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod environment_resource_deployment_execution_record { - use super::*; - #[doc = "Result of the environment deployment execution"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "succeededWithIssues")] - SucceededWithIssues, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[doc = "Result of the environment deployment execution"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "succeededWithIssues")] + SucceededWithIssues, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = "EnvironmentResourceReference."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentResourceReference { - #[doc = "Id of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Tags of the Environment Resource Reference."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[doc = "Type of the resource."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<environment_resource_reference::Type>, + #[doc = "Id of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Tags of the Environment Resource Reference."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[doc = "Type of the resource."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<environment_resource_reference::Type>, } impl EnvironmentResourceReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod environment_resource_reference { - use super::*; - #[doc = "Type of the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "generic")] - Generic, - #[serde(rename = "virtualMachine")] - VirtualMachine, - #[serde(rename = "kubernetes")] - Kubernetes, - } + use super::*; + #[doc = "Type of the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "generic")] + Generic, + #[serde(rename = "virtualMachine")] + VirtualMachine, + #[serde(rename = "kubernetes")] + Kubernetes, + } } #[doc = "Properties to update Environment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentUpdateParameter { - #[doc = "Description of the environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Name of the environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Description of the environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Name of the environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl EnvironmentUpdateParameter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventsConfig {} impl EventsConfig { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExpressionValidationItem { - #[serde(flatten)] - pub validation_item: ValidationItem, + #[serde(flatten)] + pub validation_item: ValidationItem, } impl ExpressionValidationItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HelpLink { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl HelpLink { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputBindingContext { - #[doc = "Value of the input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Value of the input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl InputBindingContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes an input for subscriptions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputDescriptor { - #[doc = "The ids of all inputs that the value of this input is dependent on."] - #[serde( - rename = "dependencyInputIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dependency_input_ids: Vec<String>, - #[doc = "Description of what this input is used for"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group."] - #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] - pub group_name: Option<String>, - #[doc = "If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change."] - #[serde( - rename = "hasDynamicValueInformation", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_dynamic_value_information: Option<bool>, - #[doc = "Identifier for the subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Mode in which the value of this input should be entered"] - #[serde(rename = "inputMode", default, skip_serializing_if = "Option::is_none")] - pub input_mode: Option<input_descriptor::InputMode>, - #[doc = "Gets whether this input is confidential, such as for a password or application key"] - #[serde( - rename = "isConfidential", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_confidential: Option<bool>, - #[doc = "Localized name which can be shown as a label for the subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Custom properties for the input which can be used by the service provider"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "Gets whether this input is included in the default generated action description."] - #[serde( - rename = "useInDefaultDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub use_in_default_description: Option<bool>, - #[doc = "Describes what values are valid for a subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub validation: Option<InputValidation>, - #[doc = "A hint for input value. It can be used in the UI as the input placeholder."] - #[serde(rename = "valueHint", default, skip_serializing_if = "Option::is_none")] - pub value_hint: Option<String>, - #[doc = "Information about the possible/allowed values for a given subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub values: Option<InputValues>, + #[doc = "The ids of all inputs that the value of this input is dependent on."] + #[serde( + rename = "dependencyInputIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dependency_input_ids: Vec<String>, + #[doc = "Description of what this input is used for"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group."] + #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] + pub group_name: Option<String>, + #[doc = "If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change."] + #[serde( + rename = "hasDynamicValueInformation", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_dynamic_value_information: Option<bool>, + #[doc = "Identifier for the subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Mode in which the value of this input should be entered"] + #[serde(rename = "inputMode", default, skip_serializing_if = "Option::is_none")] + pub input_mode: Option<input_descriptor::InputMode>, + #[doc = "Gets whether this input is confidential, such as for a password or application key"] + #[serde( + rename = "isConfidential", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_confidential: Option<bool>, + #[doc = "Localized name which can be shown as a label for the subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Custom properties for the input which can be used by the service provider"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "Gets whether this input is included in the default generated action description."] + #[serde( + rename = "useInDefaultDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub use_in_default_description: Option<bool>, + #[doc = "Describes what values are valid for a subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub validation: Option<InputValidation>, + #[doc = "A hint for input value. It can be used in the UI as the input placeholder."] + #[serde(rename = "valueHint", default, skip_serializing_if = "Option::is_none")] + pub value_hint: Option<String>, + #[doc = "Information about the possible/allowed values for a given subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option<InputValues>, } impl InputDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod input_descriptor { - use super::*; - #[doc = "Mode in which the value of this input should be entered"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum InputMode { - #[serde(rename = "none")] - None, - #[serde(rename = "textBox")] - TextBox, - #[serde(rename = "passwordBox")] - PasswordBox, - #[serde(rename = "combo")] - Combo, - #[serde(rename = "radioButtons")] - RadioButtons, - #[serde(rename = "checkBox")] - CheckBox, - #[serde(rename = "textArea")] - TextArea, - } + use super::*; + #[doc = "Mode in which the value of this input should be entered"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum InputMode { + #[serde(rename = "none")] + None, + #[serde(rename = "textBox")] + TextBox, + #[serde(rename = "passwordBox")] + PasswordBox, + #[serde(rename = "combo")] + Combo, + #[serde(rename = "radioButtons")] + RadioButtons, + #[serde(rename = "checkBox")] + CheckBox, + #[serde(rename = "textArea")] + TextArea, + } } #[doc = "Describes what values are valid for a subscription input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValidation { - #[doc = "Gets or sets the data type to validate."] - #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] - pub data_type: Option<input_validation::DataType>, - #[doc = "Gets or sets if this is a required field."] - #[serde( - rename = "isRequired", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_required: Option<bool>, - #[doc = "Gets or sets the maximum length of this descriptor."] - #[serde(rename = "maxLength", default, skip_serializing_if = "Option::is_none")] - pub max_length: Option<i32>, - #[doc = "Gets or sets the minimum value for this descriptor."] - #[serde(rename = "maxValue", default, skip_serializing_if = "Option::is_none")] - pub max_value: Option<String>, - #[doc = "Gets or sets the minimum length of this descriptor."] - #[serde(rename = "minLength", default, skip_serializing_if = "Option::is_none")] - pub min_length: Option<i32>, - #[doc = "Gets or sets the minimum value for this descriptor."] - #[serde(rename = "minValue", default, skip_serializing_if = "Option::is_none")] - pub min_value: Option<String>, - #[doc = "Gets or sets the pattern to validate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pattern: Option<String>, - #[doc = "Gets or sets the error on pattern mismatch."] - #[serde( - rename = "patternMismatchErrorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub pattern_mismatch_error_message: Option<String>, + #[doc = "Gets or sets the data data type to validate."] + #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] + pub data_type: Option<input_validation::DataType>, + #[doc = "Gets or sets if this is a required field."] + #[serde( + rename = "isRequired", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_required: Option<bool>, + #[doc = "Gets or sets the maximum length of this descriptor."] + #[serde(rename = "maxLength", default, skip_serializing_if = "Option::is_none")] + pub max_length: Option<i32>, + #[doc = "Gets or sets the minimum value for this descriptor."] + #[serde(rename = "maxValue", default, skip_serializing_if = "Option::is_none")] + pub max_value: Option<String>, + #[doc = "Gets or sets the minimum length of this descriptor."] + #[serde(rename = "minLength", default, skip_serializing_if = "Option::is_none")] + pub min_length: Option<i32>, + #[doc = "Gets or sets the minimum value for this descriptor."] + #[serde(rename = "minValue", default, skip_serializing_if = "Option::is_none")] + pub min_value: Option<String>, + #[doc = "Gets or sets the pattern to validate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pattern: Option<String>, + #[doc = "Gets or sets the error on pattern mismatch."] + #[serde( + rename = "patternMismatchErrorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub pattern_mismatch_error_message: Option<String>, } impl InputValidation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod input_validation { - use super::*; - #[doc = "Gets or sets the data type to validate."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DataType { - #[serde(rename = "none")] - None, - #[serde(rename = "string")] - String, - #[serde(rename = "number")] - Number, - #[serde(rename = "boolean")] - Boolean, - #[serde(rename = "guid")] - Guid, - #[serde(rename = "uri")] - Uri, - } + use super::*; + #[doc = "Gets or sets the data data type to validate."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DataType { + #[serde(rename = "none")] + None, + #[serde(rename = "string")] + String, + #[serde(rename = "number")] + Number, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "guid")] + Guid, + #[serde(rename = "uri")] + Uri, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValidationItem { - #[serde(flatten)] - pub validation_item: ValidationItem, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub context: Option<InputBindingContext>, + #[serde(flatten)] + pub validation_item: ValidationItem, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub context: Option<InputBindingContext>, } impl InputValidationItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValidationRequest { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inputs: Option<serde_json::Value>, } impl InputValidationRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Information about a single value for an input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValue { - #[doc = "Any other data about this input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "The text to show for the display of this value"] - #[serde( - rename = "displayValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_value: Option<String>, - #[doc = "The value to store for this input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Any other data about this input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "The text to show for the display of this value"] + #[serde( + rename = "displayValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_value: Option<String>, + #[doc = "The value to store for this input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl InputValue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Information about the possible/allowed values for a given subscription input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValues { - #[doc = "The default value to use for this input"] - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<String>, - #[doc = "Error information related to a subscription input value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option<InputValuesError>, - #[doc = "The id of the input"] - #[serde(rename = "inputId", default, skip_serializing_if = "Option::is_none")] - pub input_id: Option<String>, - #[doc = "Should this input be disabled"] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False)"] - #[serde( - rename = "isLimitedToPossibleValues", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_limited_to_possible_values: Option<bool>, - #[doc = "Should this input be made read-only"] - #[serde( - rename = "isReadOnly", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_read_only: Option<bool>, - #[doc = "Possible values that this input can take"] - #[serde( - rename = "possibleValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub possible_values: Vec<InputValue>, + #[doc = "The default value to use for this input"] + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<String>, + #[doc = "Error information related to a subscription input value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option<InputValuesError>, + #[doc = "The id of the input"] + #[serde(rename = "inputId", default, skip_serializing_if = "Option::is_none")] + pub input_id: Option<String>, + #[doc = "Should this input be disabled"] + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[doc = "Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False)"] + #[serde( + rename = "isLimitedToPossibleValues", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_limited_to_possible_values: Option<bool>, + #[doc = "Should this input be made read-only"] + #[serde( + rename = "isReadOnly", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_read_only: Option<bool>, + #[doc = "Possible values that this input can take"] + #[serde( + rename = "possibleValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub possible_values: Vec<InputValue>, } impl InputValues { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Error information related to a subscription input value."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValuesError { - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, } impl InputValuesError { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "An issue (error, warning) associated with a pipeline run."] +#[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Issue { - #[doc = "The category of the issue. <br />Example: Code - refers to compilation errors <br />Example: General - refers to generic errors"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option<String>, - #[doc = "A dictionary containing details about the issue."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "A description of issue."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "The type (error, warning) of the issue."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<issue::Type>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<issue::Type>, } impl Issue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod issue { - use super::*; - #[doc = "The type (error, warning) of the issue."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "error")] - Error, - #[serde(rename = "warning")] - Warning, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "error")] + Error, + #[serde(rename = "warning")] + Warning, + } } #[doc = "Represents a JSON object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JObject { - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<JToken>, - #[doc = "Gets the node type for this JToken."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<JToken>, + #[doc = "Gets the node type for this JToken."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl JObject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an abstract JSON token."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JToken { - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub first: Box<Option<JToken>>, - #[doc = "Gets a value indicating whether this token has child tokens."] - #[serde(rename = "hasValues", default, skip_serializing_if = "Option::is_none")] - pub has_values: Option<bool>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Box<Option<JToken>>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub last: Box<Option<JToken>>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub next: Box<Option<JToken>>, - #[doc = "Gets or sets the parent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option<String>, - #[doc = "Gets the path of the JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub previous: Box<Option<JToken>>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub root: Box<Option<JToken>>, - #[doc = "Gets the node type for this JToken."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first: Box<Option<JToken>>, + #[doc = "Gets a value indicating whether this token has child tokens."] + #[serde(rename = "hasValues", default, skip_serializing_if = "Option::is_none")] + pub has_values: Option<bool>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Box<Option<JToken>>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last: Box<Option<JToken>>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next: Box<Option<JToken>>, + #[doc = "Gets or sets the parent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option<String>, + #[doc = "Gets the path of the JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous: Box<Option<JToken>>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub root: Box<Option<JToken>>, + #[doc = "Gets the node type for this JToken."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl JToken { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobAssignedEvent { - #[serde(flatten)] - pub job_event: JobEvent, - #[doc = "A job request for an agent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub request: Option<TaskAgentJobRequest>, + #[serde(flatten)] + pub job_event: JobEvent, + #[doc = "A job request for an agent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request: Option<TaskAgentJobRequest>, } impl JobAssignedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobCancelMessage { - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option<String>, + #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] + pub job_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout: Option<String>, } impl JobCancelMessage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobCanceledEvent { - #[serde(flatten)] - pub job_event: JobEvent, - #[doc = "The reason for job cancellation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<String>, - #[doc = "The job's timeout interval."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option<String>, + #[serde(flatten)] + pub job_event: JobEvent, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout: Option<String>, } impl JobCanceledEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobCompletedEvent { - #[serde(flatten)] - pub job_event: JobEvent, - #[doc = "Indicates whether the agent is in the process of shutting down."] - #[serde( - rename = "agentShuttingDown", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_shutting_down: Option<bool>, - #[doc = "The ID of the request."] - #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] - pub request_id: Option<i64>, - #[doc = "The result of the request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<job_completed_event::Result>, + #[serde(flatten)] + pub job_event: JobEvent, + #[serde( + rename = "agentShuttingDown", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_shutting_down: Option<bool>, + #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] + pub request_id: Option<i64>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<job_completed_event::Result>, } impl JobCompletedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod job_completed_event { - use super::*; - #[doc = "The result of the request."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "succeededWithIssues")] - SucceededWithIssues, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "succeededWithIssues")] + SucceededWithIssues, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = "Represents the context of variables and vectors for a job request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobEnvironment { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub endpoints: Vec<ServiceEndpoint>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mask: Vec<MaskHint>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub options: Option<serde_json::Value>, - #[serde( - rename = "secureFiles", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub secure_files: Vec<SecureFile>, - #[doc = "Represents an endpoint which may be used by an orchestration job."] - #[serde( - rename = "systemConnection", - default, - skip_serializing_if = "Option::is_none" - )] - pub system_connection: Option<ServiceEndpoint>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub endpoints: Vec<ServiceEndpoint>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mask: Vec<MaskHint>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub options: Option<serde_json::Value>, + #[serde( + rename = "secureFiles", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub secure_files: Vec<SecureFile>, + #[doc = "Represents an endpoint which may be used by an orchestration job."] + #[serde( + rename = "systemConnection", + default, + skip_serializing_if = "Option::is_none" + )] + pub system_connection: Option<ServiceEndpoint>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl JobEnvironment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "A pipeline job event to be processed by the execution plan."] +#[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobEvent { - #[doc = "The ID of the pipeline job affected by the event."] - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option<String>, - #[doc = "The name of the pipeline job event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] + pub job_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl JobEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobEventConfig { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout: Option<String>, } impl JobEventConfig { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobEventsConfig { - #[serde(flatten)] - pub events_config: EventsConfig, - #[doc = ""] - #[serde( - rename = "jobAssigned", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_assigned: Option<JobEventConfig>, - #[doc = ""] - #[serde( - rename = "jobCompleted", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_completed: Option<JobEventConfig>, - #[doc = ""] - #[serde( - rename = "jobStarted", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_started: Option<JobEventConfig>, + #[serde(flatten)] + pub events_config: EventsConfig, + #[doc = ""] + #[serde( + rename = "jobAssigned", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_assigned: Option<JobEventConfig>, + #[doc = ""] + #[serde( + rename = "jobCompleted", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_completed: Option<JobEventConfig>, + #[doc = ""] + #[serde( + rename = "jobStarted", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_started: Option<JobEventConfig>, } impl JobEventsConfig { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobMetadataEvent { - #[serde(flatten)] - pub job_event: JobEvent, - #[doc = "A message to be sent to an agent currently running the job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<JobMetadataMessage>, + #[serde(flatten)] + pub job_event: JobEvent, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<JobMetadataMessage>, } impl JobMetadataEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "A message to be sent to an agent currently running the job."] +#[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobMetadataMessage { - #[doc = "The id of the job."] - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option<String>, - #[doc = "The agent's frequency of posting lines to the logs console expressed in milliseconds. There are 2 modes: Slow (10 seconds) and Fast (half a second)."] - #[serde( - rename = "postLinesFrequencyMillis", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_lines_frequency_millis: Option<i32>, + #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] + pub job_id: Option<String>, + #[serde( + rename = "postLinesFrequencyMillis", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_lines_frequency_millis: Option<i32>, } impl JobMetadataMessage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an option that may affect the way an agent runs the job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobOption { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "Gets the id of the option."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "Gets the id of the option."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl JobOption { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobRequestMessage { - #[doc = "Represents the context of variables and vectors for a job request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option<JobEnvironment>, - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option<String>, - #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] - pub job_name: Option<String>, - #[serde( - rename = "jobRefName", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_ref_name: Option<String>, - #[serde( - rename = "messageType", - default, - skip_serializing_if = "Option::is_none" - )] - pub message_type: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub plan: Option<TaskOrchestrationPlanReference>, - #[doc = "A reference to a timeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeline: Option<TimelineReference>, + #[doc = "Represents the context of variables and vectors for a job request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option<JobEnvironment>, + #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] + pub job_id: Option<String>, + #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] + pub job_name: Option<String>, + #[serde( + rename = "jobRefName", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_ref_name: Option<String>, + #[serde( + rename = "messageType", + default, + skip_serializing_if = "Option::is_none" + )] + pub message_type: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plan: Option<TaskOrchestrationPlanReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeline: Option<TimelineReference>, } impl JobRequestMessage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobStartedEvent { - #[serde(flatten)] - pub job_event: JobEvent, + #[serde(flatten)] + pub job_event: JobEvent, } impl JobStartedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct KubernetesResource { - #[serde(flatten)] - pub environment_resource: EnvironmentResource, - #[serde( - rename = "clusterName", - default, - skip_serializing_if = "Option::is_none" - )] - pub cluster_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option<String>, - #[serde( - rename = "serviceEndpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_id: Option<String>, + #[serde(flatten)] + pub environment_resource: EnvironmentResource, + #[serde( + rename = "clusterName", + default, + skip_serializing_if = "Option::is_none" + )] + pub cluster_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub namespace: Option<String>, + #[serde( + rename = "serviceEndpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_id: Option<String>, } impl KubernetesResource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct KubernetesResourceCreateParameters { - #[serde( - rename = "clusterName", - default, - skip_serializing_if = "Option::is_none" - )] - pub cluster_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option<String>, - #[doc = "Tags of the kubernetes resource."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, + #[serde( + rename = "clusterName", + default, + skip_serializing_if = "Option::is_none" + )] + pub cluster_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub namespace: Option<String>, + #[doc = "Tags of the kubernetes resource."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, } impl KubernetesResourceCreateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct KubernetesResourceCreateParametersExistingEndpoint { - #[serde(flatten)] - pub kubernetes_resource_create_parameters: KubernetesResourceCreateParameters, - #[serde( - rename = "serviceEndpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_id: Option<String>, + #[serde(flatten)] + pub kubernetes_resource_create_parameters: KubernetesResourceCreateParameters, + #[serde( + rename = "serviceEndpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_id: Option<String>, } impl KubernetesResourceCreateParametersExistingEndpoint { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct KubernetesResourceCreateParametersNewEndpoint { - #[serde(flatten)] - pub kubernetes_resource_create_parameters: KubernetesResourceCreateParameters, - #[doc = "Represents an endpoint which may be used by an orchestration job."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option<ServiceEndpoint>, + #[serde(flatten)] + pub kubernetes_resource_create_parameters: KubernetesResourceCreateParameters, + #[doc = "Represents an endpoint which may be used by an orchestration job."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub endpoint: Option<ServiceEndpoint>, } impl KubernetesResourceCreateParametersNewEndpoint { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct KubernetesResourcePatchParameters { - #[serde( - rename = "authorizationParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_parameters: Option<serde_json::Value>, - #[doc = "Provider type (CustomProvider or AzureKubernetesServiceProvider) of the resource to be updated"] - #[serde( - rename = "providerType", - default, - skip_serializing_if = "Option::is_none" - )] - pub provider_type: Option<String>, - #[serde( - rename = "resourceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_id: Option<i32>, + #[serde( + rename = "authorizationParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorization_parameters: Option<serde_json::Value>, + #[doc = "Provider type (CustomProvider or AzureKubernetesServiceProvider) of the resource to be updated"] + #[serde( + rename = "providerType", + default, + skip_serializing_if = "Option::is_none" + )] + pub provider_type: Option<String>, + #[serde( + rename = "resourceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_id: Option<i32>, } impl KubernetesResourcePatchParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a purchase of resource units in a secondary marketplace."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MarketplacePurchasedLicense { - #[doc = "The Marketplace display name."] - #[serde( - rename = "marketplaceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub marketplace_name: Option<String>, - #[doc = "The name of the identity making the purchase as seen by the marketplace"] - #[serde( - rename = "purchaserName", - default, - skip_serializing_if = "Option::is_none" - )] - pub purchaser_name: Option<String>, - #[doc = "The quantity purchased."] - #[serde( - rename = "purchaseUnitCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub purchase_unit_count: Option<i32>, + #[doc = "The Marketplace display name."] + #[serde( + rename = "marketplaceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub marketplace_name: Option<String>, + #[doc = "The name of the identity making the purchase as seen by the marketplace"] + #[serde( + rename = "purchaserName", + default, + skip_serializing_if = "Option::is_none" + )] + pub purchaser_name: Option<String>, + #[doc = "The quantity purchased."] + #[serde( + rename = "purchaseUnitCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub purchase_unit_count: Option<i32>, } impl MarketplacePurchasedLicense { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MaskHint { - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<mask_hint::Type>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<mask_hint::Type>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl MaskHint { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod mask_hint { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "variable")] - Variable, - #[serde(rename = "regex")] - Regex, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "variable")] + Variable, + #[serde(rename = "regex")] + Regex, + } } #[doc = "Meta data for a metrics column."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MetricsColumnMetaData { - #[doc = "Name."] - #[serde( - rename = "columnName", - default, - skip_serializing_if = "Option::is_none" - )] - pub column_name: Option<String>, - #[doc = "Data type."] - #[serde( - rename = "columnValueType", - default, - skip_serializing_if = "Option::is_none" - )] - pub column_value_type: Option<String>, + #[doc = "Name."] + #[serde( + rename = "columnName", + default, + skip_serializing_if = "Option::is_none" + )] + pub column_name: Option<String>, + #[doc = "Data type."] + #[serde( + rename = "columnValueType", + default, + skip_serializing_if = "Option::is_none" + )] + pub column_value_type: Option<String>, } impl MetricsColumnMetaData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metrics columns header"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MetricsColumnsHeader { - #[doc = "Properties of deployment group for which metrics are provided. E.g. 1: LastJobStatus E.g. 2: TargetState"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dimensions: Vec<MetricsColumnMetaData>, - #[doc = "The types of metrics. E.g. 1: total count of deployment targets. E.g. 2: Average time of deployment to the deployment targets."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub metrics: Vec<MetricsColumnMetaData>, + #[doc = "Properties of deployment group for which metrics are provided. E.g. 1: LastJobStatus E.g. 2: TargetState"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dimensions: Vec<MetricsColumnMetaData>, + #[doc = "The types of metrics. E.g. 1: total count of deployment targets. E.g. 2: Average time of deployment to the deployment targets."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub metrics: Vec<MetricsColumnMetaData>, } impl MetricsColumnsHeader { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metrics row."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MetricsRow { - #[doc = "The values of the properties mentioned as 'Dimensions' in column header. E.g. 1: For a property 'LastJobStatus' - metrics will be provided for 'passed', 'failed', etc. E.g. 2: For a property 'TargetState' - metrics will be provided for 'online', 'offline' targets."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dimensions: Vec<String>, - #[doc = "Metrics in serialized format. Should be deserialized based on the data type provided in header."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub metrics: Vec<String>, + #[doc = "The values of the properties mentioned as 'Dimensions' in column header. E.g. 1: For a property 'LastJobStatus' - metrics will be provided for 'passed', 'failed', etc. E.g. 2: For a property 'TargetState' - metrics will be provided for 'online', 'offline' targets."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dimensions: Vec<String>, + #[doc = "Metrics in serialized format. Should be deserialized based on the data type provided in header."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub metrics: Vec<String>, } impl MetricsRow { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a downloadable package."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageMetadata { - #[doc = "The date the package was created"] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "A direct link to download the package."] - #[serde( - rename = "downloadUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub download_url: Option<String>, - #[doc = "The UI uses this to display instructions, i.e. \"unzip MyAgent.zip\""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filename: Option<String>, - #[doc = "MD5 hash as a base64 string"] - #[serde(rename = "hashValue", default, skip_serializing_if = "Option::is_none")] - pub hash_value: Option<String>, - #[doc = "A link to documentation"] - #[serde(rename = "infoUrl", default, skip_serializing_if = "Option::is_none")] - pub info_url: Option<String>, - #[doc = "The platform (win7, linux, etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub platform: Option<String>, - #[doc = "The type of package (e.g. \"agent\")"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<PackageVersion>, + #[doc = "The date the package was created"] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "A direct link to download the package."] + #[serde( + rename = "downloadUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub download_url: Option<String>, + #[doc = "The UI uses this to display instructions, i.e. \"unzip MyAgent.zip\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filename: Option<String>, + #[doc = "MD5 hash as a base64 string"] + #[serde(rename = "hashValue", default, skip_serializing_if = "Option::is_none")] + pub hash_value: Option<String>, + #[doc = "A link to documentation"] + #[serde(rename = "infoUrl", default, skip_serializing_if = "Option::is_none")] + pub info_url: Option<String>, + #[doc = "The platform (win7, linux, etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub platform: Option<String>, + #[doc = "The type of package (e.g. \"agent\")"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<PackageVersion>, } impl PackageMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageVersion { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub major: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub minor: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub patch: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub major: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub minor: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub patch: Option<i32>, } impl PackageVersion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PlanEnvironment { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mask: Vec<MaskHint>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub options: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mask: Vec<MaskHint>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub options: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl PlanEnvironment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ProjectReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PropertiesCollection { - #[doc = "The count of properties in the collection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<serde_json::Value>, - #[doc = "The set of keys in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub keys: Vec<String>, - #[doc = "The set of values in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<String>, + #[doc = "The count of properties in the collection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<serde_json::Value>, + #[doc = "The set of keys in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub keys: Vec<String>, + #[doc = "The set of values in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<String>, } impl PropertiesCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PublishTaskGroupMetadata { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - rename = "parentDefinitionRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_definition_revision: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub preview: Option<bool>, - #[serde( - rename = "taskGroupId", - default, - skip_serializing_if = "Option::is_none" - )] - pub task_group_id: Option<String>, - #[serde( - rename = "taskGroupRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub task_group_revision: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + rename = "parentDefinitionRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_definition_revision: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preview: Option<bool>, + #[serde( + rename = "taskGroupId", + default, + skip_serializing_if = "Option::is_none" + )] + pub task_group_id: Option<String>, + #[serde( + rename = "taskGroupRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub task_group_revision: Option<i32>, } impl PublishTaskGroupMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceFilterOptions { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub identities: Vec<IdentityRef>, - #[serde( - rename = "resourceTypes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub resource_types: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub identities: Vec<IdentityRef>, + #[serde( + rename = "resourceTypes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub resource_types: Vec<String>, } impl ResourceFilterOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceFilters { - #[serde( - rename = "createdBy", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub created_by: Vec<String>, - #[serde( - rename = "resourceType", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub resource_type: Vec<String>, - #[serde( - rename = "searchText", - default, - skip_serializing_if = "Option::is_none" - )] - pub search_text: Option<String>, + #[serde( + rename = "createdBy", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub created_by: Vec<String>, + #[serde( + rename = "resourceType", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub resource_type: Vec<String>, + #[serde( + rename = "searchText", + default, + skip_serializing_if = "Option::is_none" + )] + pub search_text: Option<String>, } impl ResourceFilters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Resources include Service Connections, Variable Groups and Secure Files."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceItem { - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Gets or sets description of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Gets or sets icon url of the resource."] - #[serde(rename = "iconUrl", default, skip_serializing_if = "Option::is_none")] - pub icon_url: Option<String>, - #[doc = "Gets or sets Id of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Indicates whether resource is shared with other projects or not."] - #[serde(rename = "isShared", default, skip_serializing_if = "Option::is_none")] - pub is_shared: Option<bool>, - #[doc = "Gets or sets name of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets internal properties of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Gets or sets resource type."] - #[serde( - rename = "resourceType", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_type: Option<String>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "Gets or sets description of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Gets or sets icon url of the resource."] + #[serde(rename = "iconUrl", default, skip_serializing_if = "Option::is_none")] + pub icon_url: Option<String>, + #[doc = "Gets or sets Id of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Indicates whether resource is shared with other projects or not."] + #[serde(rename = "isShared", default, skip_serializing_if = "Option::is_none")] + pub is_shared: Option<bool>, + #[doc = "Gets or sets name of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets internal properties of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Gets or sets resource type."] + #[serde( + rename = "resourceType", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_type: Option<String>, } impl ResourceItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceLimit { - #[serde( - rename = "failedToReachAllProviders", - default, - skip_serializing_if = "Option::is_none" - )] - pub failed_to_reach_all_providers: Option<bool>, - #[serde(rename = "hostId", default, skip_serializing_if = "Option::is_none")] - pub host_id: Option<String>, - #[serde(rename = "isHosted", default, skip_serializing_if = "Option::is_none")] - pub is_hosted: Option<bool>, - #[serde(rename = "isPremium", default, skip_serializing_if = "Option::is_none")] - pub is_premium: Option<bool>, - #[serde( - rename = "parallelismTag", - default, - skip_serializing_if = "Option::is_none" - )] - pub parallelism_tag: Option<String>, - #[serde( - rename = "resourceLimitsData", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_limits_data: Option<serde_json::Value>, - #[serde( - rename = "totalCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_count: Option<i32>, - #[serde( - rename = "totalMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_minutes: Option<i32>, + #[serde( + rename = "failedToReachAllProviders", + default, + skip_serializing_if = "Option::is_none" + )] + pub failed_to_reach_all_providers: Option<bool>, + #[serde(rename = "hostId", default, skip_serializing_if = "Option::is_none")] + pub host_id: Option<String>, + #[serde(rename = "isHosted", default, skip_serializing_if = "Option::is_none")] + pub is_hosted: Option<bool>, + #[serde(rename = "isPremium", default, skip_serializing_if = "Option::is_none")] + pub is_premium: Option<bool>, + #[serde( + rename = "parallelismTag", + default, + skip_serializing_if = "Option::is_none" + )] + pub parallelism_tag: Option<String>, + #[serde( + rename = "resourceLimitsData", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_limits_data: Option<serde_json::Value>, + #[serde( + rename = "totalCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_count: Option<i32>, + #[serde( + rename = "totalMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_minutes: Option<i32>, } impl ResourceLimit { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A request for a resource's exclusive lock"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceLockRequest { - #[doc = "The date/time this request was assigned."] - #[serde( - rename = "assignTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub assign_time: Option<time::OffsetDateTime>, - #[doc = "The ID of the check run waiting on this request"] - #[serde( - rename = "checkRunId", - default, - skip_serializing_if = "Option::is_none" - )] - pub check_run_id: Option<String>, - #[doc = "The ID of the pipeline that requested this resource"] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "The date/time this request was finished."] - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = "The behavior this request should exhibit in relation to other lock requests"] - #[serde(rename = "lockType", default, skip_serializing_if = "Option::is_none")] - pub lock_type: Option<resource_lock_request::LockType>, - #[doc = "Attempt of the graph node"] - #[serde( - rename = "nodeAttempt", - default, - skip_serializing_if = "Option::is_none" - )] - pub node_attempt: Option<i32>, - #[doc = "Name of the graph node (currently stage) requesting this resource"] - #[serde(rename = "nodeName", default, skip_serializing_if = "Option::is_none")] - pub node_name: Option<String>, - #[doc = "Internal ID for the orchestration plan connected with this request."] - #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] - pub plan_id: Option<String>, - #[doc = "The ID of the project of the check run and definition exist in"] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "The date/time this request was queued."] - #[serde( - rename = "queueTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub queue_time: Option<time::OffsetDateTime>, - #[doc = "ID of the request."] - #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] - pub request_id: Option<i64>, - #[doc = "The id of the resource"] - #[serde( - rename = "resourceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_id: Option<String>, - #[doc = "The type of the resource"] - #[serde( - rename = "resourceType", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_type: Option<String>, - #[doc = "The result of this request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<resource_lock_request::Status>, + #[doc = "The date/time this request was assigned."] + #[serde( + rename = "assignTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub assign_time: Option<time::OffsetDateTime>, + #[doc = "The ID of the check run waiting on this request"] + #[serde( + rename = "checkRunId", + default, + skip_serializing_if = "Option::is_none" + )] + pub check_run_id: Option<String>, + #[doc = "The ID of the pipeline that requested this resource"] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "The date/time this request was finished."] + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[doc = "The behavior this request should exhibit in relation to other lock requests"] + #[serde(rename = "lockType", default, skip_serializing_if = "Option::is_none")] + pub lock_type: Option<resource_lock_request::LockType>, + #[doc = "Attempt of the graph node"] + #[serde( + rename = "nodeAttempt", + default, + skip_serializing_if = "Option::is_none" + )] + pub node_attempt: Option<i32>, + #[doc = "Name of the graph node (currently stage) requesting this resource"] + #[serde(rename = "nodeName", default, skip_serializing_if = "Option::is_none")] + pub node_name: Option<String>, + #[doc = "Internal ID for the orchestration plan connected with this request."] + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option<String>, + #[doc = "The ID of the project of the check run and definition exist in"] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "The date/time this request was queued."] + #[serde( + rename = "queueTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub queue_time: Option<time::OffsetDateTime>, + #[doc = "ID of the request."] + #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] + pub request_id: Option<i64>, + #[doc = "The id of the resource"] + #[serde( + rename = "resourceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_id: Option<String>, + #[doc = "The type of the resource"] + #[serde( + rename = "resourceType", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_type: Option<String>, + #[doc = "The result of this request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<resource_lock_request::Status>, } impl ResourceLockRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod resource_lock_request { - use super::*; - #[doc = "The behavior this request should exhibit in relation to other lock requests"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum LockType { - #[serde(rename = "runLatest")] - RunLatest, - #[serde(rename = "sequential")] - Sequential, - } - #[doc = "The result of this request."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "queued")] - Queued, - #[serde(rename = "inUse")] - InUse, - #[serde(rename = "finished")] - Finished, - #[serde(rename = "timedOut")] - TimedOut, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "abandoned")] - Abandoned, - #[serde(rename = "waitingOnChecks")] - WaitingOnChecks, - } + use super::*; + #[doc = "The behavior this request should exhibit in relation to other lock requests"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum LockType { + #[serde(rename = "runLatest")] + RunLatest, + #[serde(rename = "sequential")] + Sequential, + } + #[doc = "The result of this request."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "queued")] + Queued, + #[serde(rename = "inUse")] + InUse, + #[serde(rename = "finished")] + Finished, + #[serde(rename = "timedOut")] + TimedOut, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "abandoned")] + Abandoned, + #[serde(rename = "waitingOnChecks")] + WaitingOnChecks, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceUsage { - #[doc = ""] - #[serde( - rename = "resourceLimit", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_limit: Option<ResourceLimit>, - #[serde( - rename = "runningRequests", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub running_requests: Vec<TaskAgentJobRequest>, - #[serde(rename = "usedCount", default, skip_serializing_if = "Option::is_none")] - pub used_count: Option<i32>, - #[serde( - rename = "usedMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub used_minutes: Option<i32>, + #[doc = ""] + #[serde( + rename = "resourceLimit", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_limit: Option<ResourceLimit>, + #[serde( + rename = "runningRequests", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub running_requests: Vec<TaskAgentJobRequest>, + #[serde(rename = "usedCount", default, skip_serializing_if = "Option::is_none")] + pub used_count: Option<i32>, + #[serde( + rename = "usedMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub used_minutes: Option<i32>, } impl ResourceUsage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourcesHubData { - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[serde( - rename = "hasProjectLevelManagePermission", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_project_level_manage_permission: Option<bool>, - #[doc = ""] - #[serde( - rename = "resourceFilterOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_filter_options: Option<ResourceFilterOptions>, - #[doc = ""] - #[serde( - rename = "resourceFilters", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_filters: Option<ResourceFilters>, - #[serde( - rename = "resourceItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub resource_items: Vec<ResourceItem>, + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[serde( + rename = "hasProjectLevelManagePermission", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_project_level_manage_permission: Option<bool>, + #[doc = ""] + #[serde( + rename = "resourceFilterOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_filter_options: Option<ResourceFilterOptions>, + #[doc = ""] + #[serde( + rename = "resourceFilters", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_filters: Option<ResourceFilters>, + #[serde( + rename = "resourceItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub resource_items: Vec<ResourceItem>, } impl ResourcesHubData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultTransformationDetails { - #[serde( - rename = "resultTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_template: Option<String>, + #[serde( + rename = "resultTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_template: Option<String>, } impl ResultTransformationDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecureFile { - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ticket: Option<String>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ticket: Option<String>, } impl SecureFile { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecureFileEvent { - #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] - pub event_type: Option<String>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "secureFiles", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub secure_files: Vec<SecureFile>, + #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] + pub event_type: Option<String>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "secureFiles", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub secure_files: Vec<SecureFile>, } impl SecureFileEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SendJobResponse { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub events: Option<JobEventsConfig>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub events: Option<JobEventsConfig>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl SendJobResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServerExecutionDefinition { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub events: Option<EventsConfig>, - #[serde( - rename = "handlerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub handler_name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub events: Option<EventsConfig>, + #[serde( + rename = "handlerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub handler_name: Option<String>, } impl ServerExecutionDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServerTaskRequestMessage { - #[serde(flatten)] - pub job_request_message: JobRequestMessage, - #[doc = ""] - #[serde( - rename = "taskDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub task_definition: Option<TaskDefinition>, - #[doc = ""] - #[serde( - rename = "taskInstance", - default, - skip_serializing_if = "Option::is_none" - )] - pub task_instance: Option<TaskInstance>, + #[serde(flatten)] + pub job_request_message: JobRequestMessage, + #[doc = ""] + #[serde( + rename = "taskDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub task_definition: Option<TaskDefinition>, + #[doc = ""] + #[serde( + rename = "taskInstance", + default, + skip_serializing_if = "Option::is_none" + )] + pub task_instance: Option<TaskInstance>, } impl ServerTaskRequestMessage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an endpoint which may be used by an orchestration job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpoint { - #[doc = ""] - #[serde( - rename = "administratorsGroup", - default, - skip_serializing_if = "Option::is_none" - )] - pub administrators_group: Option<IdentityRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorization: Option<EndpointAuthorization>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "Gets or sets the description of endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde( - rename = "groupScopeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_scope_id: Option<String>, - #[doc = "Gets or sets the identifier of this endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "EndPoint state indicator"] - #[serde(rename = "isReady", default, skip_serializing_if = "Option::is_none")] - pub is_ready: Option<bool>, - #[doc = "Indicates whether service endpoint is shared with other projects or not."] - #[serde(rename = "isShared", default, skip_serializing_if = "Option::is_none")] - pub is_shared: Option<bool>, - #[doc = "Gets or sets the friendly name of the endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Error message during creation/deletion of endpoint"] - #[serde( - rename = "operationStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_status: Option<serde_json::Value>, - #[doc = "Gets or sets the owner of the endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[doc = ""] - #[serde( - rename = "readersGroup", - default, - skip_serializing_if = "Option::is_none" - )] - pub readers_group: Option<IdentityRef>, - #[doc = "Gets or sets the type of the endpoint."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "Gets or sets the url of the endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = ""] + #[serde( + rename = "administratorsGroup", + default, + skip_serializing_if = "Option::is_none" + )] + pub administrators_group: Option<IdentityRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorization: Option<EndpointAuthorization>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "Gets or sets the description of endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde( + rename = "groupScopeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_scope_id: Option<String>, + #[doc = "Gets or sets the identifier of this endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "EndPoint state indicator"] + #[serde(rename = "isReady", default, skip_serializing_if = "Option::is_none")] + pub is_ready: Option<bool>, + #[doc = "Indicates whether service endpoint is shared with other projects or not."] + #[serde(rename = "isShared", default, skip_serializing_if = "Option::is_none")] + pub is_shared: Option<bool>, + #[doc = "Gets or sets the friendly name of the endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Error message during creation/deletion of endpoint"] + #[serde( + rename = "operationStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_status: Option<serde_json::Value>, + #[doc = "Gets or sets the owner of the endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[doc = ""] + #[serde( + rename = "readersGroup", + default, + skip_serializing_if = "Option::is_none" + )] + pub readers_group: Option<IdentityRef>, + #[doc = "Gets or sets the type of the endpoint."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "Gets or sets the url of the endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ServiceEndpoint { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointAuthenticationScheme { - #[doc = "Gets or sets the authorization headers of service endpoint authentication scheme."] - #[serde( - rename = "authorizationHeaders", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub authorization_headers: Vec<AuthorizationHeader>, - #[doc = "Gets or sets the certificates of service endpoint authentication scheme."] - #[serde( - rename = "clientCertificates", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub client_certificates: Vec<ClientCertificate>, - #[doc = "Gets or sets the display name for the service endpoint authentication scheme."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Gets or sets the input descriptors for the service endpoint authentication scheme."] - #[serde( - rename = "inputDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_descriptors: Vec<InputDescriptor>, - #[doc = "Gets or sets the scheme for service endpoint authentication."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scheme: Option<String>, + #[doc = "Gets or sets the authorization headers of service endpoint authentication scheme."] + #[serde( + rename = "authorizationHeaders", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub authorization_headers: Vec<AuthorizationHeader>, + #[doc = "Gets or sets the certificates of service endpoint authentication scheme."] + #[serde( + rename = "clientCertificates", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub client_certificates: Vec<ClientCertificate>, + #[doc = "Gets or sets the display name for the service endpoint authentication scheme."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Gets or sets the input descriptors for the service endpoint authentication scheme."] + #[serde( + rename = "inputDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_descriptors: Vec<InputDescriptor>, + #[doc = "Gets or sets the scheme for service endpoint authentication."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scheme: Option<String>, } impl ServiceEndpointAuthenticationScheme { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointDetails { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorization: Option<EndpointAuthorization>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorization: Option<EndpointAuthorization>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ServiceEndpointDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents service endpoint execution data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointExecutionData { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub definition: Option<TaskOrchestrationOwner>, - #[doc = "Gets the finish time of service endpoint execution."] - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = "Gets the Id of service endpoint execution data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i64>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<TaskOrchestrationOwner>, - #[doc = "Gets the plan type of service endpoint execution data."] - #[serde(rename = "planType", default, skip_serializing_if = "Option::is_none")] - pub plan_type: Option<String>, - #[doc = "Gets the result of service endpoint execution."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<service_endpoint_execution_data::Result>, - #[doc = "Gets the start time of service endpoint execution."] - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option<TaskOrchestrationOwner>, + #[doc = "Gets the finish time of service endpoint execution."] + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[doc = "Gets the Id of service endpoint execution data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i64>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<TaskOrchestrationOwner>, + #[doc = "Gets the plan type of service endpoint execution data."] + #[serde(rename = "planType", default, skip_serializing_if = "Option::is_none")] + pub plan_type: Option<String>, + #[doc = "Gets the result of service endpoint execution."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<service_endpoint_execution_data::Result>, + #[doc = "Gets the start time of service endpoint execution."] + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, } impl ServiceEndpointExecutionData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod service_endpoint_execution_data { - use super::*; - #[doc = "Gets the result of service endpoint execution."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "succeededWithIssues")] - SucceededWithIssues, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[doc = "Gets the result of service endpoint execution."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "succeededWithIssues")] + SucceededWithIssues, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointExecutionRecord { - #[doc = "Represents service endpoint execution data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<ServiceEndpointExecutionData>, - #[doc = "Gets the Id of service endpoint."] - #[serde( - rename = "endpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_id: Option<String>, + #[doc = "Represents service endpoint execution data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<ServiceEndpointExecutionData>, + #[doc = "Gets the Id of service endpoint."] + #[serde( + rename = "endpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_id: Option<String>, } impl ServiceEndpointExecutionRecord { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointExecutionRecordsInput { - #[doc = "Represents service endpoint execution data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<ServiceEndpointExecutionData>, - #[serde( - rename = "endpointIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub endpoint_ids: Vec<String>, + #[doc = "Represents service endpoint execution data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<ServiceEndpointExecutionData>, + #[serde( + rename = "endpointIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub endpoint_ids: Vec<String>, } impl ServiceEndpointExecutionRecordsInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointRequest { - #[doc = ""] - #[serde( - rename = "dataSourceDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub data_source_details: Option<DataSourceDetails>, - #[doc = ""] - #[serde( - rename = "resultTransformationDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_transformation_details: Option<ResultTransformationDetails>, - #[doc = ""] - #[serde( - rename = "serviceEndpointDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_details: Option<ServiceEndpointDetails>, + #[doc = ""] + #[serde( + rename = "dataSourceDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub data_source_details: Option<DataSourceDetails>, + #[doc = ""] + #[serde( + rename = "resultTransformationDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_transformation_details: Option<ResultTransformationDetails>, + #[doc = ""] + #[serde( + rename = "serviceEndpointDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_details: Option<ServiceEndpointDetails>, } impl ServiceEndpointRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointRequestResult { - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<JToken>, - #[serde( - rename = "statusCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_code: Option<service_endpoint_request_result::StatusCode>, + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<JToken>, + #[serde( + rename = "statusCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_code: Option<service_endpoint_request_result::StatusCode>, } impl ServiceEndpointRequestResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod service_endpoint_request_result { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum StatusCode { - #[serde(rename = "continue")] - Continue, - #[serde(rename = "switchingProtocols")] - SwitchingProtocols, - #[serde(rename = "ok")] - Ok, - #[serde(rename = "created")] - Created, - #[serde(rename = "accepted")] - Accepted, - #[serde(rename = "nonAuthoritativeInformation")] - NonAuthoritativeInformation, - #[serde(rename = "noContent")] - NoContent, - #[serde(rename = "resetContent")] - ResetContent, - #[serde(rename = "partialContent")] - PartialContent, - #[serde(rename = "multipleChoices")] - MultipleChoices, - #[serde(rename = "ambiguous")] - Ambiguous, - #[serde(rename = "movedPermanently")] - MovedPermanently, - #[serde(rename = "moved")] - Moved, - #[serde(rename = "found")] - Found, - #[serde(rename = "redirect")] - Redirect, - #[serde(rename = "seeOther")] - SeeOther, - #[serde(rename = "redirectMethod")] - RedirectMethod, - #[serde(rename = "notModified")] - NotModified, - #[serde(rename = "useProxy")] - UseProxy, - #[serde(rename = "unused")] - Unused, - #[serde(rename = "temporaryRedirect")] - TemporaryRedirect, - #[serde(rename = "redirectKeepVerb")] - RedirectKeepVerb, - #[serde(rename = "badRequest")] - BadRequest, - #[serde(rename = "unauthorized")] - Unauthorized, - #[serde(rename = "paymentRequired")] - PaymentRequired, - #[serde(rename = "forbidden")] - Forbidden, - #[serde(rename = "notFound")] - NotFound, - #[serde(rename = "methodNotAllowed")] - MethodNotAllowed, - #[serde(rename = "notAcceptable")] - NotAcceptable, - #[serde(rename = "proxyAuthenticationRequired")] - ProxyAuthenticationRequired, - #[serde(rename = "requestTimeout")] - RequestTimeout, - #[serde(rename = "conflict")] - Conflict, - #[serde(rename = "gone")] - Gone, - #[serde(rename = "lengthRequired")] - LengthRequired, - #[serde(rename = "preconditionFailed")] - PreconditionFailed, - #[serde(rename = "requestEntityTooLarge")] - RequestEntityTooLarge, - #[serde(rename = "requestUriTooLong")] - RequestUriTooLong, - #[serde(rename = "unsupportedMediaType")] - UnsupportedMediaType, - #[serde(rename = "requestedRangeNotSatisfiable")] - RequestedRangeNotSatisfiable, - #[serde(rename = "expectationFailed")] - ExpectationFailed, - #[serde(rename = "upgradeRequired")] - UpgradeRequired, - #[serde(rename = "internalServerError")] - InternalServerError, - #[serde(rename = "notImplemented")] - NotImplemented, - #[serde(rename = "badGateway")] - BadGateway, - #[serde(rename = "serviceUnavailable")] - ServiceUnavailable, - #[serde(rename = "gatewayTimeout")] - GatewayTimeout, - #[serde(rename = "httpVersionNotSupported")] - HttpVersionNotSupported, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum StatusCode { + #[serde(rename = "continue")] + Continue, + #[serde(rename = "switchingProtocols")] + SwitchingProtocols, + #[serde(rename = "ok")] + Ok, + #[serde(rename = "created")] + Created, + #[serde(rename = "accepted")] + Accepted, + #[serde(rename = "nonAuthoritativeInformation")] + NonAuthoritativeInformation, + #[serde(rename = "noContent")] + NoContent, + #[serde(rename = "resetContent")] + ResetContent, + #[serde(rename = "partialContent")] + PartialContent, + #[serde(rename = "multipleChoices")] + MultipleChoices, + #[serde(rename = "ambiguous")] + Ambiguous, + #[serde(rename = "movedPermanently")] + MovedPermanently, + #[serde(rename = "moved")] + Moved, + #[serde(rename = "found")] + Found, + #[serde(rename = "redirect")] + Redirect, + #[serde(rename = "seeOther")] + SeeOther, + #[serde(rename = "redirectMethod")] + RedirectMethod, + #[serde(rename = "notModified")] + NotModified, + #[serde(rename = "useProxy")] + UseProxy, + #[serde(rename = "unused")] + Unused, + #[serde(rename = "temporaryRedirect")] + TemporaryRedirect, + #[serde(rename = "redirectKeepVerb")] + RedirectKeepVerb, + #[serde(rename = "badRequest")] + BadRequest, + #[serde(rename = "unauthorized")] + Unauthorized, + #[serde(rename = "paymentRequired")] + PaymentRequired, + #[serde(rename = "forbidden")] + Forbidden, + #[serde(rename = "notFound")] + NotFound, + #[serde(rename = "methodNotAllowed")] + MethodNotAllowed, + #[serde(rename = "notAcceptable")] + NotAcceptable, + #[serde(rename = "proxyAuthenticationRequired")] + ProxyAuthenticationRequired, + #[serde(rename = "requestTimeout")] + RequestTimeout, + #[serde(rename = "conflict")] + Conflict, + #[serde(rename = "gone")] + Gone, + #[serde(rename = "lengthRequired")] + LengthRequired, + #[serde(rename = "preconditionFailed")] + PreconditionFailed, + #[serde(rename = "requestEntityTooLarge")] + RequestEntityTooLarge, + #[serde(rename = "requestUriTooLong")] + RequestUriTooLong, + #[serde(rename = "unsupportedMediaType")] + UnsupportedMediaType, + #[serde(rename = "requestedRangeNotSatisfiable")] + RequestedRangeNotSatisfiable, + #[serde(rename = "expectationFailed")] + ExpectationFailed, + #[serde(rename = "upgradeRequired")] + UpgradeRequired, + #[serde(rename = "internalServerError")] + InternalServerError, + #[serde(rename = "notImplemented")] + NotImplemented, + #[serde(rename = "badGateway")] + BadGateway, + #[serde(rename = "serviceUnavailable")] + ServiceUnavailable, + #[serde(rename = "gatewayTimeout")] + GatewayTimeout, + #[serde(rename = "httpVersionNotSupported")] + HttpVersionNotSupported, + } } #[doc = "Represents type of the service endpoint."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointType { - #[doc = "Authentication scheme of service endpoint type."] - #[serde( - rename = "authenticationSchemes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub authentication_schemes: Vec<ServiceEndpointAuthenticationScheme>, - #[doc = "Data sources of service endpoint type."] - #[serde( - rename = "dataSources", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub data_sources: Vec<DataSource>, - #[doc = "Dependency data of service endpoint type."] - #[serde( - rename = "dependencyData", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dependency_data: Vec<DependencyData>, - #[doc = "Gets or sets the description of service endpoint type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Gets or sets the display name of service endpoint type."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Represents url of the service endpoint."] - #[serde( - rename = "endpointUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_url: Option<EndpointUrl>, - #[doc = ""] - #[serde(rename = "helpLink", default, skip_serializing_if = "Option::is_none")] - pub help_link: Option<HelpLink>, - #[serde( - rename = "helpMarkDown", - default, - skip_serializing_if = "Option::is_none" - )] - pub help_mark_down: Option<String>, - #[doc = "Gets or sets the icon url of service endpoint type."] - #[serde(rename = "iconUrl", default, skip_serializing_if = "Option::is_none")] - pub icon_url: Option<String>, - #[doc = "Input descriptor of service endpoint type."] - #[serde( - rename = "inputDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_descriptors: Vec<InputDescriptor>, - #[doc = "Gets or sets the name of service endpoint type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Trusted hosts of a service endpoint type."] - #[serde( - rename = "trustedHosts", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub trusted_hosts: Vec<String>, - #[doc = "Gets or sets the ui contribution id of service endpoint type."] - #[serde( - rename = "uiContributionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub ui_contribution_id: Option<String>, + #[doc = "Authentication scheme of service endpoint type."] + #[serde( + rename = "authenticationSchemes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub authentication_schemes: Vec<ServiceEndpointAuthenticationScheme>, + #[doc = "Data sources of service endpoint type."] + #[serde( + rename = "dataSources", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub data_sources: Vec<DataSource>, + #[doc = "Dependency data of service endpoint type."] + #[serde( + rename = "dependencyData", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dependency_data: Vec<DependencyData>, + #[doc = "Gets or sets the description of service endpoint type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Gets or sets the display name of service endpoint type."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Represents url of the service endpoint."] + #[serde( + rename = "endpointUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_url: Option<EndpointUrl>, + #[doc = ""] + #[serde(rename = "helpLink", default, skip_serializing_if = "Option::is_none")] + pub help_link: Option<HelpLink>, + #[serde( + rename = "helpMarkDown", + default, + skip_serializing_if = "Option::is_none" + )] + pub help_mark_down: Option<String>, + #[doc = "Gets or sets the icon url of service endpoint type."] + #[serde(rename = "iconUrl", default, skip_serializing_if = "Option::is_none")] + pub icon_url: Option<String>, + #[doc = "Input descriptor of service endpoint type."] + #[serde( + rename = "inputDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_descriptors: Vec<InputDescriptor>, + #[doc = "Gets or sets the name of service endpoint type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Trusted hosts of a service endpoint type."] + #[serde( + rename = "trustedHosts", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub trusted_hosts: Vec<String>, + #[doc = "Gets or sets the ui contribution id of service endpoint type."] + #[serde( + rename = "uiContributionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub ui_contribution_id: Option<String>, } impl ServiceEndpointType { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A task agent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgent { - #[serde(flatten)] - pub task_agent_reference: TaskAgentReference, - #[doc = ""] - #[serde( - rename = "assignedAgentCloudRequest", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_agent_cloud_request: Option<TaskAgentCloudRequest>, - #[doc = "A job request for an agent."] - #[serde( - rename = "assignedRequest", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_request: Option<TaskAgentJobRequest>, - #[doc = "Provides data necessary for authorizing the agent using OAuth 2.0 authentication flows."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorization: Option<TaskAgentAuthorization>, - #[doc = "Date on which this agent was created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "A job request for an agent."] - #[serde( - rename = "lastCompletedRequest", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_completed_request: Option<TaskAgentJobRequest>, - #[doc = "Maximum job parallelism allowed for this agent."] - #[serde( - rename = "maxParallelism", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_parallelism: Option<i32>, - #[doc = "Details about an agent update."] - #[serde( - rename = "pendingUpdate", - default, - skip_serializing_if = "Option::is_none" - )] - pub pending_update: Option<TaskAgentUpdate>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "Date on which the last connectivity status change occurred."] - #[serde( - rename = "statusChangedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub status_changed_on: Option<time::OffsetDateTime>, - #[doc = "System-defined capabilities supported by this agent's host. Warning: To set capabilities use the PUT method, PUT will completely overwrite existing capabilities."] - #[serde( - rename = "systemCapabilities", - default, - skip_serializing_if = "Option::is_none" - )] - pub system_capabilities: Option<serde_json::Value>, - #[doc = "User-defined capabilities supported by this agent's host. Warning: To set capabilities use the PUT method, PUT will completely overwrite existing capabilities."] - #[serde( - rename = "userCapabilities", - default, - skip_serializing_if = "Option::is_none" - )] - pub user_capabilities: Option<serde_json::Value>, + #[serde(flatten)] + pub task_agent_reference: TaskAgentReference, + #[doc = ""] + #[serde( + rename = "assignedAgentCloudRequest", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_agent_cloud_request: Option<TaskAgentCloudRequest>, + #[doc = "A job request for an agent."] + #[serde( + rename = "assignedRequest", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_request: Option<TaskAgentJobRequest>, + #[doc = "Provides data necessary for authorizing the agent using OAuth 2.0 authentication flows."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorization: Option<TaskAgentAuthorization>, + #[doc = "Date on which this agent was created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "A job request for an agent."] + #[serde( + rename = "lastCompletedRequest", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_completed_request: Option<TaskAgentJobRequest>, + #[doc = "Maximum job parallelism allowed for this agent."] + #[serde( + rename = "maxParallelism", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_parallelism: Option<i32>, + #[doc = "Details about an agent update."] + #[serde( + rename = "pendingUpdate", + default, + skip_serializing_if = "Option::is_none" + )] + pub pending_update: Option<TaskAgentUpdate>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "Date on which the last connectivity status change occurred."] + #[serde( + rename = "statusChangedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub status_changed_on: Option<time::OffsetDateTime>, + #[doc = "System-defined capabilities supported by this agent's host. Warning: To set capabilities use the PUT method, PUT will completely overwrite existing capabilities."] + #[serde( + rename = "systemCapabilities", + default, + skip_serializing_if = "Option::is_none" + )] + pub system_capabilities: Option<serde_json::Value>, + #[doc = "User-defined capabilities supported by this agent's host. Warning: To set capabilities use the PUT method, PUT will completely overwrite existing capabilities."] + #[serde( + rename = "userCapabilities", + default, + skip_serializing_if = "Option::is_none" + )] + pub user_capabilities: Option<serde_json::Value>, } impl TaskAgent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Provides data necessary for authorizing the agent using OAuth 2.0 authentication flows."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentAuthorization { - #[doc = "Endpoint used to obtain access tokens from the configured token service."] - #[serde( - rename = "authorizationUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_url: Option<String>, - #[doc = "Client identifier for this agent."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option<String>, - #[doc = "Represents the public key portion of an RSA asymmetric key."] - #[serde(rename = "publicKey", default, skip_serializing_if = "Option::is_none")] - pub public_key: Option<TaskAgentPublicKey>, + #[doc = "Endpoint used to obtain access tokens from the configured token service."] + #[serde( + rename = "authorizationUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorization_url: Option<String>, + #[doc = "Client identifier for this agent."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option<String>, + #[doc = "Represents the public key portion of an RSA asymmetric key."] + #[serde(rename = "publicKey", default, skip_serializing_if = "Option::is_none")] + pub public_key: Option<TaskAgentPublicKey>, } impl TaskAgentAuthorization { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentCloud { - #[doc = "Gets or sets a AcquireAgentEndpoint using which a request can be made to acquire new agent"] - #[serde( - rename = "acquireAgentEndpoint", - default, - skip_serializing_if = "Option::is_none" - )] - pub acquire_agent_endpoint: Option<String>, - #[serde( - rename = "acquisitionTimeout", - default, - skip_serializing_if = "Option::is_none" - )] - pub acquisition_timeout: Option<i32>, - #[serde( - rename = "agentCloudId", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_cloud_id: Option<i32>, - #[serde( - rename = "getAccountParallelismEndpoint", - default, - skip_serializing_if = "Option::is_none" - )] - pub get_account_parallelism_endpoint: Option<String>, - #[serde( - rename = "getAgentDefinitionEndpoint", - default, - skip_serializing_if = "Option::is_none" - )] - pub get_agent_definition_endpoint: Option<String>, - #[serde( - rename = "getAgentRequestStatusEndpoint", - default, - skip_serializing_if = "Option::is_none" - )] - pub get_agent_request_status_endpoint: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Signifies that this Agent Cloud is internal and should not be user-manageable"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub internal: Option<bool>, - #[serde( - rename = "maxParallelism", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_parallelism: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "releaseAgentEndpoint", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_agent_endpoint: Option<String>, - #[serde( - rename = "sharedSecret", - default, - skip_serializing_if = "Option::is_none" - )] - pub shared_secret: Option<String>, - #[doc = "Gets or sets the type of the endpoint."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Gets or sets a AcquireAgentEndpoint using which a request can be made to acquire new agent"] + #[serde( + rename = "acquireAgentEndpoint", + default, + skip_serializing_if = "Option::is_none" + )] + pub acquire_agent_endpoint: Option<String>, + #[serde( + rename = "acquisitionTimeout", + default, + skip_serializing_if = "Option::is_none" + )] + pub acquisition_timeout: Option<i32>, + #[serde( + rename = "agentCloudId", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_cloud_id: Option<i32>, + #[serde( + rename = "getAccountParallelismEndpoint", + default, + skip_serializing_if = "Option::is_none" + )] + pub get_account_parallelism_endpoint: Option<String>, + #[serde( + rename = "getAgentDefinitionEndpoint", + default, + skip_serializing_if = "Option::is_none" + )] + pub get_agent_definition_endpoint: Option<String>, + #[serde( + rename = "getAgentRequestStatusEndpoint", + default, + skip_serializing_if = "Option::is_none" + )] + pub get_agent_request_status_endpoint: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Signifies that this Agent Cloud is internal and should not be user-manageable"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub internal: Option<bool>, + #[serde( + rename = "maxParallelism", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_parallelism: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "releaseAgentEndpoint", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_agent_endpoint: Option<String>, + #[serde( + rename = "sharedSecret", + default, + skip_serializing_if = "Option::is_none" + )] + pub shared_secret: Option<String>, + #[doc = "Gets or sets the type of the endpoint."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl TaskAgentCloud { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentCloudList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TaskAgentCloud>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TaskAgentCloud>, } impl TaskAgentCloudList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentCloudRequest { - #[doc = "A reference to an agent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub agent: Option<TaskAgentReference>, - #[serde( - rename = "agentCloudId", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_cloud_id: Option<i32>, - #[serde( - rename = "agentConnectedTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub agent_connected_time: Option<time::OffsetDateTime>, - #[serde(rename = "agentData", default, skip_serializing_if = "Option::is_none")] - pub agent_data: Option<serde_json::Value>, - #[serde( - rename = "agentSpecification", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_specification: Option<serde_json::Value>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pool: Option<TaskAgentPoolReference>, - #[serde( - rename = "provisionedTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub provisioned_time: Option<time::OffsetDateTime>, - #[serde( - rename = "provisionRequestTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub provision_request_time: Option<time::OffsetDateTime>, - #[serde( - rename = "releaseRequestTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub release_request_time: Option<time::OffsetDateTime>, - #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] - pub request_id: Option<String>, + #[doc = "A reference to an agent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub agent: Option<TaskAgentReference>, + #[serde( + rename = "agentCloudId", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_cloud_id: Option<i32>, + #[serde( + rename = "agentConnectedTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub agent_connected_time: Option<time::OffsetDateTime>, + #[serde(rename = "agentData", default, skip_serializing_if = "Option::is_none")] + pub agent_data: Option<serde_json::Value>, + #[serde( + rename = "agentSpecification", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_specification: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pool: Option<TaskAgentPoolReference>, + #[serde( + rename = "provisionedTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub provisioned_time: Option<time::OffsetDateTime>, + #[serde( + rename = "provisionRequestTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub provision_request_time: Option<time::OffsetDateTime>, + #[serde( + rename = "releaseRequestTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub release_request_time: Option<time::OffsetDateTime>, + #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] + pub request_id: Option<String>, } impl TaskAgentCloudRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentCloudRequestList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TaskAgentCloudRequest>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TaskAgentCloudRequest>, } impl TaskAgentCloudRequestList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentCloudType { - #[doc = "Gets or sets the display name of agent cloud type."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Gets or sets the input descriptors"] - #[serde( - rename = "inputDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_descriptors: Vec<InputDescriptor>, - #[doc = "Gets or sets the name of agent cloud type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Gets or sets the display name of agent cloud type."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Gets or sets the input descriptors"] + #[serde( + rename = "inputDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_descriptors: Vec<InputDescriptor>, + #[doc = "Gets or sets the name of agent cloud type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TaskAgentCloudType { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentCloudTypeList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TaskAgentCloudType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TaskAgentCloudType>, } impl TaskAgentCloudTypeList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentDowngrade { - #[serde(flatten)] - pub task_agent_update_reason: TaskAgentUpdateReason, + #[serde(flatten)] + pub task_agent_update_reason: TaskAgentUpdateReason, } impl TaskAgentDowngrade { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentJob { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub container: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "sidecarContainers", - default, - skip_serializing_if = "Option::is_none" - )] - pub sidecar_containers: Option<serde_json::Value>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub steps: Vec<TaskAgentJobStep>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub variables: Vec<TaskAgentJobVariable>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub container: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "sidecarContainers", + default, + skip_serializing_if = "Option::is_none" + )] + pub sidecar_containers: Option<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub steps: Vec<TaskAgentJobStep>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub variables: Vec<TaskAgentJobVariable>, } impl TaskAgentJob { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A job request for an agent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentJobRequest { - #[serde( - rename = "agentSpecification", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_specification: Option<serde_json::Value>, - #[doc = "The date/time this request was assigned."] - #[serde( - rename = "assignTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub assign_time: Option<time::OffsetDateTime>, - #[doc = "Additional data about the request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub definition: Option<TaskOrchestrationOwner>, - #[doc = "A list of demands required to fulfill this request."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub demands: Vec<Demand>, - #[doc = "The date/time this request was finished."] - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = "The host which triggered this request."] - #[serde(rename = "hostId", default, skip_serializing_if = "Option::is_none")] - pub host_id: Option<String>, - #[doc = "ID of the job resulting from this request."] - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option<String>, - #[doc = "Name of the job resulting from this request."] - #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] - pub job_name: Option<String>, - #[doc = "The deadline for the agent to renew the lock."] - #[serde( - rename = "lockedUntil", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub locked_until: Option<time::OffsetDateTime>, - #[serde( - rename = "matchedAgents", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub matched_agents: Vec<TaskAgentReference>, - #[serde( - rename = "matchesAllAgentsInPool", - default, - skip_serializing_if = "Option::is_none" - )] - pub matches_all_agents_in_pool: Option<bool>, - #[serde( - rename = "orchestrationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub orchestration_id: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<TaskOrchestrationOwner>, - #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] - pub plan_group: Option<String>, - #[doc = "Internal ID for the orchestration plan connected with this request."] - #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] - pub plan_id: Option<String>, - #[doc = "Internal detail representing the type of orchestration plan."] - #[serde(rename = "planType", default, skip_serializing_if = "Option::is_none")] - pub plan_type: Option<String>, - #[doc = "The ID of the pool this request targets"] - #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] - pub pool_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option<i32>, - #[doc = "The ID of the queue this request targets"] - #[serde(rename = "queueId", default, skip_serializing_if = "Option::is_none")] - pub queue_id: Option<i32>, - #[doc = "The date/time this request was queued."] - #[serde( - rename = "queueTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub queue_time: Option<time::OffsetDateTime>, - #[doc = "The date/time this request was receieved by an agent."] - #[serde( - rename = "receiveTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub receive_time: Option<time::OffsetDateTime>, - #[doc = "ID of the request."] - #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] - pub request_id: Option<i64>, - #[doc = "A reference to an agent."] - #[serde( - rename = "reservedAgent", - default, - skip_serializing_if = "Option::is_none" - )] - pub reserved_agent: Option<TaskAgentReference>, - #[doc = "The result of this request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<task_agent_job_request::Result>, - #[doc = "Scope of the pipeline; matches the project ID."] - #[serde(rename = "scopeId", default, skip_serializing_if = "Option::is_none")] - pub scope_id: Option<String>, - #[doc = "The service which owns this request."] - #[serde( - rename = "serviceOwner", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_owner: Option<String>, - #[serde( - rename = "statusMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_message: Option<String>, - #[serde( - rename = "userDelayed", - default, - skip_serializing_if = "Option::is_none" - )] - pub user_delayed: Option<bool>, + #[serde( + rename = "agentSpecification", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_specification: Option<serde_json::Value>, + #[doc = "The date/time this request was assigned."] + #[serde( + rename = "assignTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub assign_time: Option<time::OffsetDateTime>, + #[doc = "Additional data about the request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option<TaskOrchestrationOwner>, + #[doc = "A list of demands required to fulfill this request."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub demands: Vec<Demand>, + #[doc = "The date/time this request was finished."] + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[doc = "The host which triggered this request."] + #[serde(rename = "hostId", default, skip_serializing_if = "Option::is_none")] + pub host_id: Option<String>, + #[doc = "ID of the job resulting from this request."] + #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] + pub job_id: Option<String>, + #[doc = "Name of the job resulting from this request."] + #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] + pub job_name: Option<String>, + #[doc = "The deadline for the agent to renew the lock."] + #[serde( + rename = "lockedUntil", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub locked_until: Option<time::OffsetDateTime>, + #[serde( + rename = "matchedAgents", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub matched_agents: Vec<TaskAgentReference>, + #[serde( + rename = "matchesAllAgentsInPool", + default, + skip_serializing_if = "Option::is_none" + )] + pub matches_all_agents_in_pool: Option<bool>, + #[serde( + rename = "orchestrationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub orchestration_id: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<TaskOrchestrationOwner>, + #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] + pub plan_group: Option<String>, + #[doc = "Internal ID for the orchestration plan connected with this request."] + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option<String>, + #[doc = "Internal detail representing the type of orchestration plan."] + #[serde(rename = "planType", default, skip_serializing_if = "Option::is_none")] + pub plan_type: Option<String>, + #[doc = "The ID of the pool this request targets"] + #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] + pub pool_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub priority: Option<i32>, + #[doc = "The ID of the queue this request targets"] + #[serde(rename = "queueId", default, skip_serializing_if = "Option::is_none")] + pub queue_id: Option<i32>, + #[doc = "The date/time this request was queued."] + #[serde( + rename = "queueTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub queue_time: Option<time::OffsetDateTime>, + #[doc = "The date/time this request was receieved by an agent."] + #[serde( + rename = "receiveTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub receive_time: Option<time::OffsetDateTime>, + #[doc = "ID of the request."] + #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] + pub request_id: Option<i64>, + #[doc = "A reference to an agent."] + #[serde( + rename = "reservedAgent", + default, + skip_serializing_if = "Option::is_none" + )] + pub reserved_agent: Option<TaskAgentReference>, + #[doc = "The result of this request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<task_agent_job_request::Result>, + #[doc = "Scope of the pipeline; matches the project ID."] + #[serde(rename = "scopeId", default, skip_serializing_if = "Option::is_none")] + pub scope_id: Option<String>, + #[doc = "The service which owns this request."] + #[serde( + rename = "serviceOwner", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_owner: Option<String>, + #[serde( + rename = "statusMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_message: Option<String>, + #[serde( + rename = "userDelayed", + default, + skip_serializing_if = "Option::is_none" + )] + pub user_delayed: Option<bool>, } impl TaskAgentJobRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_agent_job_request { - use super::*; - #[doc = "The result of this request."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "succeededWithIssues")] - SucceededWithIssues, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[doc = "The result of this request."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "succeededWithIssues")] + SucceededWithIssues, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentJobStep { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub condition: Option<String>, - #[serde( - rename = "continueOnError", - default, - skip_serializing_if = "Option::is_none" - )] - pub continue_on_error: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub env: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "retryCountOnTaskFailure", - default, - skip_serializing_if = "Option::is_none" - )] - pub retry_count_on_task_failure: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub task: Option<TaskAgentJobTask>, - #[serde( - rename = "timeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeout_in_minutes: Option<i32>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<task_agent_job_step::Type>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub condition: Option<String>, + #[serde( + rename = "continueOnError", + default, + skip_serializing_if = "Option::is_none" + )] + pub continue_on_error: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub env: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inputs: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "retryCountOnTaskFailure", + default, + skip_serializing_if = "Option::is_none" + )] + pub retry_count_on_task_failure: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub task: Option<TaskAgentJobTask>, + #[serde( + rename = "timeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeout_in_minutes: Option<i32>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<task_agent_job_step::Type>, } impl TaskAgentJobStep { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_agent_job_step { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "task")] - Task, - #[serde(rename = "action")] - Action, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "task")] + Task, + #[serde(rename = "action")] + Action, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentJobTask { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl TaskAgentJobTask { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentJobVariable { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub secret: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub secret: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl TaskAgentJobVariable { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TaskAgent>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TaskAgent>, } impl TaskAgentList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentManualUpdate { - #[serde(flatten)] - pub task_agent_update_reason: TaskAgentUpdateReason, + #[serde(flatten)] + pub task_agent_update_reason: TaskAgentUpdateReason, } impl TaskAgentManualUpdate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Provides a contract for receiving messages from the task orchestrator."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentMessage { - #[doc = "Gets or sets the body of the message. If the <c>IV</c> property is provided the body will need to be decrypted using the <c>TaskAgentSession.EncryptionKey</c> value in addition to the <c>IV</c>."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub body: Option<String>, - #[doc = "Gets or sets the initialization vector used to encrypt this message."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub iv: Vec<String>, - #[doc = "Gets or sets the message identifier."] - #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")] - pub message_id: Option<i64>, - #[doc = "Gets or sets the message type, describing the data contract found in <c>TaskAgentMessage.Body</c>."] - #[serde( - rename = "messageType", - default, - skip_serializing_if = "Option::is_none" - )] - pub message_type: Option<String>, + #[doc = "Gets or sets the body of the message. If the <c>IV</c> property is provided the body will need to be decrypted using the <c>TaskAgentSession.EncryptionKey</c> value in addition to the <c>IV</c>."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub body: Option<String>, + #[doc = "Gets or sets the initialization vector used to encrypt this message."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub iv: Vec<String>, + #[doc = "Gets or sets the message identifier."] + #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")] + pub message_id: Option<i64>, + #[doc = "Gets or sets the message type, describing the data contract found in <c>TaskAgentMessage.Body</c>."] + #[serde( + rename = "messageType", + default, + skip_serializing_if = "Option::is_none" + )] + pub message_type: Option<String>, } impl TaskAgentMessage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentMinAgentVersionRequiredUpdate { - #[serde(flatten)] - pub task_agent_update_reason: TaskAgentUpdateReason, - #[doc = ""] - #[serde( - rename = "jobDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_definition: Option<TaskOrchestrationOwner>, - #[doc = ""] - #[serde(rename = "jobOwner", default, skip_serializing_if = "Option::is_none")] - pub job_owner: Option<TaskOrchestrationOwner>, - #[doc = ""] - #[serde( - rename = "minAgentVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub min_agent_version: Option<Demand>, + #[serde(flatten)] + pub task_agent_update_reason: TaskAgentUpdateReason, + #[doc = ""] + #[serde( + rename = "jobDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_definition: Option<TaskOrchestrationOwner>, + #[doc = ""] + #[serde(rename = "jobOwner", default, skip_serializing_if = "Option::is_none")] + pub job_owner: Option<TaskOrchestrationOwner>, + #[doc = ""] + #[serde( + rename = "minAgentVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub min_agent_version: Option<Demand>, } impl TaskAgentMinAgentVersionRequiredUpdate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An organization-level grouping of agents."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentPool { - #[serde(flatten)] - pub task_agent_pool_reference: TaskAgentPoolReference, - #[doc = "The ID of the associated agent cloud."] - #[serde( - rename = "agentCloudId", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_cloud_id: Option<i32>, - #[doc = "Whether or not a queue should be automatically provisioned for each project collection."] - #[serde( - rename = "autoProvision", - default, - skip_serializing_if = "Option::is_none" - )] - pub auto_provision: Option<bool>, - #[doc = "Whether or not the pool should autosize itself based on the Agent Cloud Provider settings."] - #[serde(rename = "autoSize", default, skip_serializing_if = "Option::is_none")] - pub auto_size: Option<bool>, - #[doc = "Whether or not agents in this pool are allowed to automatically update"] - #[serde( - rename = "autoUpdate", - default, - skip_serializing_if = "Option::is_none" - )] - pub auto_update: Option<bool>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "The date/time of the pool creation."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "Target parallelism - Only applies to agent pools that are backed by pool providers. It will be null for regular pools."] - #[serde( - rename = "targetSize", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_size: Option<i32>, + #[serde(flatten)] + pub task_agent_pool_reference: TaskAgentPoolReference, + #[doc = "The ID of the associated agent cloud."] + #[serde( + rename = "agentCloudId", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_cloud_id: Option<i32>, + #[doc = "Whether or not a queue should be automatically provisioned for each project collection."] + #[serde( + rename = "autoProvision", + default, + skip_serializing_if = "Option::is_none" + )] + pub auto_provision: Option<bool>, + #[doc = "Whether or not the pool should autosize itself based on the Agent Cloud Provider settings."] + #[serde(rename = "autoSize", default, skip_serializing_if = "Option::is_none")] + pub auto_size: Option<bool>, + #[doc = "Whether or not agents in this pool are allowed to automatically update"] + #[serde( + rename = "autoUpdate", + default, + skip_serializing_if = "Option::is_none" + )] + pub auto_update: Option<bool>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "The date/time of the pool creation."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "Target parallelism."] + #[serde( + rename = "targetSize", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_size: Option<i32>, } impl TaskAgentPool { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentPoolList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TaskAgentPool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TaskAgentPool>, } impl TaskAgentPoolList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentPoolMaintenanceDefinition { - #[doc = "Enable maintenance"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[doc = "Id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Maintenance job timeout per agent"] - #[serde( - rename = "jobTimeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_timeout_in_minutes: Option<i32>, - #[doc = "Max percentage of agents within a pool running maintenance job at given time"] - #[serde( - rename = "maxConcurrentAgentsPercentage", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_concurrent_agents_percentage: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub options: Option<TaskAgentPoolMaintenanceOptions>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pool: Option<TaskAgentPoolReference>, - #[doc = ""] - #[serde( - rename = "retentionPolicy", - default, - skip_serializing_if = "Option::is_none" - )] - pub retention_policy: Option<TaskAgentPoolMaintenanceRetentionPolicy>, - #[doc = ""] - #[serde( - rename = "scheduleSetting", - default, - skip_serializing_if = "Option::is_none" - )] - pub schedule_setting: Option<TaskAgentPoolMaintenanceSchedule>, + #[doc = "Enable maintenance"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[doc = "Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Maintenance job timeout per agent"] + #[serde( + rename = "jobTimeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_timeout_in_minutes: Option<i32>, + #[doc = "Max percentage of agents within a pool running maintenance job at given time"] + #[serde( + rename = "maxConcurrentAgentsPercentage", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_concurrent_agents_percentage: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub options: Option<TaskAgentPoolMaintenanceOptions>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pool: Option<TaskAgentPoolReference>, + #[doc = ""] + #[serde( + rename = "retentionPolicy", + default, + skip_serializing_if = "Option::is_none" + )] + pub retention_policy: Option<TaskAgentPoolMaintenanceRetentionPolicy>, + #[doc = ""] + #[serde( + rename = "scheduleSetting", + default, + skip_serializing_if = "Option::is_none" + )] + pub schedule_setting: Option<TaskAgentPoolMaintenanceSchedule>, } impl TaskAgentPoolMaintenanceDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentPoolMaintenanceJob { - #[doc = "The maintenance definition for the maintenance job"] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "The total error counts during the maintenance job"] - #[serde( - rename = "errorCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_count: Option<i32>, - #[doc = "Time that the maintenance job was completed"] - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = "Id of the maintenance job"] - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option<i32>, - #[doc = "The log download url for the maintenance job"] - #[serde( - rename = "logsDownloadUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub logs_download_url: Option<String>, - #[doc = "Orchestration/Plan Id for the maintenance job"] - #[serde( - rename = "orchestrationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub orchestration_id: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pool: Option<TaskAgentPoolReference>, - #[doc = "Time that the maintenance job was queued"] - #[serde( - rename = "queueTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub queue_time: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "requestedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_by: Option<IdentityRef>, - #[doc = "The maintenance job result"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<task_agent_pool_maintenance_job::Result>, - #[doc = "Time that the maintenance job was started"] - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, - #[doc = "Status of the maintenance job"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<task_agent_pool_maintenance_job::Status>, - #[serde( - rename = "targetAgents", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub target_agents: Vec<TaskAgentPoolMaintenanceJobTargetAgent>, - #[doc = "The total warning counts during the maintenance job"] - #[serde( - rename = "warningCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub warning_count: Option<i32>, + #[doc = "The maintenance definition for the maintenance job"] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "The total error counts during the maintenance job"] + #[serde( + rename = "errorCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_count: Option<i32>, + #[doc = "Time that the maintenance job was completed"] + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[doc = "Id of the maintenance job"] + #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] + pub job_id: Option<i32>, + #[doc = "The log download url for the maintenance job"] + #[serde( + rename = "logsDownloadUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub logs_download_url: Option<String>, + #[doc = "Orchestration/Plan Id for the maintenance job"] + #[serde( + rename = "orchestrationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub orchestration_id: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pool: Option<TaskAgentPoolReference>, + #[doc = "Time that the maintenance job was queued"] + #[serde( + rename = "queueTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub queue_time: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "requestedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_by: Option<IdentityRef>, + #[doc = "The maintenance job result"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<task_agent_pool_maintenance_job::Result>, + #[doc = "Time that the maintenance job was started"] + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, + #[doc = "Status of the maintenance job"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<task_agent_pool_maintenance_job::Status>, + #[serde( + rename = "targetAgents", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub target_agents: Vec<TaskAgentPoolMaintenanceJobTargetAgent>, + #[doc = "The total warning counts during the maintenance job"] + #[serde( + rename = "warningCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub warning_count: Option<i32>, } impl TaskAgentPoolMaintenanceJob { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_agent_pool_maintenance_job { - use super::*; - #[doc = "The maintenance job result"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - } - #[doc = "Status of the maintenance job"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "cancelling")] - Cancelling, - #[serde(rename = "queued")] - Queued, - } + use super::*; + #[doc = "The maintenance job result"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + } + #[doc = "Status of the maintenance job"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "cancelling")] + Cancelling, + #[serde(rename = "queued")] + Queued, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentPoolMaintenanceJobTargetAgent { - #[doc = "A reference to an agent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub agent: Option<TaskAgentReference>, - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<task_agent_pool_maintenance_job_target_agent::Result>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<task_agent_pool_maintenance_job_target_agent::Status>, + #[doc = "A reference to an agent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub agent: Option<TaskAgentReference>, + #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] + pub job_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<task_agent_pool_maintenance_job_target_agent::Result>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<task_agent_pool_maintenance_job_target_agent::Status>, } impl TaskAgentPoolMaintenanceJobTargetAgent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_agent_pool_maintenance_job_target_agent { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "cancelling")] - Cancelling, - #[serde(rename = "queued")] - Queued, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "cancelling")] + Cancelling, + #[serde(rename = "queued")] + Queued, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentPoolMaintenanceOptions { - #[doc = "time to consider a System.DefaultWorkingDirectory is stale"] - #[serde( - rename = "workingDirectoryExpirationInDays", - default, - skip_serializing_if = "Option::is_none" - )] - pub working_directory_expiration_in_days: Option<i32>, + #[doc = "time to consider a System.DefaultWorkingDirectory is stale"] + #[serde( + rename = "workingDirectoryExpirationInDays", + default, + skip_serializing_if = "Option::is_none" + )] + pub working_directory_expiration_in_days: Option<i32>, } impl TaskAgentPoolMaintenanceOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentPoolMaintenanceRetentionPolicy { - #[doc = "Number of records to keep for maintenance job executed with this definition."] - #[serde( - rename = "numberOfHistoryRecordsToKeep", - default, - skip_serializing_if = "Option::is_none" - )] - pub number_of_history_records_to_keep: Option<i32>, + #[doc = "Number of records to keep for maintenance job executed with this definition."] + #[serde( + rename = "numberOfHistoryRecordsToKeep", + default, + skip_serializing_if = "Option::is_none" + )] + pub number_of_history_records_to_keep: Option<i32>, } impl TaskAgentPoolMaintenanceRetentionPolicy { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentPoolMaintenanceSchedule { - #[doc = "Days for a build (flags enum for days of the week)"] - #[serde( - rename = "daysToBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub days_to_build: Option<task_agent_pool_maintenance_schedule::DaysToBuild>, - #[doc = "The Job Id of the Scheduled job that will queue the pool maintenance job."] - #[serde( - rename = "scheduleJobId", - default, - skip_serializing_if = "Option::is_none" - )] - pub schedule_job_id: Option<String>, - #[doc = "Local timezone hour to start"] - #[serde( - rename = "startHours", - default, - skip_serializing_if = "Option::is_none" - )] - pub start_hours: Option<i32>, - #[doc = "Local timezone minute to start"] - #[serde( - rename = "startMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub start_minutes: Option<i32>, - #[doc = "Time zone of the build schedule (string representation of the time zone id)"] - #[serde( - rename = "timeZoneId", - default, - skip_serializing_if = "Option::is_none" - )] - pub time_zone_id: Option<String>, + #[doc = "Days for a build (flags enum for days of the week)"] + #[serde( + rename = "daysToBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub days_to_build: Option<task_agent_pool_maintenance_schedule::DaysToBuild>, + #[doc = "The Job Id of the Scheduled job that will queue the pool maintenance job."] + #[serde( + rename = "scheduleJobId", + default, + skip_serializing_if = "Option::is_none" + )] + pub schedule_job_id: Option<String>, + #[doc = "Local timezone hour to start"] + #[serde( + rename = "startHours", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_hours: Option<i32>, + #[doc = "Local timezone minute to start"] + #[serde( + rename = "startMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_minutes: Option<i32>, + #[doc = "Time zone of the build schedule (string representation of the time zone id)"] + #[serde( + rename = "timeZoneId", + default, + skip_serializing_if = "Option::is_none" + )] + pub time_zone_id: Option<String>, } impl TaskAgentPoolMaintenanceSchedule { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_agent_pool_maintenance_schedule { - use super::*; - #[doc = "Days for a build (flags enum for days of the week)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DaysToBuild { - #[serde(rename = "none")] - None, - #[serde(rename = "monday")] - Monday, - #[serde(rename = "tuesday")] - Tuesday, - #[serde(rename = "wednesday")] - Wednesday, - #[serde(rename = "thursday")] - Thursday, - #[serde(rename = "friday")] - Friday, - #[serde(rename = "saturday")] - Saturday, - #[serde(rename = "sunday")] - Sunday, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "Days for a build (flags enum for days of the week)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DaysToBuild { + #[serde(rename = "none")] + None, + #[serde(rename = "monday")] + Monday, + #[serde(rename = "tuesday")] + Tuesday, + #[serde(rename = "wednesday")] + Wednesday, + #[serde(rename = "thursday")] + Thursday, + #[serde(rename = "friday")] + Friday, + #[serde(rename = "saturday")] + Saturday, + #[serde(rename = "sunday")] + Sunday, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentPoolReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Gets or sets a value indicating whether or not this pool is managed by the service."] - #[serde(rename = "isHosted", default, skip_serializing_if = "Option::is_none")] - pub is_hosted: Option<bool>, - #[doc = "Determines whether the pool is legacy."] - #[serde(rename = "isLegacy", default, skip_serializing_if = "Option::is_none")] - pub is_legacy: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Additional pool settings and details"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub options: Option<task_agent_pool_reference::Options>, - #[doc = "Gets or sets the type of the pool"] - #[serde(rename = "poolType", default, skip_serializing_if = "Option::is_none")] - pub pool_type: Option<task_agent_pool_reference::PoolType>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, - #[doc = "Gets the current size of the pool."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Gets or sets a value indicating whether or not this pool is managed by the service."] + #[serde(rename = "isHosted", default, skip_serializing_if = "Option::is_none")] + pub is_hosted: Option<bool>, + #[doc = "Determines whether the pool is legacy."] + #[serde(rename = "isLegacy", default, skip_serializing_if = "Option::is_none")] + pub is_legacy: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Additional pool settings and details"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub options: Option<task_agent_pool_reference::Options>, + #[doc = "Gets or sets the type of the pool"] + #[serde(rename = "poolType", default, skip_serializing_if = "Option::is_none")] + pub pool_type: Option<task_agent_pool_reference::PoolType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, + #[doc = "Gets the current size of the pool."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i32>, } impl TaskAgentPoolReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_agent_pool_reference { - use super::*; - #[doc = "Additional pool settings and details"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Options { - #[serde(rename = "none")] - None, - #[serde(rename = "elasticPool")] - ElasticPool, - #[serde(rename = "singleUseAgents")] - SingleUseAgents, - #[serde(rename = "preserveAgentOnJobFailure")] - PreserveAgentOnJobFailure, - } - #[doc = "Gets or sets the type of the pool"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum PoolType { - #[serde(rename = "automation")] - Automation, - #[serde(rename = "deployment")] - Deployment, - } + use super::*; + #[doc = "Additional pool settings and details"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Options { + #[serde(rename = "none")] + None, + #[serde(rename = "elasticPool")] + ElasticPool, + #[serde(rename = "singleUseAgents")] + SingleUseAgents, + #[serde(rename = "preserveAgentOnJobFailure")] + PreserveAgentOnJobFailure, + } + #[doc = "Gets or sets the type of the pool"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum PoolType { + #[serde(rename = "automation")] + Automation, + #[serde(rename = "deployment")] + Deployment, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentPoolStatus { - #[serde(flatten)] - pub task_agent_pool_reference: TaskAgentPoolReference, - #[doc = "Number of requests queued and assigned to an agent. Not running yet."] - #[serde( - rename = "assignedRequestCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_request_count: Option<i32>, - #[doc = "Number of queued requests which are not assigned to any agents"] - #[serde( - rename = "queuedRequestCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub queued_request_count: Option<i32>, - #[doc = "Number of currently running requests"] - #[serde( - rename = "runningRequestCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub running_request_count: Option<i32>, + #[serde(flatten)] + pub task_agent_pool_reference: TaskAgentPoolReference, + #[doc = "Number of requests queued and assigned to an agent. Not running yet."] + #[serde( + rename = "assignedRequestCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_request_count: Option<i32>, + #[doc = "Number of queued requests which are not assigned to any agents"] + #[serde( + rename = "queuedRequestCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub queued_request_count: Option<i32>, + #[doc = "Number of currently running requests"] + #[serde( + rename = "runningRequestCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub running_request_count: Option<i32>, } impl TaskAgentPoolStatus { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentPoolSummary { - #[doc = "Metrics columns header"] - #[serde( - rename = "columnsHeader", - default, - skip_serializing_if = "Option::is_none" - )] - pub columns_header: Option<MetricsColumnsHeader>, - #[serde( - rename = "deploymentGroups", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub deployment_groups: Vec<DeploymentGroupReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pool: Option<TaskAgentPoolReference>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub queues: Vec<TaskAgentQueue>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub rows: Vec<MetricsRow>, + #[doc = "Metrics columns header"] + #[serde( + rename = "columnsHeader", + default, + skip_serializing_if = "Option::is_none" + )] + pub columns_header: Option<MetricsColumnsHeader>, + #[serde( + rename = "deploymentGroups", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub deployment_groups: Vec<DeploymentGroupReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pool: Option<TaskAgentPoolReference>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub queues: Vec<TaskAgentQueue>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub rows: Vec<MetricsRow>, } impl TaskAgentPoolSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the public key portion of an RSA asymmetric key."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentPublicKey { - #[doc = "Gets or sets the exponent for the public key."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub exponent: Vec<String>, - #[doc = "Gets or sets the modulus for the public key."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub modulus: Vec<String>, + #[doc = "Gets or sets the exponent for the public key."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub exponent: Vec<String>, + #[doc = "Gets or sets the modulus for the public key."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub modulus: Vec<String>, } impl TaskAgentPublicKey { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An agent queue."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentQueue { - #[doc = "ID of the queue"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the queue"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pool: Option<TaskAgentPoolReference>, - #[doc = "Project ID"] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, + #[doc = "ID of the queue"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the queue"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pool: Option<TaskAgentPoolReference>, + #[doc = "Project ID"] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, } impl TaskAgentQueue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentQueueList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TaskAgentQueue>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TaskAgentQueue>, } impl TaskAgentQueueList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A reference to an agent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentReference { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "This agent's access point."] - #[serde( - rename = "accessPoint", - default, - skip_serializing_if = "Option::is_none" - )] - pub access_point: Option<String>, - #[doc = "Whether or not this agent should run jobs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[doc = "Identifier of the agent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the agent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Agent OS."] - #[serde( - rename = "osDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub os_description: Option<String>, - #[doc = "Provisioning state of this agent."] - #[serde( - rename = "provisioningState", - default, - skip_serializing_if = "Option::is_none" - )] - pub provisioning_state: Option<String>, - #[doc = "Whether or not the agent is online."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<task_agent_reference::Status>, - #[doc = "Agent version."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "This agent's access point."] + #[serde( + rename = "accessPoint", + default, + skip_serializing_if = "Option::is_none" + )] + pub access_point: Option<String>, + #[doc = "Whether or not this agent should run jobs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[doc = "Identifier of the agent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the agent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Agent OS."] + #[serde( + rename = "osDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub os_description: Option<String>, + #[doc = "Provisioning state of this agent."] + #[serde( + rename = "provisioningState", + default, + skip_serializing_if = "Option::is_none" + )] + pub provisioning_state: Option<String>, + #[doc = "Whether or not the agent is online."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<task_agent_reference::Status>, + #[doc = "Agent version."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl TaskAgentReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_agent_reference { - use super::*; - #[doc = "Whether or not the agent is online."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "offline")] - Offline, - #[serde(rename = "online")] - Online, - } + use super::*; + #[doc = "Whether or not the agent is online."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "offline")] + Offline, + #[serde(rename = "online")] + Online, + } } #[doc = "Represents a session for performing message exchanges from an agent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentSession { - #[doc = "A reference to an agent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub agent: Option<TaskAgentReference>, - #[doc = "Represents a symmetric key used for message-level encryption for communication sent to an agent."] - #[serde( - rename = "encryptionKey", - default, - skip_serializing_if = "Option::is_none" - )] - pub encryption_key: Option<TaskAgentSessionKey>, - #[doc = "Gets or sets the owner name of this session. Generally this will be the machine of origination."] - #[serde(rename = "ownerName", default, skip_serializing_if = "Option::is_none")] - pub owner_name: Option<String>, - #[doc = "Gets the unique identifier for this session."] - #[serde(rename = "sessionId", default, skip_serializing_if = "Option::is_none")] - pub session_id: Option<String>, - #[serde( - rename = "systemCapabilities", - default, - skip_serializing_if = "Option::is_none" - )] - pub system_capabilities: Option<serde_json::Value>, + #[doc = "A reference to an agent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub agent: Option<TaskAgentReference>, + #[doc = "Represents a symmetric key used for message-level encryption for communication sent to an agent."] + #[serde( + rename = "encryptionKey", + default, + skip_serializing_if = "Option::is_none" + )] + pub encryption_key: Option<TaskAgentSessionKey>, + #[doc = "Gets or sets the owner name of this session. Generally this will be the machine of origination."] + #[serde(rename = "ownerName", default, skip_serializing_if = "Option::is_none")] + pub owner_name: Option<String>, + #[doc = "Gets the unique identifier for this session."] + #[serde(rename = "sessionId", default, skip_serializing_if = "Option::is_none")] + pub session_id: Option<String>, + #[serde( + rename = "systemCapabilities", + default, + skip_serializing_if = "Option::is_none" + )] + pub system_capabilities: Option<serde_json::Value>, } impl TaskAgentSession { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a symmetric key used for message-level encryption for communication sent to an agent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentSessionKey { - #[doc = "Gets or sets a value indicating whether or not the key value is encrypted. If this value is true, the Value property should be decrypted using the <c>RSA</c> key exchanged with the server during registration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encrypted: Option<bool>, - #[doc = "Gets or sets the symmetric key value."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<String>, + #[doc = "Gets or sets a value indicating whether or not the key value is encrypted. If this value is true, the Value property should be decrypted using the <c>RSA</c> key exchanged with the server during registration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encrypted: Option<bool>, + #[doc = "Gets or sets the symmetric key value."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<String>, } impl TaskAgentSessionKey { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Details about an agent update."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentUpdate { - #[doc = "Current state of this agent update."] - #[serde( - rename = "currentState", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_state: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<TaskAgentUpdateReason>, - #[doc = ""] - #[serde( - rename = "requestedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_by: Option<IdentityRef>, - #[doc = "Date on which this update was requested."] - #[serde( - rename = "requestTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub request_time: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "sourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_version: Option<PackageVersion>, - #[doc = ""] - #[serde( - rename = "targetVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_version: Option<PackageVersion>, + #[doc = "Current state of this agent update."] + #[serde( + rename = "currentState", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_state: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<TaskAgentUpdateReason>, + #[doc = ""] + #[serde( + rename = "requestedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_by: Option<IdentityRef>, + #[doc = "Date on which this update was requested."] + #[serde( + rename = "requestTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub request_time: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "sourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_version: Option<PackageVersion>, + #[doc = ""] + #[serde( + rename = "targetVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_version: Option<PackageVersion>, } impl TaskAgentUpdate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAgentUpdateReason { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option<task_agent_update_reason::Code>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option<task_agent_update_reason::Code>, } impl TaskAgentUpdateReason { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_agent_update_reason { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Code { - #[serde(rename = "manual")] - Manual, - #[serde(rename = "minAgentVersionRequired")] - MinAgentVersionRequired, - #[serde(rename = "downgrade")] - Downgrade, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Code { + #[serde(rename = "manual")] + Manual, + #[serde(rename = "minAgentVersionRequired")] + MinAgentVersionRequired, + #[serde(rename = "downgrade")] + Downgrade, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAssignedEvent { - #[serde(flatten)] - pub task_event: TaskEvent, + #[serde(flatten)] + pub task_event: TaskEvent, } impl TaskAssignedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskAttachment { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[serde( - rename = "lastChangedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_changed_by: Option<String>, - #[serde( - rename = "lastChangedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_changed_on: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(rename = "recordId", default, skip_serializing_if = "Option::is_none")] - pub record_id: Option<String>, - #[serde( - rename = "timelineId", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeline_id: Option<String>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[serde( + rename = "lastChangedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_changed_by: Option<String>, + #[serde( + rename = "lastChangedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_changed_on: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(rename = "recordId", default, skip_serializing_if = "Option::is_none")] + pub record_id: Option<String>, + #[serde( + rename = "timelineId", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeline_id: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl TaskAttachment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskCommandRestrictions { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option<task_command_restrictions::Mode>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mode: Option<task_command_restrictions::Mode>, } impl TaskCommandRestrictions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_command_restrictions { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Mode { - #[serde(rename = "any")] - Any, - #[serde(rename = "restricted")] - Restricted, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Mode { + #[serde(rename = "any")] + Any, + #[serde(rename = "restricted")] + Restricted, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskCompletedEvent { - #[serde(flatten)] - pub task_event: TaskEvent, - #[doc = "The api request was no delivered successfully"] - #[serde( - rename = "deliveryFailed", - default, - skip_serializing_if = "Option::is_none" - )] - pub delivery_failed: Option<bool>, - #[doc = "The result of the task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<task_completed_event::Result>, + #[serde(flatten)] + pub task_event: TaskEvent, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<task_completed_event::Result>, } impl TaskCompletedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_completed_event { - use super::*; - #[doc = "The result of the task."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "succeededWithIssues")] - SucceededWithIssues, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "succeededWithIssues")] + SucceededWithIssues, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskDefinition { - #[doc = ""] - #[serde( - rename = "agentExecution", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_execution: Option<TaskExecution>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option<String>, - #[serde( - rename = "contentsUploaded", - default, - skip_serializing_if = "Option::is_none" - )] - pub contents_uploaded: Option<bool>, - #[serde( - rename = "contributionIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub contribution_identifier: Option<String>, - #[serde( - rename = "contributionVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub contribution_version: Option<String>, - #[serde( - rename = "dataSourceBindings", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub data_source_bindings: Vec<DataSourceBinding>, - #[serde( - rename = "definitionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_type: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub demands: Vec<Demand>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deprecated: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub disabled: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub execution: Option<serde_json::Value>, - #[serde( - rename = "friendlyName", - default, - skip_serializing_if = "Option::is_none" - )] - pub friendly_name: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub groups: Vec<TaskGroupDefinition>, - #[serde( - rename = "helpMarkDown", - default, - skip_serializing_if = "Option::is_none" - )] - pub help_mark_down: Option<String>, - #[serde(rename = "helpUrl", default, skip_serializing_if = "Option::is_none")] - pub help_url: Option<String>, - #[serde(rename = "hostType", default, skip_serializing_if = "Option::is_none")] - pub host_type: Option<String>, - #[serde(rename = "iconUrl", default, skip_serializing_if = "Option::is_none")] - pub icon_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub inputs: Vec<TaskInputDefinition>, - #[serde( - rename = "instanceNameFormat", - default, - skip_serializing_if = "Option::is_none" - )] - pub instance_name_format: Option<String>, - #[serde( - rename = "minimumAgentVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub minimum_agent_version: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "outputVariables", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub output_variables: Vec<TaskOutputVariable>, - #[serde( - rename = "packageLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub package_location: Option<String>, - #[serde( - rename = "packageType", - default, - skip_serializing_if = "Option::is_none" - )] - pub package_type: Option<String>, - #[serde( - rename = "postJobExecution", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_job_execution: Option<serde_json::Value>, - #[serde( - rename = "preJobExecution", - default, - skip_serializing_if = "Option::is_none" - )] - pub pre_job_execution: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub preview: Option<bool>, - #[serde( - rename = "releaseNotes", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_notes: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub restrictions: Option<TaskRestrictions>, - #[serde( - rename = "runsOn", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub runs_on: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub satisfies: Vec<String>, - #[serde( - rename = "serverOwned", - default, - skip_serializing_if = "Option::is_none" - )] - pub server_owned: Option<bool>, - #[serde( - rename = "showEnvironmentVariables", - default, - skip_serializing_if = "Option::is_none" - )] - pub show_environment_variables: Option<bool>, - #[serde( - rename = "sourceDefinitions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub source_definitions: Vec<TaskSourceDefinition>, - #[serde( - rename = "sourceLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_location: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<TaskVersion>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub visibility: Vec<String>, + #[doc = ""] + #[serde( + rename = "agentExecution", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_execution: Option<TaskExecution>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option<String>, + #[serde( + rename = "contentsUploaded", + default, + skip_serializing_if = "Option::is_none" + )] + pub contents_uploaded: Option<bool>, + #[serde( + rename = "contributionIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub contribution_identifier: Option<String>, + #[serde( + rename = "contributionVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub contribution_version: Option<String>, + #[serde( + rename = "dataSourceBindings", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub data_source_bindings: Vec<DataSourceBinding>, + #[serde( + rename = "definitionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_type: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub demands: Vec<Demand>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deprecated: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub disabled: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub execution: Option<serde_json::Value>, + #[serde( + rename = "friendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub groups: Vec<TaskGroupDefinition>, + #[serde( + rename = "helpMarkDown", + default, + skip_serializing_if = "Option::is_none" + )] + pub help_mark_down: Option<String>, + #[serde(rename = "helpUrl", default, skip_serializing_if = "Option::is_none")] + pub help_url: Option<String>, + #[serde(rename = "hostType", default, skip_serializing_if = "Option::is_none")] + pub host_type: Option<String>, + #[serde(rename = "iconUrl", default, skip_serializing_if = "Option::is_none")] + pub icon_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub inputs: Vec<TaskInputDefinition>, + #[serde( + rename = "instanceNameFormat", + default, + skip_serializing_if = "Option::is_none" + )] + pub instance_name_format: Option<String>, + #[serde( + rename = "minimumAgentVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub minimum_agent_version: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "outputVariables", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub output_variables: Vec<TaskOutputVariable>, + #[serde( + rename = "packageLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub package_location: Option<String>, + #[serde( + rename = "packageType", + default, + skip_serializing_if = "Option::is_none" + )] + pub package_type: Option<String>, + #[serde( + rename = "postJobExecution", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_job_execution: Option<serde_json::Value>, + #[serde( + rename = "preJobExecution", + default, + skip_serializing_if = "Option::is_none" + )] + pub pre_job_execution: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preview: Option<bool>, + #[serde( + rename = "releaseNotes", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_notes: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub restrictions: Option<TaskRestrictions>, + #[serde( + rename = "runsOn", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub runs_on: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub satisfies: Vec<String>, + #[serde( + rename = "serverOwned", + default, + skip_serializing_if = "Option::is_none" + )] + pub server_owned: Option<bool>, + #[serde( + rename = "showEnvironmentVariables", + default, + skip_serializing_if = "Option::is_none" + )] + pub show_environment_variables: Option<bool>, + #[serde( + rename = "sourceDefinitions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub source_definitions: Vec<TaskSourceDefinition>, + #[serde( + rename = "sourceLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_location: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<TaskVersion>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub visibility: Vec<String>, } impl TaskDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskDefinitionEndpoint { - #[doc = "An ID that identifies a service connection to be used for authenticating endpoint requests."] - #[serde( - rename = "connectionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub connection_id: Option<String>, - #[doc = "An Json based keyselector to filter response returned by fetching the endpoint <c>Url</c>.A Json based keyselector must be prefixed with \"jsonpath:\". KeySelector can be used to specify the filter to get the keys for the values specified with Selector. <example> The following keyselector defines an Json for extracting nodes named 'ServiceName'. <code> endpoint.KeySelector = \"jsonpath://ServiceName\"; </code></example>"] - #[serde( - rename = "keySelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub key_selector: Option<String>, - #[doc = "The scope as understood by Connected Services. Essentially, a project-id for now."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, - #[doc = "An XPath/Json based selector to filter response returned by fetching the endpoint <c>Url</c>. An XPath based selector must be prefixed with the string \"xpath:\". A Json based selector must be prefixed with \"jsonpath:\". <example> The following selector defines an XPath for extracting nodes named 'ServiceName'. <code> endpoint.Selector = \"xpath://ServiceName\"; </code></example>"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub selector: Option<String>, - #[doc = "TaskId that this endpoint belongs to."] - #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] - pub task_id: Option<String>, - #[doc = "URL to GET."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "An ID that identifies a service connection to be used for authenticating endpoint requests."] + #[serde( + rename = "connectionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub connection_id: Option<String>, + #[doc = "An Json based keyselector to filter response returned by fetching the endpoint <c>Url</c>.A Json based keyselector must be prefixed with \"jsonpath:\". KeySelector can be used to specify the filter to get the keys for the values specified with Selector. <example> The following keyselector defines an Json for extracting nodes named 'ServiceName'. <code> endpoint.KeySelector = \"jsonpath://ServiceName\"; </code></example>"] + #[serde( + rename = "keySelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub key_selector: Option<String>, + #[doc = "The scope as understood by Connected Services. Essentially, a project-id for now."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, + #[doc = "An XPath/Json based selector to filter response returned by fetching the endpoint <c>Url</c>. An XPath based selector must be prefixed with the string \"xpath:\". A Json based selector must be prefixed with \"jsonpath:\". <example> The following selector defines an XPath for extracting nodes named 'ServiceName'. <code> endpoint.Selector = \"xpath://ServiceName\"; </code></example>"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub selector: Option<String>, + #[doc = "TaskId that this endpoint belongs to."] + #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] + pub task_id: Option<String>, + #[doc = "URL to GET."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TaskDefinitionEndpoint { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskDefinitionReference { - #[doc = "Gets or sets the definition type. Values can be 'task' or 'metaTask'."] - #[serde( - rename = "definitionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_type: Option<String>, - #[doc = "Gets or sets the unique identifier of task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Gets or sets the version specification of task."] - #[serde( - rename = "versionSpec", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_spec: Option<String>, + #[doc = "Gets or sets the definition type. Values can be 'task' or 'metaTask'."] + #[serde( + rename = "definitionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_type: Option<String>, + #[doc = "Gets or sets the unique identifier of task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Gets or sets the version specification of task."] + #[serde( + rename = "versionSpec", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_spec: Option<String>, } impl TaskDefinitionReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskEvent { - #[serde(flatten)] - pub job_event: JobEvent, - #[doc = "The ID of the task definition."] - #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] - pub task_id: Option<String>, + #[serde(flatten)] + pub job_event: JobEvent, + #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] + pub task_id: Option<String>, } impl TaskEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskExecution { - #[doc = "A reference to a task."] - #[serde(rename = "execTask", default, skip_serializing_if = "Option::is_none")] - pub exec_task: Option<TaskReference>, - #[doc = "If a task is going to run code, then this provides the type/script etc... information by platform. For example, it might look like. net45: { typeName: \"Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask\", assemblyName: \"Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll\" } net20: { typeName: \"Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask\", assemblyName: \"Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll\" } java: { jar: \"powershelltask.tasks.automation.teamfoundation.microsoft.com\", } node: { script: \"powershellhost.js\", }"] - #[serde( - rename = "platformInstructions", - default, - skip_serializing_if = "Option::is_none" - )] - pub platform_instructions: Option<serde_json::Value>, + #[doc = ""] + #[serde(rename = "execTask", default, skip_serializing_if = "Option::is_none")] + pub exec_task: Option<TaskReference>, + #[doc = "If a task is going to run code, then this provides the type/script etc... information by platform. For example, it might look like. net45: { typeName: \"Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask\", assemblyName: \"Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll\" } net20: { typeName: \"Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask\", assemblyName: \"Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll\" } java: { jar: \"powershelltask.tasks.automation.teamfoundation.microsoft.com\", } node: { script: \"powershellhost.js\", }"] + #[serde( + rename = "platformInstructions", + default, + skip_serializing_if = "Option::is_none" + )] + pub platform_instructions: Option<serde_json::Value>, } impl TaskExecution { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskGroup { - #[serde(flatten)] - pub task_definition: TaskDefinition, - #[doc = "Gets or sets comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Gets or sets date on which it got created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Gets or sets as 'true' to indicate as deleted, 'false' otherwise."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deleted: Option<bool>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "Gets or sets date on which it got modified."] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Gets or sets the owner."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[doc = "Gets or sets parent task group Id. This is used while creating a draft task group."] - #[serde( - rename = "parentDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_definition_id: Option<String>, - #[doc = "Gets or sets revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "Gets or sets the tasks."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tasks: Vec<TaskGroupStep>, + #[serde(flatten)] + pub task_definition: TaskDefinition, + #[doc = "Gets or sets comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "Gets or sets date on which it got created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Gets or sets as 'true' to indicate as deleted, 'false' otherwise."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deleted: Option<bool>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "Gets or sets date on which it got modified."] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Gets or sets the owner."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[doc = "Gets or sets parent task group Id. This is used while creating a draft task group."] + #[serde( + rename = "parentDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_definition_id: Option<String>, + #[doc = "Gets or sets revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "Gets or sets the tasks."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tasks: Vec<TaskGroupStep>, } impl TaskGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskGroupCreateParameter { - #[doc = "Sets author name of the task group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<String>, - #[doc = "Sets category of the task group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option<String>, - #[doc = "Sets description of the task group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Sets friendly name of the task group."] - #[serde( - rename = "friendlyName", - default, - skip_serializing_if = "Option::is_none" - )] - pub friendly_name: Option<String>, - #[doc = "Sets url icon of the task group."] - #[serde(rename = "iconUrl", default, skip_serializing_if = "Option::is_none")] - pub icon_url: Option<String>, - #[doc = "Sets input for the task group."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub inputs: Vec<TaskInputDefinition>, - #[doc = "Sets display name of the task group."] - #[serde( - rename = "instanceNameFormat", - default, - skip_serializing_if = "Option::is_none" - )] - pub instance_name_format: Option<String>, - #[doc = "Sets name of the task group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Sets parent task group Id. This is used while creating a draft task group."] - #[serde( - rename = "parentDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_definition_id: Option<String>, - #[doc = "Sets RunsOn of the task group. Value can be 'Agent', 'Server' or 'DeploymentGroup'."] - #[serde( - rename = "runsOn", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub runs_on: Vec<String>, - #[doc = "Sets tasks for the task group."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tasks: Vec<TaskGroupStep>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<TaskVersion>, + #[doc = "Sets author name of the task group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<String>, + #[doc = "Sets category of the task group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option<String>, + #[doc = "Sets description of the task group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Sets friendly name of the task group."] + #[serde( + rename = "friendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option<String>, + #[doc = "Sets url icon of the task group."] + #[serde(rename = "iconUrl", default, skip_serializing_if = "Option::is_none")] + pub icon_url: Option<String>, + #[doc = "Sets input for the task group."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub inputs: Vec<TaskInputDefinition>, + #[doc = "Sets display name of the task group."] + #[serde( + rename = "instanceNameFormat", + default, + skip_serializing_if = "Option::is_none" + )] + pub instance_name_format: Option<String>, + #[doc = "Sets name of the task group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Sets parent task group Id. This is used while creating a draft task group."] + #[serde( + rename = "parentDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_definition_id: Option<String>, + #[doc = "Sets RunsOn of the task group. Value can be 'Agent', 'Server' or 'DeploymentGroup'."] + #[serde( + rename = "runsOn", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub runs_on: Vec<String>, + #[doc = "Sets tasks for the task group."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tasks: Vec<TaskGroupStep>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<TaskVersion>, } impl TaskGroupCreateParameter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskGroupDefinition { - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde( - rename = "isExpanded", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_expanded: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[serde( - rename = "visibleRule", - default, - skip_serializing_if = "Option::is_none" - )] - pub visible_rule: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde( + rename = "isExpanded", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_expanded: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[serde( + rename = "visibleRule", + default, + skip_serializing_if = "Option::is_none" + )] + pub visible_rule: Option<String>, } impl TaskGroupDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskGroupList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TaskGroup>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TaskGroup>, } impl TaskGroupList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskGroupPublishPreviewParameter { - #[serde(flatten)] - pub task_group_update_properties_base: TaskGroupUpdatePropertiesBase, - #[doc = "This is to disable previous versions of task group upon publish"] - #[serde( - rename = "disablePriorVersions", - default, - skip_serializing_if = "Option::is_none" - )] - pub disable_prior_versions: Option<bool>, - #[doc = "Denotes if task group is in preview"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub preview: Option<bool>, - #[doc = "This is the revision of task group that is getting published"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<TaskVersion>, + #[serde(flatten)] + pub task_group_update_properties_base: TaskGroupUpdatePropertiesBase, + #[doc = "This is to disable previous versions of task group upon publish"] + #[serde( + rename = "disablePriorVersions", + default, + skip_serializing_if = "Option::is_none" + )] + pub disable_prior_versions: Option<bool>, + #[doc = "Denotes if task group is in preview"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preview: Option<bool>, + #[doc = "This is the revision of task group that is getting published"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<TaskVersion>, } impl TaskGroupPublishPreviewParameter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskGroupRestoreParameter { - #[serde(flatten)] - pub task_group_update_properties_base: TaskGroupUpdatePropertiesBase, - #[doc = "This is to restore deleted Task Group"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub restore: Option<bool>, + #[serde(flatten)] + pub task_group_update_properties_base: TaskGroupUpdatePropertiesBase, + #[doc = "This is to restore deleted Task Group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub restore: Option<bool>, } impl TaskGroupRestoreParameter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskGroupRevision { - #[doc = ""] - #[serde(rename = "changedBy", default, skip_serializing_if = "Option::is_none")] - pub changed_by: Option<IdentityRef>, - #[serde( - rename = "changedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub changed_date: Option<time::OffsetDateTime>, - #[serde( - rename = "changeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_type: Option<task_group_revision::ChangeType>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde(rename = "fileId", default, skip_serializing_if = "Option::is_none")] - pub file_id: Option<i32>, - #[serde( - rename = "majorVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub major_version: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[serde( - rename = "taskGroupId", - default, - skip_serializing_if = "Option::is_none" - )] - pub task_group_id: Option<String>, + #[doc = ""] + #[serde(rename = "changedBy", default, skip_serializing_if = "Option::is_none")] + pub changed_by: Option<IdentityRef>, + #[serde( + rename = "changedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub changed_date: Option<time::OffsetDateTime>, + #[serde( + rename = "changeType", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_type: Option<task_group_revision::ChangeType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde(rename = "fileId", default, skip_serializing_if = "Option::is_none")] + pub file_id: Option<i32>, + #[serde( + rename = "majorVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub major_version: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[serde( + rename = "taskGroupId", + default, + skip_serializing_if = "Option::is_none" + )] + pub task_group_id: Option<String>, } impl TaskGroupRevision { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_group_revision { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ChangeType { - #[serde(rename = "add")] - Add, - #[serde(rename = "update")] - Update, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "undelete")] - Undelete, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ChangeType { + #[serde(rename = "add")] + Add, + #[serde(rename = "update")] + Update, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "undelete")] + Undelete, + } } #[doc = "Represents tasks in the task group."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskGroupStep { - #[doc = "Gets or sets as 'true' to run the task always, 'false' otherwise."] - #[serde(rename = "alwaysRun", default, skip_serializing_if = "Option::is_none")] - pub always_run: Option<bool>, - #[doc = "Gets or sets condition for the task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub condition: Option<String>, - #[doc = "Gets or sets as 'true' to continue on error, 'false' otherwise."] - #[serde( - rename = "continueOnError", - default, - skip_serializing_if = "Option::is_none" - )] - pub continue_on_error: Option<bool>, - #[doc = "Gets or sets the display name."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Gets or sets as task is enabled or not."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[doc = "Gets dictionary of environment variables."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option<serde_json::Value>, - #[doc = "Gets or sets dictionary of inputs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option<serde_json::Value>, - #[doc = "Gets or sets the maximum number of retries"] - #[serde( - rename = "retryCountOnTaskFailure", - default, - skip_serializing_if = "Option::is_none" - )] - pub retry_count_on_task_failure: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub task: Option<TaskDefinitionReference>, - #[doc = "Gets or sets the maximum time, in minutes, that a task is allowed to execute on agent before being cancelled by server. A zero value indicates an infinite timeout."] - #[serde( - rename = "timeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeout_in_minutes: Option<i32>, + #[doc = "Gets or sets as 'true' to run the task always, 'false' otherwise."] + #[serde(rename = "alwaysRun", default, skip_serializing_if = "Option::is_none")] + pub always_run: Option<bool>, + #[doc = "Gets or sets condition for the task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub condition: Option<String>, + #[doc = "Gets or sets as 'true' to continue on error, 'false' otherwise."] + #[serde( + rename = "continueOnError", + default, + skip_serializing_if = "Option::is_none" + )] + pub continue_on_error: Option<bool>, + #[doc = "Gets or sets the display name."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Gets or sets as task is enabled or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[doc = "Gets dictionary of environment variables."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option<serde_json::Value>, + #[doc = "Gets or sets dictionary of inputs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inputs: Option<serde_json::Value>, + #[doc = "Gets or sets the maximum number of retries"] + #[serde( + rename = "retryCountOnTaskFailure", + default, + skip_serializing_if = "Option::is_none" + )] + pub retry_count_on_task_failure: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub task: Option<TaskDefinitionReference>, + #[doc = "Gets or sets the maximum time, in minutes, that a task is allowed to execute on agent before being cancelled by server. A zero value indicates an infinite timeout."] + #[serde( + rename = "timeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeout_in_minutes: Option<i32>, } impl TaskGroupStep { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskGroupUpdateParameter { - #[doc = "Sets author name of the task group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<String>, - #[doc = "Sets category of the task group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option<String>, - #[doc = "Sets comment of the task group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Sets description of the task group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Sets friendly name of the task group."] - #[serde( - rename = "friendlyName", - default, - skip_serializing_if = "Option::is_none" - )] - pub friendly_name: Option<String>, - #[doc = "Sets url icon of the task group."] - #[serde(rename = "iconUrl", default, skip_serializing_if = "Option::is_none")] - pub icon_url: Option<String>, - #[doc = "Sets the unique identifier of this field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Sets input for the task group."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub inputs: Vec<TaskInputDefinition>, - #[doc = "Sets display name of the task group."] - #[serde( - rename = "instanceNameFormat", - default, - skip_serializing_if = "Option::is_none" - )] - pub instance_name_format: Option<String>, - #[doc = "Sets name of the task group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets parent task group Id. This is used while creating a draft task group."] - #[serde( - rename = "parentDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_definition_id: Option<String>, - #[doc = "Sets revision of the task group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "Sets RunsOn of the task group. Value can be 'Agent', 'Server' or 'DeploymentGroup'."] - #[serde( - rename = "runsOn", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub runs_on: Vec<String>, - #[doc = "Sets tasks for the task group."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tasks: Vec<TaskGroupStep>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<TaskVersion>, + #[doc = "Sets author name of the task group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<String>, + #[doc = "Sets category of the task group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option<String>, + #[doc = "Sets comment of the task group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Sets description of the task group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Sets friendly name of the task group."] + #[serde( + rename = "friendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option<String>, + #[doc = "Sets url icon of the task group."] + #[serde(rename = "iconUrl", default, skip_serializing_if = "Option::is_none")] + pub icon_url: Option<String>, + #[doc = "Sets the unique identifier of this field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Sets input for the task group."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub inputs: Vec<TaskInputDefinition>, + #[doc = "Sets display name of the task group."] + #[serde( + rename = "instanceNameFormat", + default, + skip_serializing_if = "Option::is_none" + )] + pub instance_name_format: Option<String>, + #[doc = "Sets name of the task group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets parent task group Id. This is used while creating a draft task group."] + #[serde( + rename = "parentDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_definition_id: Option<String>, + #[doc = "Sets revision of the task group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "Sets RunsOn of the task group. Value can be 'Agent', 'Server' or 'DeploymentGroup'."] + #[serde( + rename = "runsOn", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub runs_on: Vec<String>, + #[doc = "Sets tasks for the task group."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tasks: Vec<TaskGroupStep>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<TaskVersion>, } impl TaskGroupUpdateParameter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskGroupUpdatePropertiesBase { - #[doc = "Comment for this update request"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, + #[doc = "Comment for this update request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, } impl TaskGroupUpdatePropertiesBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskHubLicenseDetails { - #[serde( - rename = "enterpriseUsersCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub enterprise_users_count: Option<i32>, - #[serde( - rename = "failedToReachAllProviders", - default, - skip_serializing_if = "Option::is_none" - )] - pub failed_to_reach_all_providers: Option<bool>, - #[serde( - rename = "freeHostedLicenseCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub free_hosted_license_count: Option<i32>, - #[serde( - rename = "freeLicenseCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub free_license_count: Option<i32>, - #[serde( - rename = "hasLicenseCountEverUpdated", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_license_count_ever_updated: Option<bool>, - #[serde( - rename = "hostedAgentMinutesFreeCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub hosted_agent_minutes_free_count: Option<i32>, - #[serde( - rename = "hostedAgentMinutesUsedCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub hosted_agent_minutes_used_count: Option<i32>, - #[serde( - rename = "hostedLicensesArePremium", - default, - skip_serializing_if = "Option::is_none" - )] - pub hosted_licenses_are_premium: Option<bool>, - #[serde( - rename = "msdnUsersCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub msdn_users_count: Option<i32>, - #[doc = "Microsoft-hosted licenses purchased from VSTS directly."] - #[serde( - rename = "purchasedHostedLicenseCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub purchased_hosted_license_count: Option<i32>, - #[doc = "Self-hosted licenses purchased from VSTS directly."] - #[serde( - rename = "purchasedLicenseCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub purchased_license_count: Option<i32>, - #[serde( - rename = "totalHostedLicenseCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_hosted_license_count: Option<i32>, - #[serde( - rename = "totalLicenseCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_license_count: Option<i32>, - #[serde( - rename = "totalPrivateLicenseCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_private_license_count: Option<i32>, + #[serde( + rename = "enterpriseUsersCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub enterprise_users_count: Option<i32>, + #[serde( + rename = "failedToReachAllProviders", + default, + skip_serializing_if = "Option::is_none" + )] + pub failed_to_reach_all_providers: Option<bool>, + #[serde( + rename = "freeHostedLicenseCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub free_hosted_license_count: Option<i32>, + #[serde( + rename = "freeLicenseCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub free_license_count: Option<i32>, + #[serde( + rename = "hasLicenseCountEverUpdated", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_license_count_ever_updated: Option<bool>, + #[serde( + rename = "hostedAgentMinutesFreeCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub hosted_agent_minutes_free_count: Option<i32>, + #[serde( + rename = "hostedAgentMinutesUsedCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub hosted_agent_minutes_used_count: Option<i32>, + #[serde( + rename = "hostedLicensesArePremium", + default, + skip_serializing_if = "Option::is_none" + )] + pub hosted_licenses_are_premium: Option<bool>, + #[serde( + rename = "msdnUsersCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub msdn_users_count: Option<i32>, + #[doc = "Microsoft-hosted licenses purchased from VSTS directly."] + #[serde( + rename = "purchasedHostedLicenseCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub purchased_hosted_license_count: Option<i32>, + #[doc = "Self-hosted licenses purchased from VSTS directly."] + #[serde( + rename = "purchasedLicenseCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub purchased_license_count: Option<i32>, + #[serde( + rename = "totalHostedLicenseCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_hosted_license_count: Option<i32>, + #[serde( + rename = "totalLicenseCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_license_count: Option<i32>, + #[serde( + rename = "totalPrivateLicenseCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_private_license_count: Option<i32>, } impl TaskHubLicenseDetails { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TaskHubOidcToken { - #[serde(rename = "oidcToken", default, skip_serializing_if = "Option::is_none")] - pub oidc_token: Option<String>, -} -impl TaskHubOidcToken { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskInputDefinition { - #[serde(flatten)] - pub task_input_definition_base: TaskInputDefinitionBase, + #[serde(flatten)] + pub task_input_definition_base: TaskInputDefinitionBase, } impl TaskInputDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskInputDefinitionBase { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub aliases: Vec<String>, - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<String>, - #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] - pub group_name: Option<String>, - #[serde( - rename = "helpMarkDown", - default, - skip_serializing_if = "Option::is_none" - )] - pub help_mark_down: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub label: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub options: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub required: Option<bool>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub validation: Option<TaskInputValidation>, - #[serde( - rename = "visibleRule", - default, - skip_serializing_if = "Option::is_none" - )] - pub visible_rule: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub aliases: Vec<String>, + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<String>, + #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] + pub group_name: Option<String>, + #[serde( + rename = "helpMarkDown", + default, + skip_serializing_if = "Option::is_none" + )] + pub help_mark_down: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub options: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub required: Option<bool>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub validation: Option<TaskInputValidation>, + #[serde( + rename = "visibleRule", + default, + skip_serializing_if = "Option::is_none" + )] + pub visible_rule: Option<String>, } impl TaskInputDefinitionBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskInputValidation { - #[doc = "Conditional expression"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub expression: Option<String>, - #[doc = "Message explaining how user can correct if validation fails"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, + #[doc = "Conditional expression"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub expression: Option<String>, + #[doc = "Message explaining how user can correct if validation fails"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, } impl TaskInputValidation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskInstance { - #[serde(flatten)] - pub task_reference: TaskReference, - #[serde(rename = "alwaysRun", default, skip_serializing_if = "Option::is_none")] - pub always_run: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub condition: Option<String>, - #[serde( - rename = "continueOnError", - default, - skip_serializing_if = "Option::is_none" - )] - pub continue_on_error: Option<bool>, - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option<serde_json::Value>, - #[serde( - rename = "instanceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub instance_id: Option<String>, - #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] - pub ref_name: Option<String>, - #[serde( - rename = "retryCountOnTaskFailure", - default, - skip_serializing_if = "Option::is_none" - )] - pub retry_count_on_task_failure: Option<i32>, - #[serde( - rename = "timeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeout_in_minutes: Option<i32>, + #[serde(flatten)] + pub task_reference: TaskReference, + #[serde(rename = "alwaysRun", default, skip_serializing_if = "Option::is_none")] + pub always_run: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub condition: Option<String>, + #[serde( + rename = "continueOnError", + default, + skip_serializing_if = "Option::is_none" + )] + pub continue_on_error: Option<bool>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option<serde_json::Value>, + #[serde( + rename = "instanceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub instance_id: Option<String>, + #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] + pub ref_name: Option<String>, + #[serde( + rename = "retryCountOnTaskFailure", + default, + skip_serializing_if = "Option::is_none" + )] + pub retry_count_on_task_failure: Option<i32>, + #[serde( + rename = "timeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeout_in_minutes: Option<i32>, } impl TaskInstance { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "A task log connected to a timeline record."] +#[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskLog { - #[serde(flatten)] - pub task_log_reference: TaskLogReference, - #[doc = "The time of the task log creation."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "The REST URL of the task log when indexed."] - #[serde( - rename = "indexLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub index_location: Option<String>, - #[doc = "The time of the last modification of the task log."] - #[serde( - rename = "lastChangedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_changed_on: Option<time::OffsetDateTime>, - #[doc = "The number of the task log lines."] - #[serde(rename = "lineCount", default, skip_serializing_if = "Option::is_none")] - pub line_count: Option<i64>, - #[doc = "The path of the task log."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[serde(flatten)] + pub task_log_reference: TaskLogReference, + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[serde( + rename = "indexLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub index_location: Option<String>, + #[serde( + rename = "lastChangedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_changed_on: Option<time::OffsetDateTime>, + #[serde(rename = "lineCount", default, skip_serializing_if = "Option::is_none")] + pub line_count: Option<i64>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl TaskLog { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "A reference to a task log. This class contains information about the output printed to the timeline record's logs console during pipeline run."] +#[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskLogReference { - #[doc = "The ID of the task log."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "The REST URL of the task log."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option<String>, } impl TaskLogReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationContainer { - #[serde(flatten)] - pub task_orchestration_item: TaskOrchestrationItem, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub children: Vec<TaskOrchestrationItem>, - #[serde( - rename = "continueOnError", - default, - skip_serializing_if = "Option::is_none" - )] - pub continue_on_error: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[serde( - rename = "maxConcurrency", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_concurrency: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parallel: Option<bool>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rollback: Box<Option<TaskOrchestrationContainer>>, + #[serde(flatten)] + pub task_orchestration_item: TaskOrchestrationItem, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub children: Vec<TaskOrchestrationItem>, + #[serde( + rename = "continueOnError", + default, + skip_serializing_if = "Option::is_none" + )] + pub continue_on_error: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[serde( + rename = "maxConcurrency", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_concurrency: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parallel: Option<bool>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rollback: Box<Option<TaskOrchestrationContainer>>, } impl TaskOrchestrationContainer { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationItem { - #[serde(rename = "itemType", default, skip_serializing_if = "Option::is_none")] - pub item_type: Option<task_orchestration_item::ItemType>, + #[serde(rename = "itemType", default, skip_serializing_if = "Option::is_none")] + pub item_type: Option<task_orchestration_item::ItemType>, } impl TaskOrchestrationItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_orchestration_item { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ItemType { - #[serde(rename = "container")] - Container, - #[serde(rename = "job")] - Job, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ItemType { + #[serde(rename = "container")] + Container, + #[serde(rename = "job")] + Job, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationJob { - #[serde(flatten)] - pub task_orchestration_item: TaskOrchestrationItem, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub demands: Vec<Demand>, - #[doc = ""] - #[serde(rename = "executeAs", default, skip_serializing_if = "Option::is_none")] - pub execute_as: Option<IdentityRef>, - #[serde( - rename = "executionMode", - default, - skip_serializing_if = "Option::is_none" - )] - pub execution_mode: Option<String>, - #[serde( - rename = "executionTimeout", - default, - skip_serializing_if = "Option::is_none" - )] - pub execution_timeout: Option<String>, - #[serde( - rename = "instanceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub instance_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] - pub ref_name: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tasks: Vec<TaskInstance>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[serde(flatten)] + pub task_orchestration_item: TaskOrchestrationItem, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub demands: Vec<Demand>, + #[doc = ""] + #[serde(rename = "executeAs", default, skip_serializing_if = "Option::is_none")] + pub execute_as: Option<IdentityRef>, + #[serde( + rename = "executionMode", + default, + skip_serializing_if = "Option::is_none" + )] + pub execution_mode: Option<String>, + #[serde( + rename = "executionTimeout", + default, + skip_serializing_if = "Option::is_none" + )] + pub execution_timeout: Option<String>, + #[serde( + rename = "instanceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub instance_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] + pub ref_name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tasks: Vec<TaskInstance>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl TaskOrchestrationJob { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationOwner { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TaskOrchestrationOwner { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationPlan { - #[serde(flatten)] - pub task_orchestration_plan_reference: TaskOrchestrationPlanReference, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option<PlanEnvironment>, - #[doc = "A reference to a task log. This class contains information about the output printed to the timeline record's logs console during pipeline run."] - #[serde( - rename = "expandedYaml", - default, - skip_serializing_if = "Option::is_none" - )] - pub expanded_yaml: Option<TaskLogReference>, - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub implementation: Option<TaskOrchestrationContainer>, - #[doc = "A reference to a task log. This class contains information about the output printed to the timeline record's logs console during pipeline run."] - #[serde( - rename = "initializationLog", - default, - skip_serializing_if = "Option::is_none" - )] - pub initialization_log: Option<TaskLogReference>, - #[serde( - rename = "requestedById", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_by_id: Option<String>, - #[serde( - rename = "requestedForId", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_for_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<task_orchestration_plan::Result>, - #[serde( - rename = "resultCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_code: Option<String>, - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<task_orchestration_plan::State>, - #[doc = "A reference to a timeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeline: Option<TimelineReference>, + #[serde(flatten)] + pub task_orchestration_plan_reference: TaskOrchestrationPlanReference, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option<PlanEnvironment>, + #[doc = ""] + #[serde( + rename = "expandedYaml", + default, + skip_serializing_if = "Option::is_none" + )] + pub expanded_yaml: Option<TaskLogReference>, + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub implementation: Option<TaskOrchestrationContainer>, + #[doc = ""] + #[serde( + rename = "initializationLog", + default, + skip_serializing_if = "Option::is_none" + )] + pub initialization_log: Option<TaskLogReference>, + #[serde( + rename = "requestedById", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_by_id: Option<String>, + #[serde( + rename = "requestedForId", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_for_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<task_orchestration_plan::Result>, + #[serde( + rename = "resultCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_code: Option<String>, + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<task_orchestration_plan::State>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeline: Option<TimelineReference>, } impl TaskOrchestrationPlan { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_orchestration_plan { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "succeededWithIssues")] - SucceededWithIssues, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "abandoned")] - Abandoned, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "throttled")] - Throttled, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "succeededWithIssues")] + SucceededWithIssues, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "abandoned")] + Abandoned, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "throttled")] + Throttled, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationPlanGroup { - #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] - pub plan_group: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, - #[serde( - rename = "runningRequests", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub running_requests: Vec<TaskAgentJobRequest>, + #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] + pub plan_group: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, + #[serde( + rename = "runningRequests", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub running_requests: Vec<TaskAgentJobRequest>, } impl TaskOrchestrationPlanGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationPlanGroupsQueueMetrics { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<task_orchestration_plan_groups_queue_metrics::Status>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<task_orchestration_plan_groups_queue_metrics::Status>, } impl TaskOrchestrationPlanGroupsQueueMetrics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod task_orchestration_plan_groups_queue_metrics { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "running")] - Running, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "all")] - All, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "running")] + Running, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationPlanReference { - #[serde( - rename = "artifactLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_location: Option<String>, - #[serde( - rename = "artifactUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_uri: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub definition: Option<TaskOrchestrationOwner>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<TaskOrchestrationOwner>, - #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] - pub plan_group: Option<String>, - #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] - pub plan_id: Option<String>, - #[serde(rename = "planType", default, skip_serializing_if = "Option::is_none")] - pub plan_type: Option<String>, - #[serde( - rename = "scopeIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub scope_identifier: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i32>, + #[serde( + rename = "artifactLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_location: Option<String>, + #[serde( + rename = "artifactUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_uri: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option<TaskOrchestrationOwner>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<TaskOrchestrationOwner>, + #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] + pub plan_group: Option<String>, + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option<String>, + #[serde(rename = "planType", default, skip_serializing_if = "Option::is_none")] + pub plan_type: Option<String>, + #[serde( + rename = "scopeIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub scope_identifier: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i32>, } impl TaskOrchestrationPlanReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationQueuedPlan { - #[serde( - rename = "assignTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub assign_time: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub definition: Option<TaskOrchestrationOwner>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<TaskOrchestrationOwner>, - #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] - pub plan_group: Option<String>, - #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] - pub plan_id: Option<String>, - #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] - pub pool_id: Option<i32>, - #[serde( - rename = "queuePosition", - default, - skip_serializing_if = "Option::is_none" - )] - pub queue_position: Option<i32>, - #[serde( - rename = "queueTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub queue_time: Option<time::OffsetDateTime>, - #[serde( - rename = "scopeIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub scope_identifier: Option<String>, + #[serde( + rename = "assignTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub assign_time: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option<TaskOrchestrationOwner>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<TaskOrchestrationOwner>, + #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] + pub plan_group: Option<String>, + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option<String>, + #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] + pub pool_id: Option<i32>, + #[serde( + rename = "queuePosition", + default, + skip_serializing_if = "Option::is_none" + )] + pub queue_position: Option<i32>, + #[serde( + rename = "queueTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub queue_time: Option<time::OffsetDateTime>, + #[serde( + rename = "scopeIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub scope_identifier: Option<String>, } impl TaskOrchestrationQueuedPlan { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationQueuedPlanGroup { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub definition: Option<TaskOrchestrationOwner>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<TaskOrchestrationOwner>, - #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] - pub plan_group: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub plans: Vec<TaskOrchestrationQueuedPlan>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, - #[serde( - rename = "queuePosition", - default, - skip_serializing_if = "Option::is_none" - )] - pub queue_position: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option<TaskOrchestrationOwner>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<TaskOrchestrationOwner>, + #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] + pub plan_group: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub plans: Vec<TaskOrchestrationQueuedPlan>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, + #[serde( + rename = "queuePosition", + default, + skip_serializing_if = "Option::is_none" + )] + pub queue_position: Option<i32>, } impl TaskOrchestrationQueuedPlanGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOutputVariable { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TaskOutputVariable { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskPackageMetadata { - #[doc = "Gets the name of the package."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "Gets the url of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Gets the version of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Gets the name of the package."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "Gets the url of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Gets the version of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl TaskPackageMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "A reference to a task."] +#[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskReference { - #[doc = "The ID of the task definition. Corresponds to the id value of task.json file. <br />Example: CmdLineV2 { \"id\": \"D9BAFED4-0B18-4F58-968D-86655B4D2CE9\" }"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "A dictionary of inputs specific to a task definition. Corresponds to inputs value of task.json file."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option<serde_json::Value>, - #[doc = "The name of the task definition. Corresponds to the name value of task.json file. <br />Example: CmdLineV2 { \"name\": \"CmdLine\" }"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The version of the task definition. Corresponds to the version value of task.json file. <br />Example: CmdLineV2 { \"version\": { \"Major\": 2, \"Minor\": 212, \"Patch\": 0 } }"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inputs: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl TaskReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskRestrictions { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub commands: Option<TaskCommandRestrictions>, - #[doc = ""] - #[serde( - rename = "settableVariables", - default, - skip_serializing_if = "Option::is_none" - )] - pub settable_variables: Option<TaskVariableRestrictions>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub commands: Option<TaskCommandRestrictions>, + #[doc = ""] + #[serde( + rename = "settableVariables", + default, + skip_serializing_if = "Option::is_none" + )] + pub settable_variables: Option<TaskVariableRestrictions>, } impl TaskRestrictions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskSourceDefinition { - #[serde(flatten)] - pub task_source_definition_base: TaskSourceDefinitionBase, + #[serde(flatten)] + pub task_source_definition_base: TaskSourceDefinitionBase, } impl TaskSourceDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskSourceDefinitionBase { - #[serde(rename = "authKey", default, skip_serializing_if = "Option::is_none")] - pub auth_key: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option<String>, - #[serde( - rename = "keySelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub key_selector: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub selector: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<String>, + #[serde(rename = "authKey", default, skip_serializing_if = "Option::is_none")] + pub auth_key: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub endpoint: Option<String>, + #[serde( + rename = "keySelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub key_selector: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub selector: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<String>, } impl TaskSourceDefinitionBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskStartedEvent { - #[serde(flatten)] - pub task_event: TaskEvent, + #[serde(flatten)] + pub task_event: TaskEvent, } impl TaskStartedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskVariableRestrictions { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub allowed: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub allowed: Vec<String>, } impl TaskVariableRestrictions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskVersion { - #[serde(rename = "isTest", default, skip_serializing_if = "Option::is_none")] - pub is_test: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub major: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub minor: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub patch: Option<i32>, + #[serde(rename = "isTest", default, skip_serializing_if = "Option::is_none")] + pub is_test: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub major: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub minor: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub patch: Option<i32>, } impl TaskVersion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Timeline { - #[serde(flatten)] - pub timeline_reference: TimelineReference, - #[serde( - rename = "lastChangedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_changed_by: Option<String>, - #[serde( - rename = "lastChangedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_changed_on: Option<time::OffsetDateTime>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub records: Vec<TimelineRecord>, + #[serde(flatten)] + pub timeline_reference: TimelineReference, + #[serde( + rename = "lastChangedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_changed_by: Option<String>, + #[serde( + rename = "lastChangedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_changed_on: Option<time::OffsetDateTime>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub records: Vec<TimelineRecord>, } impl Timeline { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "An attempt to update a TimelineRecord."] +#[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineAttempt { - #[doc = "The attempt of the record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "The unique identifier for the record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, - #[doc = "The record identifier located within the specified timeline."] - #[serde(rename = "recordId", default, skip_serializing_if = "Option::is_none")] - pub record_id: Option<String>, - #[doc = "The timeline identifier which owns the record representing this attempt."] - #[serde( - rename = "timelineId", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeline_id: Option<String>, + #[doc = "Gets or sets the attempt of the record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Gets or sets the unique identifier for the record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, + #[doc = "Gets or sets the record identifier located within the specified timeline."] + #[serde(rename = "recordId", default, skip_serializing_if = "Option::is_none")] + pub record_id: Option<String>, + #[doc = "Gets or sets the timeline identifier which owns the record representing this attempt."] + #[serde( + rename = "timelineId", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeline_id: Option<String>, } impl TimelineAttempt { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "Detailed information about the execution of different operations during pipeline run."] +#[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineRecord { - #[doc = "The specification of an agent running a pipeline job, in binary format. Applicable when record is of type Job. <br />Example: { \"VMImage\" : \"windows-2019\" }"] - #[serde( - rename = "agentSpecification", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_specification: Option<serde_json::Value>, - #[doc = "The number of record attempts."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "The ID connecting all records updated at the same time. This value is taken from timeline's ChangeId."] - #[serde(rename = "changeId", default, skip_serializing_if = "Option::is_none")] - pub change_id: Option<i32>, - #[doc = "A string that indicates the current operation."] - #[serde( - rename = "currentOperation", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_operation: Option<String>, - #[doc = "A reference to a timeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub details: Option<TimelineReference>, - #[doc = "The number of errors produced by this operation."] - #[serde( - rename = "errorCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_count: Option<i32>, - #[doc = "The finish time of the record."] - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = "The ID of the record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "String identifier that is consistent across attempts."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, - #[doc = "The list of issues produced by this operation."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub issues: Vec<Issue>, - #[doc = "The time the record was last modified."] - #[serde( - rename = "lastModified", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified: Option<time::OffsetDateTime>, - #[doc = "The REST URL of the record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option<String>, - #[doc = "A reference to a task log. This class contains information about the output printed to the timeline record's logs console during pipeline run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub log: Option<TaskLogReference>, - #[doc = "The name of the record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "An ordinal value relative to other records within the timeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, - #[doc = "The ID of the record's parent. <br />Example: Stage is a parent of a Phase, Phase is a parent of a Job, Job is a parent of a Task."] - #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option<String>, - #[doc = "The percentage of record completion."] - #[serde( - rename = "percentComplete", - default, - skip_serializing_if = "Option::is_none" - )] - pub percent_complete: Option<i32>, - #[doc = "The previous record attempts."] - #[serde( - rename = "previousAttempts", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub previous_attempts: Vec<TimelineAttempt>, - #[doc = "The ID of the queue which connects projects to agent pools on which the operation ran on. Applicable when record is of type Job."] - #[serde(rename = "queueId", default, skip_serializing_if = "Option::is_none")] - pub queue_id: Option<i32>, - #[doc = "Name of the referenced record."] - #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] - pub ref_name: Option<String>, - #[doc = "The result of the record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<timeline_record::Result>, - #[doc = "Evaluation of predefined conditions upon completion of record's operation. <br />Example: Evaluating `succeeded()`, Result = True <br />Example: Evaluating `and(succeeded(), eq(variables['system.debug'], False))`, Result = False"] - #[serde( - rename = "resultCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_code: Option<String>, - #[doc = "The start time of the record."] - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, - #[doc = "The state of the record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<timeline_record::State>, - #[doc = "A reference to a task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub task: Option<TaskReference>, - #[doc = "The type of operation being tracked by the record. <br />Example: Stage, Phase, Job, Task..."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "The variables of the record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, - #[doc = "The number of warnings produced by this operation."] - #[serde( - rename = "warningCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub warning_count: Option<i32>, - #[doc = "The name of the agent running the operation. Applicable when record is of type Job."] - #[serde( - rename = "workerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub worker_name: Option<String>, + #[serde( + rename = "agentSpecification", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_specification: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[serde(rename = "changeId", default, skip_serializing_if = "Option::is_none")] + pub change_id: Option<i32>, + #[serde( + rename = "currentOperation", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_operation: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub details: Option<TimelineReference>, + #[serde( + rename = "errorCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_count: Option<i32>, + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub issues: Vec<Issue>, + #[serde( + rename = "lastModified", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub log: Option<TaskLogReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, + #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option<String>, + #[serde( + rename = "percentComplete", + default, + skip_serializing_if = "Option::is_none" + )] + pub percent_complete: Option<i32>, + #[serde( + rename = "previousAttempts", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub previous_attempts: Vec<TimelineAttempt>, + #[serde(rename = "queueId", default, skip_serializing_if = "Option::is_none")] + pub queue_id: Option<i32>, + #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] + pub ref_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<timeline_record::Result>, + #[serde( + rename = "resultCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_code: Option<String>, + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<timeline_record::State>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub task: Option<TaskReference>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, + #[serde( + rename = "warningCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub warning_count: Option<i32>, + #[serde( + rename = "workerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub worker_name: Option<String>, } impl TimelineRecord { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod timeline_record { - use super::*; - #[doc = "The result of the record."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "succeededWithIssues")] - SucceededWithIssues, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "abandoned")] - Abandoned, - } - #[doc = "The state of the record."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "pending")] - Pending, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "succeededWithIssues")] + SucceededWithIssues, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "abandoned")] + Abandoned, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineRecordFeedLinesWrapper { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(rename = "endLine", default, skip_serializing_if = "Option::is_none")] - pub end_line: Option<i64>, - #[serde(rename = "startLine", default, skip_serializing_if = "Option::is_none")] - pub start_line: Option<i64>, - #[serde(rename = "stepId", default, skip_serializing_if = "Option::is_none")] - pub step_id: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(rename = "endLine", default, skip_serializing_if = "Option::is_none")] + pub end_line: Option<i64>, + #[serde(rename = "startLine", default, skip_serializing_if = "Option::is_none")] + pub start_line: Option<i64>, + #[serde(rename = "stepId", default, skip_serializing_if = "Option::is_none")] + pub step_id: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<String>, } impl TimelineRecordFeedLinesWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "A reference to a timeline."] +#[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineReference { - #[doc = "The change ID."] - #[serde(rename = "changeId", default, skip_serializing_if = "Option::is_none")] - pub change_id: Option<i32>, - #[doc = "The ID of the timeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The REST URL of the timeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option<String>, + #[serde(rename = "changeId", default, skip_serializing_if = "Option::is_none")] + pub change_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option<String>, } impl TimelineReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidationItem { - #[doc = "Tells whether the current input is valid or not"] - #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] - pub is_valid: Option<bool>, - #[doc = "Reason for input validation failure"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<String>, - #[doc = "Type of validation item"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "Value to validate. The conditional expression to validate for the input for \"expression\" type Eg:eq(variables['Build.SourceBranch'], 'refs/heads/master');eq(value, 'refs/heads/master')"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Tells whether the current input is valid or not"] + #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] + pub is_valid: Option<bool>, + #[doc = "Reason for input validation failure"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<String>, + #[doc = "Type of validation item"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "Value to validate. The conditional expression to validate for the input for \"expression\" type Eg:eq(variables['Build.SourceBranch'], 'refs/heads/master');eq(value, 'refs/heads/master')"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl ValidationItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A variable group is a collection of related variables."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableGroup { - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Gets or sets the time when variable group was created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Gets or sets description of the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Gets or sets id of the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Indicates whether variable group is shared with other projects or not."] - #[serde(rename = "isShared", default, skip_serializing_if = "Option::is_none")] - pub is_shared: Option<bool>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "Gets or sets the time when variable group was modified"] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Gets or sets name of the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Defines provider data of the variable group."] - #[serde( - rename = "providerData", - default, - skip_serializing_if = "Option::is_none" - )] - pub provider_data: Option<VariableGroupProviderData>, - #[doc = "Gets or sets type of the variable group."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "all project references where the variable group is shared with other projects."] - #[serde( - rename = "variableGroupProjectReferences", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub variable_group_project_references: Vec<VariableGroupProjectReference>, - #[doc = "Gets or sets variables contained in the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "Gets or sets the time when variable group was created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Gets or sets description of the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Gets or sets id of the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Indicates whether variable group is shared with other projects or not."] + #[serde(rename = "isShared", default, skip_serializing_if = "Option::is_none")] + pub is_shared: Option<bool>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "Gets or sets the time when variable group was modified"] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Gets or sets name of the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Defines provider data of the variable group."] + #[serde( + rename = "providerData", + default, + skip_serializing_if = "Option::is_none" + )] + pub provider_data: Option<VariableGroupProviderData>, + #[doc = "Gets or sets type of the variable group."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "all project references where the variable group is shared with other projects."] + #[serde( + rename = "variableGroupProjectReferences", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub variable_group_project_references: Vec<VariableGroupProjectReference>, + #[doc = "Gets or sets variables contained in the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl VariableGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableGroupList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<VariableGroup>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<VariableGroup>, } impl VariableGroupList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableGroupParameters { - #[doc = "Sets description of the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Sets name of the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Defines provider data of the variable group."] - #[serde( - rename = "providerData", - default, - skip_serializing_if = "Option::is_none" - )] - pub provider_data: Option<VariableGroupProviderData>, - #[doc = "Sets type of the variable group."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[serde( - rename = "variableGroupProjectReferences", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub variable_group_project_references: Vec<VariableGroupProjectReference>, - #[doc = "Sets variables contained in the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[doc = "Sets description of the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Sets name of the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Defines provider data of the variable group."] + #[serde( + rename = "providerData", + default, + skip_serializing_if = "Option::is_none" + )] + pub provider_data: Option<VariableGroupProviderData>, + #[doc = "Sets type of the variable group."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[serde( + rename = "variableGroupProjectReferences", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub variable_group_project_references: Vec<VariableGroupProjectReference>, + #[doc = "Sets variables contained in the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl VariableGroupParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A variable group reference is a shallow reference to variable group."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableGroupProjectReference { - #[doc = "Gets or sets description of the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Gets or sets name of the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde( - rename = "projectReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_reference: Option<ProjectReference>, + #[doc = "Gets or sets description of the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Gets or sets name of the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde( + rename = "projectReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_reference: Option<ProjectReference>, } impl VariableGroupProjectReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines provider data of the variable group."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableGroupProviderData {} impl VariableGroupProviderData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "A wrapper class for a generic variable."] +#[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableValue { - #[doc = "Indicates whether the variable can be changed during script's execution runtime."] - #[serde( - rename = "isReadOnly", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_read_only: Option<bool>, - #[doc = "Indicates whether the variable should be encrypted at rest."] - #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] - pub is_secret: Option<bool>, - #[doc = "The value of the variable."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde( + rename = "isReadOnly", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_read_only: Option<bool>, + #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] + pub is_secret: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VariableValue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VirtualMachine { - #[doc = "A task agent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub agent: Option<TaskAgent>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, + #[doc = "A task agent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub agent: Option<TaskAgent>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, } impl VirtualMachine { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VirtualMachineGroup { - #[serde(flatten)] - pub environment_resource: EnvironmentResource, - #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] - pub pool_id: Option<i32>, + #[serde(flatten)] + pub environment_resource: EnvironmentResource, + #[serde(rename = "poolId", default, skip_serializing_if = "Option::is_none")] + pub pool_id: Option<i32>, } impl VirtualMachineGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VirtualMachineGroupCreateParameters { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl VirtualMachineGroupCreateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VirtualMachineResource { - #[serde(flatten)] - pub environment_resource: EnvironmentResource, - #[doc = "A task agent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub agent: Option<TaskAgent>, + #[serde(flatten)] + pub environment_resource: EnvironmentResource, + #[doc = "A task agent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub agent: Option<TaskAgent>, } impl VirtualMachineResource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VirtualMachineResourceCreateParameters { - #[doc = ""] - #[serde( - rename = "virtualMachineResource", - default, - skip_serializing_if = "Option::is_none" - )] - pub virtual_machine_resource: Option<VirtualMachineResource>, + #[doc = ""] + #[serde( + rename = "virtualMachineResource", + default, + skip_serializing_if = "Option::is_none" + )] + pub virtual_machine_resource: Option<VirtualMachineResource>, } impl VirtualMachineResourceCreateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/extension_management/mod.rs b/azure_devops_rust_api/src/extension_management/mod.rs index e4763be1..099d6e76 100644 --- a/azure_devops_rust_api/src/extension_management/mod.rs +++ b/azure_devops_rust_api/src/extension_management/mod.rs @@ -9,799 +9,795 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://extmgmt.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + pub fn installed_extensions_client(&self) -> installed_extensions::Client { + installed_extensions::Client(self.clone()) + } +} +pub mod installed_extensions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List the installed extensions in the account / project collection."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::InstalledExtension>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `publisher_name`: Name of the publisher. Example: \"fabrikam\"."] + #[doc = "* `extension_name`: Name of the extension. Example: \"ops-tools\"."] + pub fn get( + &self, + organization: impl Into<String>, + publisher_name: impl Into<String>, + extension_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `publisher_name`: Name of the publisher. Example: \"fabrikam\"."] + #[doc = "* `extension_name`: Name of the extension. Example: \"ops-tools\"."] + pub fn uninstall_extension_by_name( + &self, + organization: impl Into<String>, + publisher_name: impl Into<String>, + extension_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `publisher_name`: Name of the publisher. Example: \"fabrikam\"."] + #[doc = "* `extension_name`: Name of the extension. Example: \"ops-tools\"."] + pub fn install_extension_by_name( + &self, + organization: impl Into<String>, + publisher_name: impl Into<String>, + extension_name: impl Into<String>, + version: impl Into<String>, + ) -> 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(), + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::InstalledExtensionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::InstalledExtensionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) include_disabled_extensions: Option<bool>, + pub(crate) include_errors: Option<bool>, + pub(crate) asset_types: Option<String>, + pub(crate) include_installation_issues: Option<bool>, + } + impl RequestBuilder { + #[doc = "If true (the default), include disabled extensions in the results."] + pub fn include_disabled_extensions(mut self, include_disabled_extensions: bool) -> Self { + self.include_disabled_extensions = Some(include_disabled_extensions); + self + } + #[doc = "If true, include installed extensions with errors."] + pub fn include_errors(mut self, include_errors: bool) -> Self { + self.include_errors = Some(include_errors); self + } + #[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<String>) -> Self { + self.asset_types = Some(asset_types.into()); + self + } + pub fn include_installation_issues(mut self, include_installation_issues: bool) -> Self { + self.include_installation_issues = Some(include_installation_issues); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/extensionmanagement/installedextensions", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::InstalledExtensionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::InstalledExtensionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::InstalledExtension> { + let bytes = self.0.into_body().collect().await?; + let body: models::InstalledExtension = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::InstalledExtension, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/extensionmanagement/installedextensions", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::InstalledExtension>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::InstalledExtension>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::InstalledExtension> { + let bytes = self.0.into_body().collect().await?; + let body: models::InstalledExtension = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) publisher_name: String, + pub(crate) extension_name: String, + pub(crate) asset_types: Option<String>, + } + 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<String>) -> Self { + self.asset_types = Some(asset_types.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}", + this.client.endpoint(), + &this.organization, + &this.publisher_name, + &this.extension_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(asset_types) = &this.asset_types { + req + .url_mut() + .query_pairs_mut() + .append_pair("assetTypes", asset_types); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::InstalledExtension>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::InstalledExtension>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - pub fn installed_extensions_client(&self) -> installed_extensions::Client { - installed_extensions::Client(self.clone()) + } + pub mod uninstall_extension_by_name { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) publisher_name: String, + pub(crate) extension_name: String, + pub(crate) reason: Option<String>, + pub(crate) reason_code: Option<String>, } -} -pub mod installed_extensions { + impl RequestBuilder { + pub fn reason(mut self, reason: impl Into<String>) -> Self { + self.reason = Some(reason.into()); + self + } + pub fn reason_code(mut self, reason_code: impl Into<String>) -> Self { + self.reason_code = Some(reason_code.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}", + this.client.endpoint(), + &this.organization, + &this.publisher_name, + &this.extension_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod install_extension_by_name { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List the installed extensions in the account / project collection."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::InstalledExtension>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `publisher_name`: Name of the publisher. Example: \"fabrikam\"."] - #[doc = "* `extension_name`: Name of the extension. Example: \"ops-tools\"."] - pub fn get( - &self, - organization: impl Into<String>, - publisher_name: impl Into<String>, - extension_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `publisher_name`: Name of the publisher. Example: \"fabrikam\"."] - #[doc = "* `extension_name`: Name of the extension. Example: \"ops-tools\"."] - pub fn uninstall_extension_by_name( - &self, - organization: impl Into<String>, - publisher_name: impl Into<String>, - extension_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `publisher_name`: Name of the publisher. Example: \"fabrikam\"."] - #[doc = "* `extension_name`: Name of the extension. Example: \"ops-tools\"."] - pub fn install_extension_by_name( - &self, - organization: impl Into<String>, - publisher_name: impl Into<String>, - extension_name: impl Into<String>, - version: impl Into<String>, - ) -> 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(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::InstalledExtensionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::InstalledExtensionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) include_disabled_extensions: Option<bool>, - pub(crate) include_errors: Option<bool>, - pub(crate) asset_types: Option<String>, - pub(crate) include_installation_issues: Option<bool>, - } - impl RequestBuilder { - #[doc = "If true (the default), include disabled extensions in the results."] - pub fn include_disabled_extensions( - mut self, - include_disabled_extensions: bool, - ) -> Self { - self.include_disabled_extensions = Some(include_disabled_extensions); - self - } - #[doc = "If true, include installed extensions with errors."] - pub fn include_errors(mut self, include_errors: bool) -> Self { - self.include_errors = Some(include_errors); - self - } - #[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<String>) -> Self { - self.asset_types = Some(asset_types.into()); - self - } - pub fn include_installation_issues( - mut self, - include_installation_issues: bool, - ) -> Self { - self.include_installation_issues = Some(include_installation_issues); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/extensionmanagement/installedextensions", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::InstalledExtensionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::InstalledExtensionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::InstalledExtension> { - let bytes = self.0.into_body().collect().await?; - let body: models::InstalledExtension = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::InstalledExtension, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/extensionmanagement/installedextensions", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::InstalledExtension>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::InstalledExtension>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::InstalledExtension> { - let bytes = self.0.into_body().collect().await?; - let body: models::InstalledExtension = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) publisher_name: String, - pub(crate) extension_name: String, - pub(crate) asset_types: Option<String>, - } - 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<String>) -> Self { - self.asset_types = Some(asset_types.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}", - this.client.endpoint(), - &this.organization, - &this.publisher_name, - &this.extension_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(asset_types) = &this.asset_types { - req.url_mut() - .query_pairs_mut() - .append_pair("assetTypes", asset_types); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::InstalledExtension>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::InstalledExtension>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod uninstall_extension_by_name { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) publisher_name: String, - pub(crate) extension_name: String, - pub(crate) reason: Option<String>, - pub(crate) reason_code: Option<String>, - } - impl RequestBuilder { - pub fn reason(mut self, reason: impl Into<String>) -> Self { - self.reason = Some(reason.into()); - self - } - pub fn reason_code(mut self, reason_code: impl Into<String>) -> Self { - self.reason_code = Some(reason_code.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}", - this.client.endpoint(), - &this.organization, - &this.publisher_name, - &this.extension_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod install_extension_by_name { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::InstalledExtension> { - let bytes = self.0.into_body().collect().await?; - let body: models::InstalledExtension = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) publisher_name: String, - pub(crate) extension_name: String, - pub(crate) version: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}/{}", - this.client.endpoint(), - &this.organization, - &this.publisher_name, - &this.extension_name, - &this.version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::InstalledExtension>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::InstalledExtension>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::InstalledExtension> { + let bytes = self.0.into_body().collect().await?; + let body: models::InstalledExtension = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) publisher_name: String, + pub(crate) extension_name: String, + pub(crate) version: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}/{}", + this.client.endpoint(), + &this.organization, + &this.publisher_name, + &this.extension_name, + &this.version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::InstalledExtension>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::InstalledExtension>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/extension_management/models.rs b/azure_devops_rust_api/src/extension_management/models.rs index 4789a4ff..ed1117f9 100644 --- a/azure_devops_rust_api/src/extension_management/models.rs +++ b/azure_devops_rust_api/src/extension_management/models.rs @@ -8,2167 +8,2146 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AcquisitionOperation { - #[doc = "State of the AcquisitionOperation for the current user"] - #[serde( - rename = "operationState", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_state: Option<acquisition_operation::OperationState>, - #[doc = "AcquisitionOperationType: install, request, buy, etc..."] - #[serde( - rename = "operationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_type: Option<acquisition_operation::OperationType>, - #[doc = "Optional reason to justify current state. Typically used with Disallow state."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<String>, - #[doc = "List of reasons indicating why the operation is not allowed."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub reasons: Vec<AcquisitionOperationDisallowReason>, + #[doc = "State of the the AcquisitionOperation for the current user"] + #[serde( + rename = "operationState", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_state: Option<acquisition_operation::OperationState>, + #[doc = "AcquisitionOperationType: install, request, buy, etc..."] + #[serde( + rename = "operationType", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_type: Option<acquisition_operation::OperationType>, + #[doc = "Optional reason to justify current state. Typically used with Disallow state."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<String>, + #[doc = "List of reasons indicating why the operation is not allowed."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub reasons: Vec<AcquisitionOperationDisallowReason>, } impl AcquisitionOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod acquisition_operation { - use super::*; - #[doc = "State of the AcquisitionOperation for the current user"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum OperationState { - #[serde(rename = "disallow")] - Disallow, - #[serde(rename = "allow")] - Allow, - #[serde(rename = "completed")] - Completed, - } - #[doc = "AcquisitionOperationType: install, request, buy, etc..."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum OperationType { - #[serde(rename = "get")] - Get, - #[serde(rename = "install")] - Install, - #[serde(rename = "buy")] - Buy, - #[serde(rename = "try")] - Try, - #[serde(rename = "request")] - Request, - #[serde(rename = "none")] - None, - #[serde(rename = "purchaseRequest")] - PurchaseRequest, - } + use super::*; + #[doc = "State of the the AcquisitionOperation for the current user"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum OperationState { + #[serde(rename = "disallow")] + Disallow, + #[serde(rename = "allow")] + Allow, + #[serde(rename = "completed")] + Completed, + } + #[doc = "AcquisitionOperationType: install, request, buy, etc..."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum OperationType { + #[serde(rename = "get")] + Get, + #[serde(rename = "install")] + Install, + #[serde(rename = "buy")] + Buy, + #[serde(rename = "try")] + Try, + #[serde(rename = "request")] + Request, + #[serde(rename = "none")] + None, + #[serde(rename = "purchaseRequest")] + PurchaseRequest, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AcquisitionOperationDisallowReason { - #[doc = "User-friendly message clarifying the reason for disallowance"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "Type of reason for disallowance - AlreadyInstalled, UnresolvedDemand, etc."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "User-friendly message clarifying the reason for disallowance"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "Type of reason for disallowance - AlreadyInstalled, UnresolvedDemand, etc."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl AcquisitionOperationDisallowReason { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Market item acquisition options (install, buy, etc) for an installation target."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AcquisitionOptions { - #[doc = ""] - #[serde( - rename = "defaultOperation", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_operation: Option<AcquisitionOperation>, - #[doc = "The item id that this options refer to"] - #[serde(rename = "itemId", default, skip_serializing_if = "Option::is_none")] - pub item_id: Option<String>, - #[doc = "Operations allowed for the ItemId in this target"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub operations: Vec<AcquisitionOperation>, - #[doc = "Additional properties which can be added to the request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "The target that this options refer to"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<String>, + #[doc = ""] + #[serde( + rename = "defaultOperation", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_operation: Option<AcquisitionOperation>, + #[doc = "The item id that this options refer to"] + #[serde(rename = "itemId", default, skip_serializing_if = "Option::is_none")] + pub item_id: Option<String>, + #[doc = "Operations allowed for the ItemId in this target"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub operations: Vec<AcquisitionOperation>, + #[doc = "Additional properties which can be added to the request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "The target that this options refer to"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<String>, } impl AcquisitionOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Representation of a ContributionNode that can be used for serialized to clients."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ClientContribution { - #[doc = "Description of the contribution/type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Fully qualified identifier of the contribution/type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Includes is a set of contributions that should have this contribution included in their targets list."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub includes: Vec<String>, - #[doc = "Properties/attributes of this contribution"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "The ids of the contribution(s) that this contribution targets. (parent contributions)"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub targets: Vec<String>, - #[doc = "Id of the Contribution Type"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Description of the contribution/type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Fully qualified identifier of the contribution/type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Includes is a set of contributions that should have this contribution included in their targets list."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub includes: Vec<String>, + #[doc = "Properties/attributes of this contribution"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "The ids of the contribution(s) that this contribution targets. (parent contributions)"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub targets: Vec<String>, + #[doc = "Id of the Contribution Type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl ClientContribution { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Representation of a ContributionNode that can be used for serialized to clients."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ClientContributionNode { - #[doc = "List of ids for contributions which are children to the current contribution."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub children: Vec<String>, - #[doc = "Representation of a ContributionNode that can be used for serialized to clients."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub contribution: Option<ClientContribution>, - #[doc = "List of ids for contributions which are parents to the current contribution."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub parents: Vec<String>, + #[doc = "List of ids for contributions which are children to the current contribution."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub children: Vec<String>, + #[doc = "Representation of a ContributionNode that can be used for serialized to clients."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub contribution: Option<ClientContribution>, + #[doc = "List of ids for contributions which are parents to the current contribution."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub parents: Vec<String>, } impl ClientContributionNode { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ClientContributionProviderDetails { - #[doc = "Friendly name for the provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Unique identifier for this provider. The provider name can be used to cache the contribution data and refer back to it when looking for changes"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Properties associated with the provider"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Version of contributions associated with this contribution provider."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Friendly name for the provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Unique identifier for this provider. The provider name can be used to cache the contribution data and refer back to it when looking for changes"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Properties associated with the provider"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Version of contributions associated with this contribution provider."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl ClientContributionProviderDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A client data provider are the details needed to make the data provider request from the client."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ClientDataProviderQuery { - #[serde(flatten)] - pub data_provider_query: DataProviderQuery, - #[doc = "The Id of the service instance type that should be communicated with in order to resolve the data providers from the client given the query values."] - #[serde( - rename = "queryServiceInstanceType", - default, - skip_serializing_if = "Option::is_none" - )] - pub query_service_instance_type: Option<String>, + #[serde(flatten)] + pub data_provider_query: DataProviderQuery, + #[doc = "The Id of the service instance type that should be communicated with in order to resolve the data providers from the client given the query values."] + #[serde( + rename = "queryServiceInstanceType", + default, + skip_serializing_if = "Option::is_none" + )] + pub query_service_instance_type: Option<String>, } impl ClientDataProviderQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An individual contribution made by an extension"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Contribution { - #[serde(flatten)] - pub contribution_base: ContributionBase, - #[doc = "List of constraints (filters) that should be applied to the availability of this contribution"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub constraints: Vec<ContributionConstraint>, - #[doc = "Includes is a set of contributions that should have this contribution included in their targets list."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub includes: Vec<String>, - #[doc = "Properties/attributes of this contribution"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "List of demanded claims in order for the user to see this contribution (like anonymous, public, member...)."] - #[serde( - rename = "restrictedTo", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub restricted_to: Vec<String>, - #[doc = "The ids of the contribution(s) that this contribution targets. (parent contributions)"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub targets: Vec<String>, - #[doc = "Id of the Contribution Type"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde(flatten)] + pub contribution_base: ContributionBase, + #[doc = "List of constraints (filters) that should be applied to the availability of this contribution"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub constraints: Vec<ContributionConstraint>, + #[doc = "Includes is a set of contributions that should have this contribution included in their targets list."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub includes: Vec<String>, + #[doc = "Properties/attributes of this contribution"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "List of demanded claims in order for the user to see this contribution (like anonymous, public, member...)."] + #[serde( + rename = "restrictedTo", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub restricted_to: Vec<String>, + #[doc = "The ids of the contribution(s) that this contribution targets. (parent contributions)"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub targets: Vec<String>, + #[doc = "Id of the Contribution Type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl Contribution { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Base class shared by contributions and contribution types"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContributionBase { - #[doc = "Description of the contribution/type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Fully qualified identifier of the contribution/type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "VisibleTo can be used to restrict whom can reference a given contribution/type. This value should be a list of publishers or extensions access is restricted too. Examples: \"ms\" - Means only the \"ms\" publisher can reference this. \"ms.vss-web\" - Means only the \"vss-web\" extension from the \"ms\" publisher can reference this."] - #[serde( - rename = "visibleTo", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub visible_to: Vec<String>, + #[doc = "Description of the contribution/type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Fully qualified identifier of the contribution/type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "VisibleTo can be used to restrict whom can reference a given contribution/type. This value should be a list of publishers or extensions access is restricted too. Examples: \"ms\" - Means only the \"ms\" publisher can reference this. \"ms.vss-web\" - Means only the \"vss-web\" extension from the \"ms\" publisher can reference this."] + #[serde( + rename = "visibleTo", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub visible_to: Vec<String>, } impl ContributionBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Specifies a constraint that can be used to dynamically include/exclude a given contribution"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContributionConstraint { - #[doc = "An optional property that can be specified to group constraints together. All constraints within a group are AND'd together (all must be evaluate to True in order for the contribution to be included). Different groups of constraints are OR'd (only one group needs to evaluate to True for the contribution to be included)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub group: Option<i32>, - #[doc = "Fully qualified identifier of a shared constraint"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "If true, negate the result of the filter (include the contribution if the applied filter returns false instead of true)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inverse: Option<bool>, - #[doc = "Name of the IContributionFilter plugin"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Properties that are fed to the contribution filter class"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Constraints can be optionally be applied to one or more of the relationships defined in the contribution. If no relationships are defined then all relationships are associated with the constraint. This means the default behaviour will eliminate the contribution from the tree completely if the constraint is applied."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub relationships: Vec<String>, + #[doc = "An optional property that can be specified to group constraints together. All constraints within a group are AND'd together (all must be evaluate to True in order for the contribution to be included). Different groups of constraints are OR'd (only one group needs to evaluate to True for the contribution to be included)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option<i32>, + #[doc = "Fully qualified identifier of a shared constraint"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "If true, negate the result of the filter (include the contribution if the applied filter returns false instead of true)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inverse: Option<bool>, + #[doc = "Name of the IContributionFilter plugin"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Properties that are fed to the contribution filter class"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Constraints can be optionally be applied to one or more of the relationships defined in the contribution. If no relationships are defined then all relationships are associated with the constraint. This means the default behaviour will eliminate the contribution from the tree completely if the constraint is applied."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub relationships: Vec<String>, } impl ContributionConstraint { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A query that can be issued for contribution nodes"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContributionNodeQuery { - #[doc = "The contribution ids of the nodes to find."] - #[serde( - rename = "contributionIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub contribution_ids: Vec<String>, - #[doc = "Contextual information that data providers can examine when populating their data"] - #[serde( - rename = "dataProviderContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub data_provider_context: Option<DataProviderContext>, - #[doc = "Indicator if contribution provider details should be included in the result."] - #[serde( - rename = "includeProviderDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_provider_details: Option<bool>, - #[doc = "Query options tpo be used when fetching ContributionNodes"] - #[serde( - rename = "queryOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub query_options: Option<contribution_node_query::QueryOptions>, + #[doc = "The contribution ids of the nodes to find."] + #[serde( + rename = "contributionIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub contribution_ids: Vec<String>, + #[doc = "Contextual information that data providers can examine when populating their data"] + #[serde( + rename = "dataProviderContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub data_provider_context: Option<DataProviderContext>, + #[doc = "Indicator if contribution provider details should be included in the result."] + #[serde( + rename = "includeProviderDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_provider_details: Option<bool>, + #[doc = "Query options tpo be used when fetching ContributionNodes"] + #[serde( + rename = "queryOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub query_options: Option<contribution_node_query::QueryOptions>, } impl ContributionNodeQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod contribution_node_query { - use super::*; - #[doc = "Query options tpo be used when fetching ContributionNodes"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum QueryOptions { - #[serde(rename = "none")] - None, - #[serde(rename = "includeSelf")] - IncludeSelf, - #[serde(rename = "includeChildren")] - IncludeChildren, - #[serde(rename = "includeSubTree")] - IncludeSubTree, - #[serde(rename = "includeAll")] - IncludeAll, - #[serde(rename = "ignoreConstraints")] - IgnoreConstraints, - } + use super::*; + #[doc = "Query options tpo be used when fetching ContributionNodes"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum QueryOptions { + #[serde(rename = "none")] + None, + #[serde(rename = "includeSelf")] + IncludeSelf, + #[serde(rename = "includeChildren")] + IncludeChildren, + #[serde(rename = "includeSubTree")] + IncludeSubTree, + #[serde(rename = "includeAll")] + IncludeAll, + #[serde(rename = "ignoreConstraints")] + IgnoreConstraints, + } } #[doc = "Result of a contribution node query. Wraps the resulting contribution nodes and provider details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContributionNodeQueryResult { - #[doc = "Map of contribution ids to corresponding node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nodes: Option<serde_json::Value>, - #[doc = "Map of provider ids to the corresponding provider details object."] - #[serde( - rename = "providerDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub provider_details: Option<serde_json::Value>, + #[doc = "Map of contribution ids to corresponding node."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nodes: Option<serde_json::Value>, + #[doc = "Map of provider ids to the corresponding provider details object."] + #[serde( + rename = "providerDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub provider_details: Option<serde_json::Value>, } impl ContributionNodeQueryResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Description about a property of a contribution type"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContributionPropertyDescription { - #[doc = "Description of the property"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Name of the property"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "True if this property is required"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub required: Option<bool>, - #[doc = "The type of value used for this property"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<contribution_property_description::Type>, + #[doc = "Description of the property"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Name of the property"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "True if this property is required"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub required: Option<bool>, + #[doc = "The type of value used for this property"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<contribution_property_description::Type>, } impl ContributionPropertyDescription { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod contribution_property_description { - use super::*; - #[doc = "The type of value used for this property"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "string")] - String, - #[serde(rename = "uri")] - Uri, - #[serde(rename = "guid")] - Guid, - #[serde(rename = "boolean")] - Boolean, - #[serde(rename = "integer")] - Integer, - #[serde(rename = "double")] - Double, - #[serde(rename = "dateTime")] - DateTime, - #[serde(rename = "dictionary")] - Dictionary, - #[serde(rename = "array")] - Array, - #[serde(rename = "object")] - Object, - } + use super::*; + #[doc = "The type of value used for this property"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "string")] + String, + #[serde(rename = "uri")] + Uri, + #[serde(rename = "guid")] + Guid, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "integer")] + Integer, + #[serde(rename = "double")] + Double, + #[serde(rename = "dateTime")] + DateTime, + #[serde(rename = "dictionary")] + Dictionary, + #[serde(rename = "array")] + Array, + #[serde(rename = "object")] + Object, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContributionProviderDetails { - #[doc = "Friendly name for the provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Unique identifier for this provider. The provider name can be used to cache the contribution data and refer back to it when looking for changes"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Properties associated with the provider"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Version of contributions associated with this contribution provider."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Friendly name for the provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Unique identifier for this provider. The provider name can be used to cache the contribution data and refer back to it when looking for changes"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Properties associated with the provider"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Version of contributions associated with this contribution provider."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl ContributionProviderDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A contribution type, given by a json schema"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContributionType { - #[serde(flatten)] - pub contribution_base: ContributionBase, - #[doc = "Controls whether or not contributions of this type have the type indexed for queries. This allows clients to find all extensions that have a contribution of this type. NOTE: Only TrustedPartners are allowed to specify indexed contribution types."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub indexed: Option<bool>, - #[doc = "Friendly name of the contribution/type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Describes the allowed properties for this contribution type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, + #[serde(flatten)] + pub contribution_base: ContributionBase, + #[doc = "Controls whether or not contributions of this type have the type indexed for queries. This allows clients to find all extensions that have a contribution of this type. NOTE: Only TrustedPartners are allowed to specify indexed contribution types."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub indexed: Option<bool>, + #[doc = "Friendly name of the contribution/type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Describes the allowed properties for this contribution type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, } impl ContributionType { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contextual information that data providers can examine when populating their data"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataProviderContext { - #[doc = "Generic property bag that contains context-specific properties that data providers can use when populating their data dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, + #[doc = "Generic property bag that contains context-specific properties that data providers can use when populating their data dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, } impl DataProviderContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataProviderExceptionDetails { - #[doc = "The type of the exception that was thrown."] - #[serde( - rename = "exceptionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub exception_type: Option<String>, - #[doc = "Message that is associated with the exception."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "The StackTrace from the exception turned into a string."] - #[serde( - rename = "stackTrace", - default, - skip_serializing_if = "Option::is_none" - )] - pub stack_trace: Option<String>, + #[doc = "The type of the exception that was thrown."] + #[serde( + rename = "exceptionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub exception_type: Option<String>, + #[doc = "Message that is associated with the exception."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "The StackTrace from the exception turned into a string."] + #[serde( + rename = "stackTrace", + default, + skip_serializing_if = "Option::is_none" + )] + pub stack_trace: Option<String>, } impl DataProviderExceptionDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A query that can be issued for data provider data"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataProviderQuery { - #[doc = "Contextual information that data providers can examine when populating their data"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub context: Option<DataProviderContext>, - #[doc = "The contribution ids of the data providers to resolve"] - #[serde( - rename = "contributionIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub contribution_ids: Vec<String>, + #[doc = "Contextual information that data providers can examine when populating their data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub context: Option<DataProviderContext>, + #[doc = "The contribution ids of the data providers to resolve"] + #[serde( + rename = "contributionIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub contribution_ids: Vec<String>, } impl DataProviderQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Result structure from calls to GetDataProviderData"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataProviderResult { - #[doc = "This is the set of data providers that were requested, but either they were defined as client providers, or as remote providers that failed and may be retried by the client."] - #[serde( - rename = "clientProviders", - default, - skip_serializing_if = "Option::is_none" - )] - pub client_providers: Option<serde_json::Value>, - #[doc = "Property bag of data keyed off of the data provider contribution id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "Set of exceptions that occurred resolving the data providers."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub exceptions: Option<serde_json::Value>, - #[doc = "List of data providers resolved in the data-provider query"] - #[serde( - rename = "resolvedProviders", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub resolved_providers: Vec<ResolvedDataProvider>, - #[doc = "Scope name applied to this data provider result."] - #[serde(rename = "scopeName", default, skip_serializing_if = "Option::is_none")] - pub scope_name: Option<String>, - #[doc = "Scope value applied to this data provider result."] - #[serde( - rename = "scopeValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub scope_value: Option<String>, - #[doc = "Property bag of shared data that was contributed to by any of the individual data providers"] - #[serde( - rename = "sharedData", - default, - skip_serializing_if = "Option::is_none" - )] - pub shared_data: Option<serde_json::Value>, + #[doc = "This is the set of data providers that were requested, but either they were defined as client providers, or as remote providers that failed and may be retried by the client."] + #[serde( + rename = "clientProviders", + default, + skip_serializing_if = "Option::is_none" + )] + pub client_providers: Option<serde_json::Value>, + #[doc = "Property bag of data keyed off of the data provider contribution id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "Set of exceptions that occurred resolving the data providers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub exceptions: Option<serde_json::Value>, + #[doc = "List of data providers resolved in the data-provider query"] + #[serde( + rename = "resolvedProviders", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub resolved_providers: Vec<ResolvedDataProvider>, + #[doc = "Scope name applied to this data provider result."] + #[serde(rename = "scopeName", default, skip_serializing_if = "Option::is_none")] + pub scope_name: Option<String>, + #[doc = "Scope value applied to this data provider result."] + #[serde( + rename = "scopeValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub scope_value: Option<String>, + #[doc = "Property bag of shared data that was contributed to by any of the individual data providers"] + #[serde( + rename = "sharedData", + default, + skip_serializing_if = "Option::is_none" + )] + pub shared_data: Option<serde_json::Value>, } impl DataProviderResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data bag that any data provider can contribute to. This shared dictionary is returned in the data provider result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataProviderSharedData {} impl DataProviderSharedData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contract for handling the extension acquisition process"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionAcquisitionRequest { - #[doc = "How the item is being assigned"] - #[serde( - rename = "assignmentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub assignment_type: Option<extension_acquisition_request::AssignmentType>, - #[doc = "The id of the subscription used for purchase"] - #[serde(rename = "billingId", default, skip_serializing_if = "Option::is_none")] - pub billing_id: Option<String>, - #[doc = "The marketplace id (publisherName.extensionName) for the item"] - #[serde(rename = "itemId", default, skip_serializing_if = "Option::is_none")] - pub item_id: Option<String>, - #[doc = "The type of operation, such as install, request, purchase"] - #[serde( - rename = "operationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_type: Option<extension_acquisition_request::OperationType>, - #[doc = "Additional properties which can be added to the request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "How many licenses should be purchased"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub quantity: Option<i32>, + #[doc = "How the item is being assigned"] + #[serde( + rename = "assignmentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub assignment_type: Option<extension_acquisition_request::AssignmentType>, + #[doc = "The id of the subscription used for purchase"] + #[serde(rename = "billingId", default, skip_serializing_if = "Option::is_none")] + pub billing_id: Option<String>, + #[doc = "The marketplace id (publisherName.extensionName) for the item"] + #[serde(rename = "itemId", default, skip_serializing_if = "Option::is_none")] + pub item_id: Option<String>, + #[doc = "The type of operation, such as install, request, purchase"] + #[serde( + rename = "operationType", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_type: Option<extension_acquisition_request::OperationType>, + #[doc = "Additional properties which can be added to the request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "How many licenses should be purchased"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub quantity: Option<i32>, } impl ExtensionAcquisitionRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod extension_acquisition_request { - use super::*; - #[doc = "How the item is being assigned"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AssignmentType { - #[serde(rename = "none")] - None, - #[serde(rename = "me")] - Me, - #[serde(rename = "all")] - All, - } - #[doc = "The type of operation, such as install, request, purchase"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum OperationType { - #[serde(rename = "get")] - Get, - #[serde(rename = "install")] - Install, - #[serde(rename = "buy")] - Buy, - #[serde(rename = "try")] - Try, - #[serde(rename = "request")] - Request, - #[serde(rename = "none")] - None, - #[serde(rename = "purchaseRequest")] - PurchaseRequest, - } + use super::*; + #[doc = "How the item is being assigned"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AssignmentType { + #[serde(rename = "none")] + None, + #[serde(rename = "me")] + Me, + #[serde(rename = "all")] + All, + } + #[doc = "The type of operation, such as install, request, purchase"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum OperationType { + #[serde(rename = "get")] + Get, + #[serde(rename = "install")] + Install, + #[serde(rename = "buy")] + Buy, + #[serde(rename = "try")] + Try, + #[serde(rename = "request")] + Request, + #[serde(rename = "none")] + None, + #[serde(rename = "purchaseRequest")] + PurchaseRequest, + } } #[doc = "Audit log for an extension"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionAuditLog { - #[doc = "Collection of audit log entries"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub entries: Vec<ExtensionAuditLogEntry>, - #[doc = "Extension that the change was made for"] - #[serde( - rename = "extensionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_name: Option<String>, - #[doc = "Publisher that the extension is part of"] - #[serde( - rename = "publisherName", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_name: Option<String>, + #[doc = "Collection of audit log entries"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub entries: Vec<ExtensionAuditLogEntry>, + #[doc = "Extension that the change was made for"] + #[serde( + rename = "extensionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_name: Option<String>, + #[doc = "Publisher that the extension is part of"] + #[serde( + rename = "publisherName", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_name: Option<String>, } impl ExtensionAuditLog { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An audit log entry for an extension"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionAuditLogEntry { - #[doc = "Change that was made to extension"] - #[serde( - rename = "auditAction", - default, - skip_serializing_if = "Option::is_none" - )] - pub audit_action: Option<String>, - #[doc = "Date at which the change was made"] - #[serde( - rename = "auditDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub audit_date: Option<time::OffsetDateTime>, - #[doc = "Extra information about the change"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = ""] - #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")] - pub updated_by: Option<IdentityRef>, + #[doc = "Change that was made to extension"] + #[serde( + rename = "auditAction", + default, + skip_serializing_if = "Option::is_none" + )] + pub audit_action: Option<String>, + #[doc = "Date at which the change was made"] + #[serde( + rename = "auditDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub audit_date: Option<time::OffsetDateTime>, + #[doc = "Extra information about the change"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = ""] + #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")] + pub updated_by: Option<IdentityRef>, } impl ExtensionAuditLogEntry { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionAuthorization { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub scopes: Vec<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub scopes: Vec<String>, } impl ExtensionAuthorization { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionBadge { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(rename = "imgUri", default, skip_serializing_if = "Option::is_none")] - pub img_uri: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub link: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(rename = "imgUri", default, skip_serializing_if = "Option::is_none")] + pub img_uri: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub link: Option<String>, } impl ExtensionBadge { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a single collection for extension data documents"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionDataCollection { - #[doc = "The name of the collection"] - #[serde( - rename = "collectionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub collection_name: Option<String>, - #[doc = "A list of documents belonging to the collection"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub documents: Vec<serde_json::Value>, - #[doc = "The type of the collection's scope, such as Default or User"] - #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] - pub scope_type: Option<String>, - #[doc = "The value of the collection's scope, such as Current or Me"] - #[serde( - rename = "scopeValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub scope_value: Option<String>, + #[doc = "The name of the collection"] + #[serde( + rename = "collectionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub collection_name: Option<String>, + #[doc = "A list of documents belonging to the collection"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub documents: Vec<serde_json::Value>, + #[doc = "The type of the collection's scope, such as Default or User"] + #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] + pub scope_type: Option<String>, + #[doc = "The value of the collection's scope, such as Current or Me"] + #[serde( + rename = "scopeValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub scope_value: Option<String>, } impl ExtensionDataCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a query to receive a set of extension data collections"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionDataCollectionQuery { - #[doc = "A list of collections to query"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub collections: Vec<ExtensionDataCollection>, + #[doc = "A list of collections to query"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub collections: Vec<ExtensionDataCollection>, } impl ExtensionDataCollectionQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionEvent { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub extension: Option<PublishedExtension>, - #[doc = "The current version of the extension that was updated"] - #[serde( - rename = "extensionVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_version: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub host: Option<ExtensionHost>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<ExtensionEventUrls>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "The type of update that was made"] - #[serde( - rename = "updateType", - default, - skip_serializing_if = "Option::is_none" - )] - pub update_type: Option<extension_event::UpdateType>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub extension: Option<PublishedExtension>, + #[doc = "The current version of the extension that was updated"] + #[serde( + rename = "extensionVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_version: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub host: Option<ExtensionHost>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<ExtensionEventUrls>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "The type of update that was made"] + #[serde( + rename = "updateType", + default, + skip_serializing_if = "Option::is_none" + )] + pub update_type: Option<extension_event::UpdateType>, } impl ExtensionEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod extension_event { - use super::*; - #[doc = "The type of update that was made"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum UpdateType { - #[serde(rename = "installed")] - Installed, - #[serde(rename = "uninstalled")] - Uninstalled, - #[serde(rename = "enabled")] - Enabled, - #[serde(rename = "disabled")] - Disabled, - #[serde(rename = "versionUpdated")] - VersionUpdated, - #[serde(rename = "actionRequired")] - ActionRequired, - #[serde(rename = "actionResolved")] - ActionResolved, - } + use super::*; + #[doc = "The type of update that was made"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum UpdateType { + #[serde(rename = "installed")] + Installed, + #[serde(rename = "uninstalled")] + Uninstalled, + #[serde(rename = "enabled")] + Enabled, + #[serde(rename = "disabled")] + Disabled, + #[serde(rename = "versionUpdated")] + VersionUpdated, + #[serde(rename = "actionRequired")] + ActionRequired, + #[serde(rename = "actionResolved")] + ActionResolved, + } } #[doc = "Base class for an event callback for an extension"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionEventCallback { - #[doc = "The uri of the endpoint that is hit when an event occurs"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, + #[doc = "The uri of the endpoint that is hit when an event occurs"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, } impl ExtensionEventCallback { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Collection of event callbacks - endpoints called when particular extension events occur."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionEventCallbackCollection { - #[doc = "Base class for an event callback for an extension"] - #[serde( - rename = "postDisable", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_disable: Option<ExtensionEventCallback>, - #[doc = "Base class for an event callback for an extension"] - #[serde( - rename = "postEnable", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_enable: Option<ExtensionEventCallback>, - #[doc = "Base class for an event callback for an extension"] - #[serde( - rename = "postInstall", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_install: Option<ExtensionEventCallback>, - #[doc = "Base class for an event callback for an extension"] - #[serde( - rename = "postUninstall", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_uninstall: Option<ExtensionEventCallback>, - #[doc = "Base class for an event callback for an extension"] - #[serde( - rename = "postUpdate", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_update: Option<ExtensionEventCallback>, - #[doc = "Base class for an event callback for an extension"] - #[serde( - rename = "preInstall", - default, - skip_serializing_if = "Option::is_none" - )] - pub pre_install: Option<ExtensionEventCallback>, - #[doc = "Base class for an event callback for an extension"] - #[serde( - rename = "versionCheck", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_check: Option<ExtensionEventCallback>, + #[doc = "Base class for an event callback for an extension"] + #[serde( + rename = "postDisable", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_disable: Option<ExtensionEventCallback>, + #[doc = "Base class for an event callback for an extension"] + #[serde( + rename = "postEnable", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_enable: Option<ExtensionEventCallback>, + #[doc = "Base class for an event callback for an extension"] + #[serde( + rename = "postInstall", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_install: Option<ExtensionEventCallback>, + #[doc = "Base class for an event callback for an extension"] + #[serde( + rename = "postUninstall", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_uninstall: Option<ExtensionEventCallback>, + #[doc = "Base class for an event callback for an extension"] + #[serde( + rename = "postUpdate", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_update: Option<ExtensionEventCallback>, + #[doc = "Base class for an event callback for an extension"] + #[serde( + rename = "preInstall", + default, + skip_serializing_if = "Option::is_none" + )] + pub pre_install: Option<ExtensionEventCallback>, + #[doc = "Base class for an event callback for an extension"] + #[serde( + rename = "versionCheck", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_check: Option<ExtensionEventCallback>, } impl ExtensionEventCallbackCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionEventUrls { - #[serde(flatten)] - pub extension_urls: ExtensionUrls, - #[doc = "Url of the extension management page"] - #[serde( - rename = "manageExtensionsPage", - default, - skip_serializing_if = "Option::is_none" - )] - pub manage_extensions_page: Option<String>, + #[serde(flatten)] + pub extension_urls: ExtensionUrls, + #[doc = "Url of the extension management page"] + #[serde( + rename = "manageExtensionsPage", + default, + skip_serializing_if = "Option::is_none" + )] + pub manage_extensions_page: Option<String>, } impl ExtensionEventUrls { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionFile { - #[serde(rename = "assetType", default, skip_serializing_if = "Option::is_none")] - pub asset_type: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub language: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<String>, + #[serde(rename = "assetType", default, skip_serializing_if = "Option::is_none")] + pub asset_type: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub language: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<String>, } impl ExtensionFile { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionHost { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ExtensionHost { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the component pieces of an extensions fully qualified name, along with the fully qualified name."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionIdentifier { - #[doc = "The ExtensionName component part of the fully qualified ExtensionIdentifier"] - #[serde( - rename = "extensionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_name: Option<String>, - #[doc = "The PublisherName component part of the fully qualified ExtensionIdentifier"] - #[serde( - rename = "publisherName", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_name: Option<String>, + #[doc = "The ExtensionName component part of the fully qualified ExtensionIdentifier"] + #[serde( + rename = "extensionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_name: Option<String>, + #[doc = "The PublisherName component part of the fully qualified ExtensionIdentifier"] + #[serde( + rename = "publisherName", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_name: Option<String>, } impl ExtensionIdentifier { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "How an extension should handle including contributions based on licensing"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionLicensing { - #[doc = "A list of contributions which deviate from the default licensing behavior"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub overrides: Vec<LicensingOverride>, + #[doc = "A list of contributions which deviate from the default licensing behavior"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub overrides: Vec<LicensingOverride>, } impl ExtensionLicensing { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Base class for extension properties which are shared by the extension manifest and the extension model"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionManifest { - #[doc = "Uri used as base for other relative uri's defined in extension"] - #[serde(rename = "baseUri", default, skip_serializing_if = "Option::is_none")] - pub base_uri: Option<String>, - #[doc = "List of shared constraints defined by this extension"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub constraints: Vec<ContributionConstraint>, - #[doc = "List of contributions made by this extension"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub contributions: Vec<Contribution>, - #[doc = "List of contribution types defined by this extension"] - #[serde( - rename = "contributionTypes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub contribution_types: Vec<ContributionType>, - #[doc = "List of explicit demands required by this extension"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub demands: Vec<String>, - #[doc = "Collection of event callbacks - endpoints called when particular extension events occur."] - #[serde( - rename = "eventCallbacks", - default, - skip_serializing_if = "Option::is_none" - )] - pub event_callbacks: Option<ExtensionEventCallbackCollection>, - #[doc = "Secondary location that can be used as base for other relative uri's defined in extension"] - #[serde( - rename = "fallbackBaseUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub fallback_base_uri: Option<String>, - #[doc = "Language Culture Name set by the Gallery"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub language: Option<String>, - #[doc = "How an extension should handle including contributions based on licensing"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub licensing: Option<ExtensionLicensing>, - #[doc = "Version of the extension manifest format/content"] - #[serde( - rename = "manifestVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub manifest_version: Option<f64>, - #[doc = "Default user claims applied to all contributions (except the ones which have been specified restrictedTo explicitly) to control the visibility of a contribution."] - #[serde( - rename = "restrictedTo", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub restricted_to: Vec<String>, - #[doc = "List of all oauth scopes required by this extension"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub scopes: Vec<String>, - #[doc = "The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed"] - #[serde( - rename = "serviceInstanceType", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_instance_type: Option<String>, + #[doc = "Uri used as base for other relative uri's defined in extension"] + #[serde(rename = "baseUri", default, skip_serializing_if = "Option::is_none")] + pub base_uri: Option<String>, + #[doc = "List of shared constraints defined by this extension"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub constraints: Vec<ContributionConstraint>, + #[doc = "List of contributions made by this extension"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub contributions: Vec<Contribution>, + #[doc = "List of contribution types defined by this extension"] + #[serde( + rename = "contributionTypes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub contribution_types: Vec<ContributionType>, + #[doc = "List of explicit demands required by this extension"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub demands: Vec<String>, + #[doc = "Collection of event callbacks - endpoints called when particular extension events occur."] + #[serde( + rename = "eventCallbacks", + default, + skip_serializing_if = "Option::is_none" + )] + pub event_callbacks: Option<ExtensionEventCallbackCollection>, + #[doc = "Secondary location that can be used as base for other relative uri's defined in extension"] + #[serde( + rename = "fallbackBaseUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub fallback_base_uri: Option<String>, + #[doc = "Language Culture Name set by the Gallery"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub language: Option<String>, + #[doc = "How an extension should handle including contributions based on licensing"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub licensing: Option<ExtensionLicensing>, + #[doc = "Version of the extension manifest format/content"] + #[serde( + rename = "manifestVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub manifest_version: Option<f64>, + #[doc = "Default user claims applied to all contributions (except the ones which have been specified restrictedTo explicitly) to control the visibility of a contribution."] + #[serde( + rename = "restrictedTo", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub restricted_to: Vec<String>, + #[doc = "List of all oauth scopes required by this extension"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub scopes: Vec<String>, + #[doc = "The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed"] + #[serde( + rename = "serviceInstanceType", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_instance_type: Option<String>, } impl ExtensionManifest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Policy with a set of permissions on extension operations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionPolicy { - #[doc = "Permissions on 'Install' operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub install: Option<extension_policy::Install>, - #[doc = "Permission on 'Request' operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub request: Option<extension_policy::Request>, + #[doc = "Permissions on 'Install' operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub install: Option<extension_policy::Install>, + #[doc = "Permission on 'Request' operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request: Option<extension_policy::Request>, } impl ExtensionPolicy { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod extension_policy { - use super::*; - #[doc = "Permissions on 'Install' operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Install { - #[serde(rename = "none")] - None, - #[serde(rename = "private")] - Private, - #[serde(rename = "public")] - Public, - #[serde(rename = "preview")] - Preview, - #[serde(rename = "released")] - Released, - #[serde(rename = "firstParty")] - FirstParty, - #[serde(rename = "all")] - All, - } - #[doc = "Permission on 'Request' operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Request { - #[serde(rename = "none")] - None, - #[serde(rename = "private")] - Private, - #[serde(rename = "public")] - Public, - #[serde(rename = "preview")] - Preview, - #[serde(rename = "released")] - Released, - #[serde(rename = "firstParty")] - FirstParty, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "Permissions on 'Install' operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Install { + #[serde(rename = "none")] + None, + #[serde(rename = "private")] + Private, + #[serde(rename = "public")] + Public, + #[serde(rename = "preview")] + Preview, + #[serde(rename = "released")] + Released, + #[serde(rename = "firstParty")] + FirstParty, + #[serde(rename = "all")] + All, + } + #[doc = "Permission on 'Request' operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Request { + #[serde(rename = "none")] + None, + #[serde(rename = "private")] + Private, + #[serde(rename = "public")] + Public, + #[serde(rename = "preview")] + Preview, + #[serde(rename = "released")] + Released, + #[serde(rename = "firstParty")] + FirstParty, + #[serde(rename = "all")] + All, + } } #[doc = "A request for an extension (to be installed or have a license assigned)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionRequest { - #[doc = "Required message supplied if the request is rejected"] - #[serde( - rename = "rejectMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub reject_message: Option<String>, - #[doc = "Date at which the request was made"] - #[serde( - rename = "requestDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub request_date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "requestedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_by: Option<IdentityRef>, - #[doc = "Optional message supplied by the requester justifying the request"] - #[serde( - rename = "requestMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_message: Option<String>, - #[doc = "Represents the state of the request"] - #[serde( - rename = "requestState", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_state: Option<extension_request::RequestState>, - #[doc = "Date at which the request was resolved"] - #[serde( - rename = "resolveDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub resolve_date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "resolvedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolved_by: Option<IdentityRef>, + #[doc = "Required message supplied if the request is rejected"] + #[serde( + rename = "rejectMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub reject_message: Option<String>, + #[doc = "Date at which the request was made"] + #[serde( + rename = "requestDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub request_date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "requestedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_by: Option<IdentityRef>, + #[doc = "Optional message supplied by the requester justifying the request"] + #[serde( + rename = "requestMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_message: Option<String>, + #[doc = "Represents the state of the request"] + #[serde( + rename = "requestState", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_state: Option<extension_request::RequestState>, + #[doc = "Date at which the request was resolved"] + #[serde( + rename = "resolveDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub resolve_date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "resolvedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolved_by: Option<IdentityRef>, } impl ExtensionRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod extension_request { - use super::*; - #[doc = "Represents the state of the request"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum RequestState { - #[serde(rename = "open")] - Open, - #[serde(rename = "accepted")] - Accepted, - #[serde(rename = "rejected")] - Rejected, - } + use super::*; + #[doc = "Represents the state of the request"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum RequestState { + #[serde(rename = "open")] + Open, + #[serde(rename = "accepted")] + Accepted, + #[serde(rename = "rejected")] + Rejected, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionRequestEvent { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub extension: Option<PublishedExtension>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub host: Option<ExtensionHost>, - #[doc = "Name of the collection for which the extension was requested"] - #[serde(rename = "hostName", default, skip_serializing_if = "Option::is_none")] - pub host_name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<ExtensionRequestUrls>, - #[doc = "A request for an extension (to be installed or have a license assigned)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub request: Option<ExtensionRequest>, - #[doc = "The type of update that was made"] - #[serde( - rename = "updateType", - default, - skip_serializing_if = "Option::is_none" - )] - pub update_type: Option<extension_request_event::UpdateType>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub extension: Option<PublishedExtension>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub host: Option<ExtensionHost>, + #[doc = "Name of the collection for which the extension was requested"] + #[serde(rename = "hostName", default, skip_serializing_if = "Option::is_none")] + pub host_name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<ExtensionRequestUrls>, + #[doc = "A request for an extension (to be installed or have a license assigned)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request: Option<ExtensionRequest>, + #[doc = "The type of update that was made"] + #[serde( + rename = "updateType", + default, + skip_serializing_if = "Option::is_none" + )] + pub update_type: Option<extension_request_event::UpdateType>, } impl ExtensionRequestEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod extension_request_event { - use super::*; - #[doc = "The type of update that was made"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum UpdateType { - #[serde(rename = "created")] - Created, - #[serde(rename = "approved")] - Approved, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "deleted")] - Deleted, - } + use super::*; + #[doc = "The type of update that was made"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum UpdateType { + #[serde(rename = "created")] + Created, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "deleted")] + Deleted, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionRequestUrls { - #[serde(flatten)] - pub extension_urls: ExtensionUrls, - #[doc = "Link to view the extension request"] - #[serde( - rename = "requestPage", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_page: Option<String>, + #[serde(flatten)] + pub extension_urls: ExtensionUrls, + #[doc = "Link to view the extension request"] + #[serde( + rename = "requestPage", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_page: Option<String>, } impl ExtensionRequestUrls { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionRequestsEvent { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub extension: Option<PublishedExtension>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub host: Option<ExtensionHost>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<ExtensionRequestUrls>, - #[doc = "The extension request object"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub requests: Vec<ExtensionRequest>, - #[doc = "The type of update that was made"] - #[serde( - rename = "updateType", - default, - skip_serializing_if = "Option::is_none" - )] - pub update_type: Option<extension_requests_event::UpdateType>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub extension: Option<PublishedExtension>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub host: Option<ExtensionHost>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<ExtensionRequestUrls>, + #[doc = "The extension request object"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub requests: Vec<ExtensionRequest>, + #[doc = "The type of update that was made"] + #[serde( + rename = "updateType", + default, + skip_serializing_if = "Option::is_none" + )] + pub update_type: Option<extension_requests_event::UpdateType>, } impl ExtensionRequestsEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod extension_requests_event { - use super::*; - #[doc = "The type of update that was made"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum UpdateType { - #[serde(rename = "created")] - Created, - #[serde(rename = "approved")] - Approved, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "deleted")] - Deleted, - } + use super::*; + #[doc = "The type of update that was made"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum UpdateType { + #[serde(rename = "created")] + Created, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "deleted")] + Deleted, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionShare { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(rename = "isOrg", default, skip_serializing_if = "Option::is_none")] - pub is_org: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(rename = "isOrg", default, skip_serializing_if = "Option::is_none")] + pub is_org: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl ExtensionShare { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The state of an extension"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionState { - #[serde(flatten)] - pub installed_extension_state: InstalledExtensionState, - #[serde( - rename = "extensionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_name: Option<String>, - #[doc = "The time at which the version was last checked"] - #[serde( - rename = "lastVersionCheck", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_version_check: Option<time::OffsetDateTime>, - #[serde( - rename = "publisherName", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde(flatten)] + pub installed_extension_state: InstalledExtensionState, + #[serde( + rename = "extensionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_name: Option<String>, + #[doc = "The time at which the version was last checked"] + #[serde( + rename = "lastVersionCheck", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_version_check: Option<time::OffsetDateTime>, + #[serde( + rename = "publisherName", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl ExtensionState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionStatistic { - #[serde( - rename = "statisticName", - default, - skip_serializing_if = "Option::is_none" - )] - pub statistic_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<f64>, + #[serde( + rename = "statisticName", + default, + skip_serializing_if = "Option::is_none" + )] + pub statistic_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<f64>, } impl ExtensionStatistic { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionUrls { - #[doc = "Url of the extension icon"] - #[serde( - rename = "extensionIcon", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_icon: Option<String>, - #[doc = "Link to view the extension details page"] - #[serde( - rename = "extensionPage", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_page: Option<String>, + #[doc = "Url of the extension icon"] + #[serde( + rename = "extensionIcon", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_icon: Option<String>, + #[doc = "Link to view the extension details page"] + #[serde( + rename = "extensionPage", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_page: Option<String>, } impl ExtensionUrls { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionVersion { - #[serde(rename = "assetUri", default, skip_serializing_if = "Option::is_none")] - pub asset_uri: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub badges: Vec<ExtensionBadge>, - #[serde( - rename = "fallbackAssetUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub fallback_asset_uri: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub files: Vec<ExtensionFile>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub flags: Option<String>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub properties: Vec<serde_json::Value>, - #[serde( - rename = "targetPlatform", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_platform: Option<String>, - #[serde( - rename = "validationResultMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub validation_result_message: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, - #[serde( - rename = "versionDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_description: Option<String>, + #[serde(rename = "assetUri", default, skip_serializing_if = "Option::is_none")] + pub asset_uri: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub badges: Vec<ExtensionBadge>, + #[serde( + rename = "fallbackAssetUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub fallback_asset_uri: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub files: Vec<ExtensionFile>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub flags: Option<String>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub properties: Vec<serde_json::Value>, + #[serde( + rename = "targetPlatform", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_platform: Option<String>, + #[serde( + rename = "validationResultMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub validation_result_message: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, + #[serde( + rename = "versionDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_description: Option<String>, } impl ExtensionVersion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, + } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InstallationTarget { - #[serde( - rename = "extensionVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_version: Option<String>, - #[serde( - rename = "productArchitecture", - default, - skip_serializing_if = "Option::is_none" - )] - pub product_architecture: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<String>, - #[serde( - rename = "targetPlatform", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_platform: Option<String>, - #[serde( - rename = "targetVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_version: Option<String>, + #[serde( + rename = "productArchitecture", + default, + skip_serializing_if = "Option::is_none" + )] + pub product_architecture: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<String>, + #[serde( + rename = "targetVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_version: Option<String>, } impl InstallationTarget { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a VSTS extension along with its installation state"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InstalledExtension { - #[serde(flatten)] - pub extension_manifest: ExtensionManifest, - #[doc = "The friendly extension id for this extension - unique for a given publisher."] - #[serde( - rename = "extensionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_id: Option<String>, - #[doc = "The display name of the extension."] - #[serde( - rename = "extensionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_name: Option<String>, - #[doc = "This is the set of files available from the extension."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub files: Vec<ExtensionFile>, - #[doc = "Extension flags relevant to contribution consumers"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub flags: Option<String>, - #[doc = "The state of an installed extension"] - #[serde( - rename = "installState", - default, - skip_serializing_if = "Option::is_none" - )] - pub install_state: Option<InstalledExtensionState>, - #[doc = "This represents the date/time the extensions was last updated in the gallery. This doesnt mean this version was updated the value represents changes to any and all versions of the extension."] - #[serde( - rename = "lastPublished", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_published: Option<time::OffsetDateTime>, - #[doc = "Unique id of the publisher of this extension"] - #[serde( - rename = "publisherId", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_id: Option<String>, - #[doc = "The display name of the publisher"] - #[serde( - rename = "publisherName", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_name: Option<String>, - #[doc = "Unique id for this extension (the same id is used for all versions of a single extension)"] - #[serde( - rename = "registrationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub registration_id: Option<String>, - #[doc = "Version of this extension"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde(flatten)] + pub extension_manifest: ExtensionManifest, + #[doc = "The friendly extension id for this extension - unique for a given publisher."] + #[serde( + rename = "extensionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_id: Option<String>, + #[doc = "The display name of the extension."] + #[serde( + rename = "extensionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_name: Option<String>, + #[doc = "This is the set of files available from the extension."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub files: Vec<ExtensionFile>, + #[doc = "Extension flags relevant to contribution consumers"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub flags: Option<String>, + #[doc = "The state of an installed extension"] + #[serde( + rename = "installState", + default, + skip_serializing_if = "Option::is_none" + )] + pub install_state: Option<InstalledExtensionState>, + #[doc = "This represents the date/time the extensions was last updated in the gallery. This doesnt mean this version was updated the value represents changes to any and all versions of the extension."] + #[serde( + rename = "lastPublished", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_published: Option<time::OffsetDateTime>, + #[doc = "Unique id of the publisher of this extension"] + #[serde( + rename = "publisherId", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_id: Option<String>, + #[doc = "The display name of the publisher"] + #[serde( + rename = "publisherName", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_name: Option<String>, + #[doc = "Unique id for this extension (the same id is used for all versions of a single extension)"] + #[serde( + rename = "registrationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub registration_id: Option<String>, + #[doc = "Version of this extension"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl InstalledExtension { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InstalledExtensionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<InstalledExtension>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<InstalledExtension>, } impl InstalledExtensionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InstalledExtensionQuery { - #[serde( - rename = "assetTypes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub asset_types: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub monikers: Vec<ExtensionIdentifier>, + #[serde( + rename = "assetTypes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub asset_types: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub monikers: Vec<ExtensionIdentifier>, } impl InstalledExtensionQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The state of an installed extension"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InstalledExtensionState { - #[doc = "States of an installed extension"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub flags: Option<String>, - #[doc = "List of installation issues"] - #[serde( - rename = "installationIssues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub installation_issues: Vec<InstalledExtensionStateIssue>, - #[doc = "The time at which this installation was last updated"] - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, + #[doc = "States of an installed extension"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub flags: Option<String>, + #[doc = "List of installation issues"] + #[serde( + rename = "installationIssues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub installation_issues: Vec<InstalledExtensionStateIssue>, + #[doc = "The time at which this installation was last updated"] + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, } impl InstalledExtensionState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an installation issue"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InstalledExtensionStateIssue { - #[doc = "The error message"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "Source of the installation issue, for example \"Demands\""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<String>, - #[doc = "Installation issue type (Warning, Error)"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<installed_extension_state_issue::Type>, + #[doc = "The error message"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "Source of the installation issue, for example \"Demands\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<String>, + #[doc = "Installation issue type (Warning, Error)"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<installed_extension_state_issue::Type>, } impl InstalledExtensionStateIssue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod installed_extension_state_issue { - use super::*; - #[doc = "Installation issue type (Warning, Error)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - } + use super::*; + #[doc = "Installation issue type (Warning, Error)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + } } #[doc = "Represents a JSON object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JObject { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<String>, - #[doc = "Gets the node type for this JToken."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<String>, + #[doc = "Gets the node type for this JToken."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl JObject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Maps a contribution to a licensing behavior"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LicensingOverride { - #[doc = "How the inclusion of this contribution should change based on licensing"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub behavior: Option<licensing_override::Behavior>, - #[doc = "Fully qualified contribution id which we want to define licensing behavior for"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[doc = "How the inclusion of this contribution should change based on licensing"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub behavior: Option<licensing_override::Behavior>, + #[doc = "Fully qualified contribution id which we want to define licensing behavior for"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl LicensingOverride { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod licensing_override { - use super::*; - #[doc = "How the inclusion of this contribution should change based on licensing"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Behavior { - #[serde(rename = "onlyIfLicensed")] - OnlyIfLicensed, - #[serde(rename = "onlyIfUnlicensed")] - OnlyIfUnlicensed, - #[serde(rename = "alwaysInclude")] - AlwaysInclude, - } + use super::*; + #[doc = "How the inclusion of this contribution should change based on licensing"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Behavior { + #[serde(rename = "onlyIfLicensed")] + OnlyIfLicensed, + #[serde(rename = "onlyIfUnlicensed")] + OnlyIfUnlicensed, + #[serde(rename = "alwaysInclude")] + AlwaysInclude, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PublishedExtension { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub categories: Vec<String>, - #[serde( - rename = "deploymentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub deployment_type: Option<published_extension::DeploymentType>, - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde( - rename = "extensionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_id: Option<String>, - #[serde( - rename = "extensionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub flags: Option<String>, - #[serde( - rename = "installationTargets", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub installation_targets: Vec<InstallationTarget>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde( - rename = "longDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub long_description: Option<String>, - #[doc = "Check if Extension is in conflict list or not. Taking as String and not as boolean because we don't want end customer to see this flag and by making it Boolean it is coming as false for all the cases."] - #[serde( - rename = "presentInConflictList", - default, - skip_serializing_if = "Option::is_none" - )] - pub present_in_conflict_list: Option<String>, - #[doc = "Date on which the extension was first uploaded."] - #[serde( - rename = "publishedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub published_date: Option<time::OffsetDateTime>, - #[doc = "High-level information about the publisher, like id's and names"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub publisher: Option<PublisherFacts>, - #[doc = "Date on which the extension first went public."] - #[serde( - rename = "releaseDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub release_date: Option<time::OffsetDateTime>, - #[serde( - rename = "sharedWith", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub shared_with: Vec<ExtensionShare>, - #[serde( - rename = "shortDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub short_description: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub statistics: Vec<ExtensionStatistic>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub versions: Vec<ExtensionVersion>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub categories: Vec<String>, + #[serde( + rename = "deploymentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub deployment_type: Option<published_extension::DeploymentType>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde( + rename = "extensionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_id: Option<String>, + #[serde( + rename = "extensionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub flags: Option<String>, + #[serde( + rename = "installationTargets", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub installation_targets: Vec<InstallationTarget>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde( + rename = "longDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub long_description: Option<String>, + #[doc = "Date on which the extension was first uploaded."] + #[serde( + rename = "publishedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub published_date: Option<time::OffsetDateTime>, + #[doc = "High-level information about the publisher, like id's and names"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub publisher: Option<PublisherFacts>, + #[doc = "Date on which the extension first went public."] + #[serde( + rename = "releaseDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub release_date: Option<time::OffsetDateTime>, + #[serde( + rename = "sharedWith", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub shared_with: Vec<ExtensionShare>, + #[serde( + rename = "shortDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub short_description: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub statistics: Vec<ExtensionStatistic>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub versions: Vec<ExtensionVersion>, } impl PublishedExtension { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod published_extension { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DeploymentType { - #[serde(rename = "exe")] - Exe, - #[serde(rename = "msi")] - Msi, - #[serde(rename = "vsix")] - Vsix, - #[serde(rename = "referralLink")] - ReferralLink, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DeploymentType { + #[serde(rename = "exe")] + Exe, + #[serde(rename = "msi")] + Msi, + #[serde(rename = "vsix")] + Vsix, + #[serde(rename = "referralLink")] + ReferralLink, + } } #[doc = "High-level information about the publisher, like id's and names"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PublisherFacts { - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub domain: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub flags: Option<String>, - #[serde( - rename = "isDomainVerified", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_domain_verified: Option<bool>, - #[serde( - rename = "publisherId", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_id: Option<String>, - #[serde( - rename = "publisherName", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_name: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub domain: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub flags: Option<String>, + #[serde( + rename = "isDomainVerified", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_domain_verified: Option<bool>, + #[serde( + rename = "publisherId", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_id: Option<String>, + #[serde( + rename = "publisherName", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_name: Option<String>, } impl PublisherFacts { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A request for an extension (to be installed or have a license assigned)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RequestedExtension { - #[doc = "The unique name of the extension"] - #[serde( - rename = "extensionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_name: Option<String>, - #[doc = "A list of each request for the extension"] - #[serde( - rename = "extensionRequests", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub extension_requests: Vec<ExtensionRequest>, - #[doc = "DisplayName of the publisher that owns the extension being published."] - #[serde( - rename = "publisherDisplayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_display_name: Option<String>, - #[doc = "Represents the Publisher of the requested extension"] - #[serde( - rename = "publisherName", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_name: Option<String>, - #[doc = "The total number of requests for an extension"] - #[serde( - rename = "requestCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_count: Option<i32>, + #[doc = "The unique name of the extension"] + #[serde( + rename = "extensionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_name: Option<String>, + #[doc = "A list of each request for the extension"] + #[serde( + rename = "extensionRequests", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub extension_requests: Vec<ExtensionRequest>, + #[doc = "DisplayName of the publisher that owns the extension being published."] + #[serde( + rename = "publisherDisplayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_display_name: Option<String>, + #[doc = "Represents the Publisher of the requested extension"] + #[serde( + rename = "publisherName", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_name: Option<String>, + #[doc = "The total number of requests for an extension"] + #[serde( + rename = "requestCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_count: Option<i32>, } impl RequestedExtension { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Entry for a specific data provider's resulting data"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResolvedDataProvider { - #[doc = "The total time the data provider took to resolve its data (in milliseconds)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<f32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[doc = "The total time the data provider took to resolve its data (in milliseconds)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<f32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl ResolvedDataProvider { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Scope { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl Scope { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Information about the extension"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SupportedExtension { - #[doc = "Unique Identifier for this extension"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub extension: Option<String>, - #[doc = "Unique Identifier for this publisher"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub publisher: Option<String>, - #[doc = "Supported version for this extension"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Unique Identifier for this extension"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub extension: Option<String>, + #[doc = "Unique Identifier for this publisher"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub publisher: Option<String>, + #[doc = "Supported version for this extension"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl SupportedExtension { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the extension policy applied to a given user"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserExtensionPolicy { - #[doc = "User display name that this policy refers to"] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Policy with a set of permissions on extension operations"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub permissions: Option<ExtensionPolicy>, - #[doc = "User id that this policy refers to"] - #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] - pub user_id: Option<String>, + #[doc = "User display name that this policy refers to"] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Policy with a set of permissions on extension operations"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub permissions: Option<ExtensionPolicy>, + #[doc = "User id that this policy refers to"] + #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] + pub user_id: Option<String>, } impl UserExtensionPolicy { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/favorite/mod.rs b/azure_devops_rust_api/src/favorite/mod.rs index 250bd16e..52b1621a 100644 --- a/azure_devops_rust_api/src/favorite/mod.rs +++ b/azure_devops_rust_api/src/favorite/mod.rs @@ -9,1411 +9,1449 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + pub fn favorites_client(&self) -> favorites::Client { + favorites::Client(self.clone()) + } +} +pub mod favorites { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get_favorites_of_owner( + &self, + organization: impl Into<String>, + owner_scope_type: impl Into<String>, + owner_scope_id: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn create_favorite_of_owner( + &self, + organization: impl Into<String>, + body: impl Into<models::FavoriteCreateParameters>, + owner_scope_type: impl Into<String>, + owner_scope_id: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get_favorite_by_artifact( + &self, + organization: impl Into<String>, + artifact_type: impl Into<String>, + artifact_id: impl Into<String>, + artifact_scope_type: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn delete_favorite_of_owner_by_id( + &self, + organization: impl Into<String>, + favorite_id: impl Into<String>, + owner_scope_type: impl Into<String>, + owner_scope_id: impl Into<String>, + artifact_type: impl Into<String>, + artifact_scope_type: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get_favorite_of_owner_by_id( + &self, + organization: impl Into<String>, + favorite_id: impl Into<String>, + owner_scope_type: impl Into<String>, + owner_scope_id: impl Into<String>, + artifact_scope_type: impl Into<String>, + artifact_type: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get_favorites(&self, organization: impl Into<String>) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn create_favorite( + &self, + organization: impl Into<String>, + body: impl Into<models::FavoriteCreateParameters>, + ) -> create_favorite::RequestBuilder { + create_favorite::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get_favorite_by_id( + &self, + organization: impl Into<String>, + favorite_id: impl Into<String>, + artifact_scope_type: impl Into<String>, + artifact_type: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn delete_favorite_by_id( + &self, + organization: impl Into<String>, + favorite_id: impl Into<String>, + artifact_type: impl Into<String>, + artifact_scope_type: impl Into<String>, + ) -> 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, + } + } + } + pub mod get_favorites_of_owner { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FavoriteList> { + let bytes = self.0.into_body().collect().await?; + let body: models::FavoriteList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) owner_scope_type: String, + pub(crate) owner_scope_id: String, + pub(crate) artifact_type: Option<String>, + pub(crate) artifact_scope_type: Option<String>, + pub(crate) artifact_scope_id: Option<String>, + pub(crate) include_extended_details: Option<bool>, + } + impl RequestBuilder { + pub fn artifact_type(mut self, artifact_type: impl Into<String>) -> Self { + self.artifact_type = Some(artifact_type.into()); + self + } + pub fn artifact_scope_type(mut self, artifact_scope_type: impl Into<String>) -> Self { + self.artifact_scope_type = Some(artifact_scope_type.into()); + self + } + pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { + self.artifact_scope_id = Some(artifact_scope_id.into()); + self + } + pub fn include_extended_details(mut self, include_extended_details: bool) -> Self { + self.include_extended_details = Some(include_extended_details); 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/favorite/favorites?ownerScopeType={}&ownerScopeId={}", + this.client.endpoint(), + &this.organization, + &this.owner_scope_type, + &this.owner_scope_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FavoriteList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::FavoriteList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_favorite_of_owner { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Favorite> { + let bytes = self.0.into_body().collect().await?; + let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::FavoriteCreateParameters, + pub(crate) owner_scope_type: String, + pub(crate) owner_scope_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/favorite/favorites?ownerScopeType={}&ownerScopeId={}", + this.client.endpoint(), + &this.organization, + &this.owner_scope_type, + &this.owner_scope_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Favorite>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Favorite>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_favorite_by_artifact { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Favorite> { + let bytes = self.0.into_body().collect().await?; + let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) artifact_type: String, + pub(crate) artifact_id: String, + pub(crate) artifact_scope_type: String, + pub(crate) artifact_scope_id: Option<String>, + pub(crate) include_extended_details: Option<bool>, + } + impl RequestBuilder { + pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { + self.artifact_scope_id = Some(artifact_scope_id.into()); + self + } + pub fn include_extended_details(mut self, include_extended_details: bool) -> Self { + self.include_extended_details = Some(include_extended_details); 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/favorite/favorites?artifactType={}&artifactId={}&artifactScopeType={}", + this.client.endpoint(), + &this.organization, + &this.artifact_type, + &this.artifact_id, + &this.artifact_scope_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Favorite>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Favorite>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_favorite_of_owner_by_id { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) favorite_id: String, + pub(crate) owner_scope_type: String, + pub(crate) owner_scope_id: String, + pub(crate) artifact_type: String, + pub(crate) artifact_scope_type: String, + pub(crate) artifact_scope_id: Option<String>, + } + impl RequestBuilder { + pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { + self.artifact_scope_id = Some(artifact_scope_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/favorite/favorites/{}?ownerScopeType={}&ownerScopeId={}&artifactType={}&artifactScopeType={}" , this . client . endpoint () , & this . organization , & this . favorite_id , & this . owner_scope_type , & this . owner_scope_id , & this . artifact_type , & this . artifact_scope_type)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() + } + pub mod get_favorite_of_owner_by_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Favorite> { + let bytes = self.0.into_body().collect().await?; + let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) favorite_id: String, + pub(crate) owner_scope_type: String, + pub(crate) owner_scope_id: String, + pub(crate) artifact_scope_type: String, + pub(crate) artifact_type: String, + pub(crate) artifact_scope_id: Option<String>, + pub(crate) include_extended_details: Option<bool>, } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) + impl RequestBuilder { + pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { + self.artifact_scope_id = Some(artifact_scope_id.into()); + self + } + pub fn include_extended_details(mut self, include_extended_details: bool) -> Self { + self.include_extended_details = Some(include_extended_details); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/favorite/favorites/{}?ownerScopeType={}&ownerScopeId={}&artifactScopeType={}&artifactType={}" , this . client . endpoint () , & this . organization , & this . favorite_id , & this . owner_scope_type , & this . owner_scope_id , & this . artifact_scope_type , & this . artifact_type)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Favorite>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Favorite>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - pub fn favorites_client(&self) -> favorites::Client { - favorites::Client(self.clone()) + } + pub mod get_favorites { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FavoriteList> { + let bytes = self.0.into_body().collect().await?; + let body: models::FavoriteList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod favorites { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) artifact_type: Option<String>, + pub(crate) artifact_scope_type: Option<String>, + pub(crate) artifact_scope_id: Option<String>, + pub(crate) include_extended_details: Option<bool>, + } + impl RequestBuilder { + pub fn artifact_type(mut self, artifact_type: impl Into<String>) -> Self { + self.artifact_type = Some(artifact_type.into()); + self + } + pub fn artifact_scope_type(mut self, artifact_scope_type: impl Into<String>) -> Self { + self.artifact_scope_type = Some(artifact_scope_type.into()); + self + } + pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { + self.artifact_scope_id = Some(artifact_scope_id.into()); + self + } + pub fn include_extended_details(mut self, include_extended_details: bool) -> Self { + self.include_extended_details = Some(include_extended_details); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/favorite/favorites", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FavoriteList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::FavoriteList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_favorite { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get_favorites_of_owner( - &self, - organization: impl Into<String>, - owner_scope_type: impl Into<String>, - owner_scope_id: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn create_favorite_of_owner( - &self, - organization: impl Into<String>, - body: impl Into<models::FavoriteCreateParameters>, - owner_scope_type: impl Into<String>, - owner_scope_id: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get_favorite_by_artifact( - &self, - organization: impl Into<String>, - artifact_type: impl Into<String>, - artifact_id: impl Into<String>, - artifact_scope_type: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn delete_favorite_of_owner_by_id( - &self, - organization: impl Into<String>, - favorite_id: impl Into<String>, - owner_scope_type: impl Into<String>, - owner_scope_id: impl Into<String>, - artifact_type: impl Into<String>, - artifact_scope_type: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get_favorite_of_owner_by_id( - &self, - organization: impl Into<String>, - favorite_id: impl Into<String>, - owner_scope_type: impl Into<String>, - owner_scope_id: impl Into<String>, - artifact_scope_type: impl Into<String>, - artifact_type: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get_favorites( - &self, - organization: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn create_favorite( - &self, - organization: impl Into<String>, - body: impl Into<models::FavoriteCreateParameters>, - ) -> create_favorite::RequestBuilder { - create_favorite::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get_favorite_by_id( - &self, - organization: impl Into<String>, - favorite_id: impl Into<String>, - artifact_scope_type: impl Into<String>, - artifact_type: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn delete_favorite_by_id( - &self, - organization: impl Into<String>, - favorite_id: impl Into<String>, - artifact_type: impl Into<String>, - artifact_scope_type: impl Into<String>, - ) -> 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, - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Favorite> { + let bytes = self.0.into_body().collect().await?; + let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub mod get_favorites_of_owner { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FavoriteList> { - let bytes = self.0.into_body().collect().await?; - let body: models::FavoriteList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) owner_scope_type: String, - pub(crate) owner_scope_id: String, - pub(crate) artifact_type: Option<String>, - pub(crate) artifact_scope_type: Option<String>, - pub(crate) artifact_scope_id: Option<String>, - pub(crate) include_extended_details: Option<bool>, - } - impl RequestBuilder { - pub fn artifact_type(mut self, artifact_type: impl Into<String>) -> Self { - self.artifact_type = Some(artifact_type.into()); - self - } - pub fn artifact_scope_type(mut self, artifact_scope_type: impl Into<String>) -> Self { - self.artifact_scope_type = Some(artifact_scope_type.into()); - self - } - pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { - self.artifact_scope_id = Some(artifact_scope_id.into()); - self - } - pub fn include_extended_details(mut self, include_extended_details: bool) -> Self { - self.include_extended_details = Some(include_extended_details); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/favorite/favorites?ownerScopeType={}&ownerScopeId={}", - this.client.endpoint(), - &this.organization, - &this.owner_scope_type, - &this.owner_scope_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FavoriteList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FavoriteList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub mod create_favorite_of_owner { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Favorite> { - let bytes = self.0.into_body().collect().await?; - let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::FavoriteCreateParameters, - pub(crate) owner_scope_type: String, - pub(crate) owner_scope_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/favorite/favorites?ownerScopeType={}&ownerScopeId={}", - this.client.endpoint(), - &this.organization, - &this.owner_scope_type, - &this.owner_scope_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Favorite>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Favorite>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub mod get_favorite_by_artifact { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Favorite> { - let bytes = self.0.into_body().collect().await?; - let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) artifact_type: String, - pub(crate) artifact_id: String, - pub(crate) artifact_scope_type: String, - pub(crate) artifact_scope_id: Option<String>, - pub(crate) include_extended_details: Option<bool>, - } - impl RequestBuilder { - pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { - self.artifact_scope_id = Some(artifact_scope_id.into()); - self - } - pub fn include_extended_details(mut self, include_extended_details: bool) -> Self { - self.include_extended_details = Some(include_extended_details); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/favorite/favorites?artifactType={}&artifactId={}&artifactScopeType={}" , this . client . endpoint () , & this . organization , & this . artifact_type , & this . artifact_id , & this . artifact_scope_type)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Favorite>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Favorite>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::FavoriteCreateParameters, } - pub mod delete_favorite_of_owner_by_id { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) favorite_id: String, - pub(crate) owner_scope_type: String, - pub(crate) owner_scope_id: String, - pub(crate) artifact_type: String, - pub(crate) artifact_scope_type: String, - pub(crate) artifact_scope_id: Option<String>, - } - impl RequestBuilder { - pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { - self.artifact_scope_id = Some(artifact_scope_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/favorite/favorites/{}?ownerScopeType={}&ownerScopeId={}&artifactType={}&artifactScopeType={}" , this . client . endpoint () , & this . organization , & this . favorite_id , & this . owner_scope_type , & this . owner_scope_id , & this . artifact_type , & this . artifact_scope_type)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/favorite/favorites", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub mod get_favorite_of_owner_by_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Favorite> { - let bytes = self.0.into_body().collect().await?; - let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) favorite_id: String, - pub(crate) owner_scope_type: String, - pub(crate) owner_scope_id: String, - pub(crate) artifact_scope_type: String, - pub(crate) artifact_type: String, - pub(crate) artifact_scope_id: Option<String>, - pub(crate) include_extended_details: Option<bool>, - } - impl RequestBuilder { - pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { - self.artifact_scope_id = Some(artifact_scope_id.into()); - self - } - pub fn include_extended_details(mut self, include_extended_details: bool) -> Self { - self.include_extended_details = Some(include_extended_details); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/favorite/favorites/{}?ownerScopeType={}&ownerScopeId={}&artifactScopeType={}&artifactType={}" , this . client . endpoint () , & this . organization , & this . favorite_id , & this . owner_scope_type , & this . owner_scope_id , & this . artifact_scope_type , & this . artifact_type)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Favorite>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Favorite>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Favorite>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Favorite>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - pub mod get_favorites { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FavoriteList> { - let bytes = self.0.into_body().collect().await?; - let body: models::FavoriteList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) artifact_type: Option<String>, - pub(crate) artifact_scope_type: Option<String>, - pub(crate) artifact_scope_id: Option<String>, - pub(crate) include_extended_details: Option<bool>, - } - impl RequestBuilder { - pub fn artifact_type(mut self, artifact_type: impl Into<String>) -> Self { - self.artifact_type = Some(artifact_type.into()); - self - } - pub fn artifact_scope_type(mut self, artifact_scope_type: impl Into<String>) -> Self { - self.artifact_scope_type = Some(artifact_scope_type.into()); - self - } - pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { - self.artifact_scope_id = Some(artifact_scope_id.into()); - self - } - pub fn include_extended_details(mut self, include_extended_details: bool) -> Self { - self.include_extended_details = Some(include_extended_details); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/favorite/favorites", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FavoriteList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FavoriteList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + } + pub mod get_favorite_by_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Favorite> { + let bytes = self.0.into_body().collect().await?; + let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub mod create_favorite { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Favorite> { - let bytes = self.0.into_body().collect().await?; - let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::FavoriteCreateParameters, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/favorite/favorites", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Favorite>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Favorite>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub mod get_favorite_by_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Favorite> { - let bytes = self.0.into_body().collect().await?; - let body: models::Favorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) favorite_id: String, - pub(crate) artifact_scope_type: String, - pub(crate) artifact_type: String, - pub(crate) artifact_scope_id: Option<String>, - pub(crate) include_extended_details: Option<bool>, - } - impl RequestBuilder { - pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { - self.artifact_scope_id = Some(artifact_scope_id.into()); - self - } - pub fn include_extended_details(mut self, include_extended_details: bool) -> Self { - self.include_extended_details = Some(include_extended_details); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/favorite/favorites/{}", - this.client.endpoint(), - &this.organization, - &this.favorite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Favorite>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Favorite>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub mod delete_favorite_by_id { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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<String>, - } - impl RequestBuilder { - pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { - self.artifact_scope_id = Some(artifact_scope_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/favorite/favorites/{}", - this.client.endpoint(), - &this.organization, - &this.favorite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) favorite_id: String, + pub(crate) artifact_scope_type: String, + pub(crate) artifact_type: String, + pub(crate) artifact_scope_id: Option<String>, + pub(crate) include_extended_details: Option<bool>, + } + impl RequestBuilder { + pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { + self.artifact_scope_id = Some(artifact_scope_id.into()); + self + } + pub fn include_extended_details(mut self, include_extended_details: bool) -> Self { + self.include_extended_details = Some(include_extended_details); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/favorite/favorites/{}", + this.client.endpoint(), + &this.organization, + &this.favorite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Favorite>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Favorite>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_favorite_by_id { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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<String>, + } + impl RequestBuilder { + pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into<String>) -> Self { + self.artifact_scope_id = Some(artifact_scope_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/favorite/favorites/{}", + this.client.endpoint(), + &this.organization, + &this.favorite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } diff --git a/azure_devops_rust_api/src/favorite/models.rs b/azure_devops_rust_api/src/favorite/models.rs index a707d603..12ee484b 100644 --- a/azure_devops_rust_api/src/favorite/models.rs +++ b/azure_devops_rust_api/src/favorite/models.rs @@ -9,363 +9,363 @@ use std::str::FromStr; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactProperties {} impl ArtifactProperties { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes the scope a favorited Artifact resides in. e.g. A team project."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactScope { - #[doc = "The identifier of the scope the artifact resides in. For a TFS Project, this refers to the Project GUID string. For a Collection, marked this property with an empty string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the artifact scope (e.g. Project Name) Note: This property is a read-only extension over the stored favorite model. This value cannot be overridden on writes."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Type of scope the favorite artifact resides in. Known scopes include \"Project\" or \"Collection\""] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "The identifier of the scope the artifact resides in. For a TFS Project, this refers to the Project GUID string. For a Collection, marked this property with an empty string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the artifact scope (e.g. Project Name) Note: This property is a read-only extension over the stored favorite model. This value cannot be overridden on writes."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Type of scope the favorite artifact resides in. Known scopes include \"Project\" or \"Collection\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl ArtifactScope { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Implementation of Favorite contract following modern storage"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Favorite { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "ID of the favorited artifact, unique in context of this artifact type."] - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<String>, - #[doc = "Indicates if the artifact described by this favorite could not be located."] - #[serde( - rename = "artifactIsDeleted", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_is_deleted: Option<bool>, - #[doc = "Last known name of the artifact."] - #[serde( - rename = "artifactName", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_name: Option<String>, - #[doc = ""] - #[serde( - rename = "artifactProperties", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_properties: Option<ArtifactProperties>, - #[doc = "Describes the scope a favorited Artifact resides in. e.g. A team project."] - #[serde( - rename = "artifactScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_scope: Option<ArtifactScope>, - #[doc = "Type of artifact."] - #[serde( - rename = "artifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type: Option<String>, - #[doc = "Date and time this Favorite was created on server."] - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[doc = "Unique Id of the favorite item, defined by server at creation time."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Fully-Qualified link to this Resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "ID of the favorited artifact, unique in context of this artifact type."] + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<String>, + #[doc = "Indicates if the artifact described by this favorite could not be located."] + #[serde( + rename = "artifactIsDeleted", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_is_deleted: Option<bool>, + #[doc = "Last known name of the artifact."] + #[serde( + rename = "artifactName", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_name: Option<String>, + #[doc = ""] + #[serde( + rename = "artifactProperties", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_properties: Option<ArtifactProperties>, + #[doc = "Describes the scope a favorited Artifact resides in. e.g. A team project."] + #[serde( + rename = "artifactScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_scope: Option<ArtifactScope>, + #[doc = "Type of artifact."] + #[serde( + rename = "artifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type: Option<String>, + #[doc = "Date and time this Favorite was created on server."] + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[doc = "Unique Id of the favorite item, defined by server at creation time."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Fully-Qualified link to this Resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Favorite { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FavoriteCreateParameters { - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<String>, - #[serde( - rename = "artifactName", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_name: Option<String>, - #[doc = ""] - #[serde( - rename = "artifactProperties", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_properties: Option<ArtifactProperties>, - #[doc = "Describes the scope a favorited Artifact resides in. e.g. A team project."] - #[serde( - rename = "artifactScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_scope: Option<ArtifactScope>, - #[serde( - rename = "artifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type: Option<String>, + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<String>, + #[serde( + rename = "artifactName", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_name: Option<String>, + #[doc = ""] + #[serde( + rename = "artifactProperties", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_properties: Option<ArtifactProperties>, + #[doc = "Describes the scope a favorited Artifact resides in. e.g. A team project."] + #[serde( + rename = "artifactScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_scope: Option<ArtifactScope>, + #[serde( + rename = "artifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type: Option<String>, } impl FavoriteCreateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FavoriteList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Favorite>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Favorite>, } impl FavoriteList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Exposes a provider of favorites."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FavoriteProvider { - #[serde(flatten)] - pub favorites_secured_object: FavoritesSecuredObject, - #[doc = "Favorite artifact type"] - #[serde( - rename = "artifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type: Option<String>, - #[doc = "URI for retrieving favorite artifacts"] - #[serde( - rename = "artifactUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_uri: Option<String>, - #[doc = "contributed client side service that is available for this provider to provide dynamic associated data."] - #[serde( - rename = "clientServiceIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub client_service_identifier: Option<String>, - #[doc = "Contribution Id"] - #[serde( - rename = "contributionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub contribution_id: Option<String>, - #[doc = "Css class to be applied to the icon for the artifact."] - #[serde(rename = "iconClass", default, skip_serializing_if = "Option::is_none")] - pub icon_class: Option<String>, - #[doc = "Name of the fabric icon to be applied for the artifact"] - #[serde(rename = "iconName", default, skip_serializing_if = "Option::is_none")] - pub icon_name: Option<String>, - #[doc = "Group of favorites will be rendered in this order, 0 is top If 2 types share order, they will be coalesced into a single group"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, - #[doc = "Name used for rendering the title of each group of favorites"] - #[serde( - rename = "pluralName", - default, - skip_serializing_if = "Option::is_none" - )] - pub plural_name: Option<String>, - #[doc = "Service identifier of the service."] - #[serde( - rename = "serviceIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_identifier: Option<String>, - #[doc = "Base URI of the service"] - #[serde( - rename = "serviceUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_uri: Option<String>, + #[serde(flatten)] + pub favorites_secured_object: FavoritesSecuredObject, + #[doc = "Favorite artifact type"] + #[serde( + rename = "artifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type: Option<String>, + #[doc = "URI for retrieving favorite artifacts"] + #[serde( + rename = "artifactUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_uri: Option<String>, + #[doc = "contributed client side service that is available for this provider to provide dynamic associated data."] + #[serde( + rename = "clientServiceIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub client_service_identifier: Option<String>, + #[doc = "Contribution Id"] + #[serde( + rename = "contributionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub contribution_id: Option<String>, + #[doc = "Css class to be applied to the icon for the artifact."] + #[serde(rename = "iconClass", default, skip_serializing_if = "Option::is_none")] + pub icon_class: Option<String>, + #[doc = "Name of the fabric icon to be applied for the artifact"] + #[serde(rename = "iconName", default, skip_serializing_if = "Option::is_none")] + pub icon_name: Option<String>, + #[doc = "Group of favorites will be rendered in this order, 0 is top If 2 types share order, they will be coalesced into a single group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, + #[doc = "Name used for rendering the title of each group of favorites"] + #[serde( + rename = "pluralName", + default, + skip_serializing_if = "Option::is_none" + )] + pub plural_name: Option<String>, + #[doc = "Service identifier of the service."] + #[serde( + rename = "serviceIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_identifier: Option<String>, + #[doc = "Base URI of the service"] + #[serde( + rename = "serviceUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_uri: Option<String>, } impl FavoriteProvider { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FavoritesSecuredObject { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub token: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option<String>, } impl FavoritesSecuredObject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, } + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This class is used to serialize collections as a single JSON object on the wire."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[doc = "The serialized item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[doc = "The number of serialized items."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/git/mod.rs b/azure_devops_rust_api/src/git/mod.rs index 4ac48c3d..2ec8655b 100644 --- a/azure_devops_rust_api/src/git/mod.rs +++ b/azure_devops_rust_api/src/git/mod.rs @@ -9,16939 +9,16989 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + 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()) + } +} +pub mod repositories { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve a git repository."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `include_parent`: Set to true to include parent repository. Only available in authenticated calls."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_repository_with_parent( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + include_parent: bool, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_deleted_repositories( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_recycle_bin_repositories( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_id`: The ID of the repository."] + pub fn restore_repository_from_recycle_bin( + &self, + organization: impl Into<String>, + body: impl Into<models::GitRecycleBinRepositoryDetails>, + project: impl Into<String>, + repository_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_id`: The ID of the repository."] + pub fn delete_repository_from_recycle_bin( + &self, + organization: impl Into<String>, + project: impl Into<String>, + repository_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Specify the repo name, team project and/or parent repository. Team project information can be omitted from gitRepositoryToCreate if the request is project-scoped (i.e., includes project Id)."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GitRepositoryCreateOptions>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_repository( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Specify a new repo name or a new default branch of the repository"] + #[doc = "* `repository_id`: The ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::GitRepository>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + } + } + } + pub mod get_repository_with_parent { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRepository> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) include_parent: bool, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}?includeParent={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.include_parent + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let include_parent = &this.include_parent; + req + .url_mut() + .query_pairs_mut() + .append_pair("includeParent", &include_parent.to_string()); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRepository>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitRepository>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_deleted_repositories { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitDeletedRepositoryList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitDeletedRepositoryList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/deletedrepositories", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitDeletedRepositoryList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitDeletedRepositoryList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_recycle_bin_repositories { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitDeletedRepositoryList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitDeletedRepositoryList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/recycleBin/repositories", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitDeletedRepositoryList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitDeletedRepositoryList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod restore_repository_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRepository> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GitRecycleBinRepositoryDetails, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/recycleBin/repositories/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRepository>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitRepository>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_repository_from_recycle_bin { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/recycleBin/repositories/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRepositoryList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRepositoryList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) include_links: Option<bool>, + pub(crate) include_all_urls: Option<bool>, + pub(crate) include_hidden: Option<bool>, + } + 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); + self + } + #[doc = "(optional) Set to true to include all remote URLs. The default value is false."] + pub fn include_all_urls(mut self, include_all_urls: bool) -> Self { + self.include_all_urls = Some(include_all_urls); + self + } + #[doc = "(optional) Set to true to include hidden repositories. The default value is false."] + pub fn include_hidden(mut self, include_hidden: bool) -> Self { + self.include_hidden = Some(include_hidden); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRepositoryList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitRepositoryList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRepository> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GitRepositoryCreateOptions, + pub(crate) project: String, + pub(crate) source_ref: Option<String>, + } + 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<String>) -> Self { + self.source_ref = Some(source_ref.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRepository>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitRepository>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_repository { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRepository> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRepository>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitRepository>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRepository> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GitRepository, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRepository>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitRepository>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod commits { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The id or friendly name of the repository. To use the friendly name, projectId must also be specified."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_commits( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The id or friendly name of the repository. To use the friendly name, projectId must also be specified."] + #[doc = "* `push_id`: The id of the push."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_push_commits( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + push_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `commit_id`: The id of the commit."] + #[doc = "* `repository_id`: The id or friendly name of the repository. To use the friendly name, projectId must also be specified."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + commit_id: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `commit_id`: The id of the commit."] + #[doc = "* `repository_id`: The id or friendly name of the repository. To use the friendly name, projectId must also be specified."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_changes( + &self, + organization: impl Into<String>, + commit_id: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Search options"] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_commits_batch( + &self, + organization: impl Into<String>, + body: impl Into<models::GitQueryCommitsCriteria>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get_commits { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitCommitRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitCommitRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) search_criteria_skip: Option<i32>, + pub(crate) search_criteria_top: Option<i32>, + pub(crate) search_criteria_author: Option<String>, + pub(crate) search_criteria_compare_version_version: Option<String>, + pub(crate) search_criteria_compare_version_version_options: Option<String>, + pub(crate) search_criteria_compare_version_version_type: Option<String>, + pub(crate) search_criteria_exclude_deletes: Option<bool>, + pub(crate) search_criteria_from_commit_id: Option<String>, + pub(crate) search_criteria_from_date: Option<String>, + pub(crate) search_criteria_history_mode: Option<String>, + pub(crate) search_criteria_ids: Vec<String>, + pub(crate) search_criteria_include_links: Option<bool>, + pub(crate) search_criteria_include_push_data: Option<bool>, + pub(crate) search_criteria_include_user_image_url: Option<bool>, + pub(crate) search_criteria_include_work_items: Option<bool>, + pub(crate) search_criteria_item_path: Option<String>, + pub(crate) search_criteria_item_version_version: Option<String>, + pub(crate) search_criteria_item_version_version_options: Option<String>, + pub(crate) search_criteria_item_version_version_type: Option<String>, + pub(crate) search_criteria_show_oldest_commits_first: Option<bool>, + pub(crate) search_criteria_to_commit_id: Option<String>, + pub(crate) search_criteria_to_date: Option<String>, + pub(crate) search_criteria_user: Option<String>, + } + 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); + self + } + #[doc = "Maximum number of entries to retrieve"] + pub fn search_criteria_top(mut self, search_criteria_top: i32) -> Self { + self.search_criteria_top = Some(search_criteria_top); + self + } + #[doc = "Alias or display name of the author"] + pub fn search_criteria_author(mut self, search_criteria_author: impl Into<String>) -> Self { + self.search_criteria_author = Some(search_criteria_author.into()); + self + } + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn search_criteria_compare_version_version( + mut self, + search_criteria_compare_version_version: impl Into<String>, + ) -> Self { + self.search_criteria_compare_version_version = + Some(search_criteria_compare_version_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn search_criteria_compare_version_version_options( + mut self, + search_criteria_compare_version_version_options: impl Into<String>, + ) -> Self { + self.search_criteria_compare_version_version_options = + Some(search_criteria_compare_version_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn search_criteria_compare_version_version_type( + mut self, + search_criteria_compare_version_version_type: impl Into<String>, + ) -> Self { + self.search_criteria_compare_version_version_type = + Some(search_criteria_compare_version_version_type.into()); + self + } + #[doc = "Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path."] + pub fn search_criteria_exclude_deletes( + mut self, + search_criteria_exclude_deletes: bool, + ) -> Self { + self.search_criteria_exclude_deletes = Some(search_criteria_exclude_deletes); + self + } + #[doc = "If provided, a lower bound for filtering commits alphabetically"] + pub fn search_criteria_from_commit_id( + mut self, + search_criteria_from_commit_id: impl Into<String>, + ) -> Self { + self.search_criteria_from_commit_id = Some(search_criteria_from_commit_id.into()); + self + } + #[doc = "If provided, only include history entries created after this date (string)"] + pub fn search_criteria_from_date( + mut self, + search_criteria_from_date: impl Into<String>, + ) -> Self { + self.search_criteria_from_date = Some(search_criteria_from_date.into()); + self + } + #[doc = "What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified."] + pub fn search_criteria_history_mode( + mut self, + search_criteria_history_mode: impl Into<String>, + ) -> Self { + self.search_criteria_history_mode = Some(search_criteria_history_mode.into()); + self + } + #[doc = "If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters."] + pub fn search_criteria_ids(mut self, search_criteria_ids: Vec<String>) -> Self { + self.search_criteria_ids = search_criteria_ids; + self + } + #[doc = "Whether to include the _links field on the shallow references"] + pub fn search_criteria_include_links(mut self, search_criteria_include_links: bool) -> Self { + self.search_criteria_include_links = Some(search_criteria_include_links); + self + } + #[doc = "Whether to include the push information"] + pub fn search_criteria_include_push_data( + mut self, + search_criteria_include_push_data: bool, + ) -> Self { + self.search_criteria_include_push_data = Some(search_criteria_include_push_data); + self + } + #[doc = "Whether to include the image Url for committers and authors"] + pub fn search_criteria_include_user_image_url( + mut self, + search_criteria_include_user_image_url: bool, + ) -> Self { + self.search_criteria_include_user_image_url = Some(search_criteria_include_user_image_url); + self + } + #[doc = "Whether to include linked work items"] + pub fn search_criteria_include_work_items( + mut self, + search_criteria_include_work_items: bool, + ) -> Self { + self.search_criteria_include_work_items = Some(search_criteria_include_work_items); + self + } + #[doc = "Path of item to search under"] + pub fn search_criteria_item_path( + mut self, + search_criteria_item_path: impl Into<String>, + ) -> Self { + self.search_criteria_item_path = Some(search_criteria_item_path.into()); + self + } + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn search_criteria_item_version_version( + mut self, + search_criteria_item_version_version: impl Into<String>, + ) -> Self { + self.search_criteria_item_version_version = + Some(search_criteria_item_version_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn search_criteria_item_version_version_options( + mut self, + search_criteria_item_version_version_options: impl Into<String>, + ) -> Self { + self.search_criteria_item_version_version_options = + Some(search_criteria_item_version_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn search_criteria_item_version_version_type( + mut self, + search_criteria_item_version_version_type: impl Into<String>, + ) -> Self { + self.search_criteria_item_version_version_type = + Some(search_criteria_item_version_version_type.into()); + self + } + #[doc = "If enabled, this option will ignore the itemVersion and compareVersion parameters"] + pub fn search_criteria_show_oldest_commits_first( + mut self, + search_criteria_show_oldest_commits_first: bool, + ) -> Self { + self.search_criteria_show_oldest_commits_first = + Some(search_criteria_show_oldest_commits_first); + self + } + #[doc = "If provided, an upper bound for filtering commits alphabetically"] + pub fn search_criteria_to_commit_id( + mut self, + search_criteria_to_commit_id: impl Into<String>, + ) -> Self { + self.search_criteria_to_commit_id = Some(search_criteria_to_commit_id.into()); + self + } + #[doc = "If provided, only include history entries created before this date (string)"] + pub fn search_criteria_to_date(mut self, search_criteria_to_date: impl Into<String>) -> Self { + self.search_criteria_to_date = Some(search_criteria_to_date.into()); + self + } + #[doc = "Alias or display name of the committer"] + pub fn search_criteria_user(mut self, search_criteria_user: impl Into<String>) -> Self { + self.search_criteria_user = Some(search_criteria_user.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits?", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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, + ); + } + 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, + ); + } + 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); + } + 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, + ); + } + 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, + ); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitCommitRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_push_commits { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitCommitRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitCommitRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) push_id: i32, + pub(crate) project: String, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) include_links: Option<bool>, + } + 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); + self + } + #[doc = "The number of commits to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Set to false to avoid including REST Url links for resources. Defaults to true."] + pub fn include_links(mut self, include_links: bool) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitCommitRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitCommit> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitCommit = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) commit_id: String, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) change_count: Option<i32>, + } + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.commit_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(change_count) = &this.change_count { + req + .url_mut() + .query_pairs_mut() + .append_pair("changeCount", &change_count.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitCommit>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitCommit>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_changes { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitCommitChanges> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitCommitChanges = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) commit_id: String, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + } + impl RequestBuilder { + #[doc = "The maximum number of changes to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "The number of changes to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits/{}/changes", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.commit_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitCommitChanges>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitChanges>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_commits_batch { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitCommitRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitCommitRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GitQueryCommitsCriteria, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) skip: Option<i32>, + pub(crate) top: Option<i32>, + pub(crate) include_statuses: Option<bool>, + } + impl RequestBuilder { + #[doc = "Number of commits to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Maximum number of commits to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Set to true to include additional commit status information."] + pub fn include_statuses(mut self, include_statuses: bool) -> Self { + self.include_statuses = Some(include_statuses); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commitsbatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitCommitRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod items { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `path`: The item path."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + path: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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, + } + } + #[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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Request data attributes: ItemDescriptors, IncludeContentMetadata, LatestProcessedChange, IncludeLinks. ItemDescriptors: Collection of items to fetch, including path, version, and recursion level. IncludeContentMetadata: Whether to include metadata for all items LatestProcessedChange: Whether to include shallow ref to commit that last changed each item. IncludeLinks: Whether to include the _links field on the shallow references."] + #[doc = "* `repository_id`: The name or ID of the repository"] + #[doc = "* `project`: Project ID or project name"] + pub fn get_items_batch( + &self, + organization: impl Into<String>, + body: impl Into<models::GitItemRequestData>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitItem> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitItem = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) path: String, + pub(crate) project: String, + pub(crate) scope_path: Option<String>, + pub(crate) recursion_level: Option<String>, + pub(crate) include_content_metadata: Option<bool>, + pub(crate) latest_processed_change: Option<bool>, + pub(crate) download: Option<bool>, + pub(crate) format: Option<String>, + pub(crate) version_descriptor_version: Option<String>, + pub(crate) version_descriptor_version_options: Option<String>, + pub(crate) version_descriptor_version_type: Option<String>, + pub(crate) include_content: Option<bool>, + pub(crate) resolve_lfs: Option<bool>, + pub(crate) sanitize: Option<bool>, + } + impl RequestBuilder { + #[doc = "The path scope. The default is null."] + pub fn scope_path(mut self, scope_path: impl Into<String>) -> Self { + self.scope_path = Some(scope_path.into()); + self + } + #[doc = "The recursion level of this request. The default is 'none', no recursion."] + pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self { + self.recursion_level = Some(recursion_level.into()); self + } + #[doc = "Set to true to include content metadata. Default is false."] + pub fn include_content_metadata(mut self, include_content_metadata: bool) -> Self { + self.include_content_metadata = Some(include_content_metadata); + self + } + #[doc = "Set to true to include the latest changes. Default is false."] + pub fn latest_processed_change(mut self, latest_processed_change: bool) -> Self { + self.latest_processed_change = Some(latest_processed_change); + self + } + #[doc = "Set to true to download the response as a file. Default is false."] + pub fn download(mut self, download: bool) -> Self { + self.download = Some(download); + self + } + #[doc = "If specified, this overrides the HTTP Accept request header to return either 'json' or 'zip'. If format is specified, then api-version should also be specified as a query parameter."] + pub fn format(mut self, format: impl Into<String>) -> Self { + self.format = Some(format.into()); + self + } + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn version_descriptor_version( + mut self, + version_descriptor_version: impl Into<String>, + ) -> Self { + self.version_descriptor_version = Some(version_descriptor_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn version_descriptor_version_options( + mut self, + version_descriptor_version_options: impl Into<String>, + ) -> Self { + self.version_descriptor_version_options = Some(version_descriptor_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn version_descriptor_version_type( + mut self, + version_descriptor_version_type: impl Into<String>, + ) -> Self { + self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); + self + } + #[doc = "Set to true to include item content when requesting json. Default is false."] + pub fn include_content(mut self, include_content: bool) -> Self { + self.include_content = Some(include_content); + self + } + #[doc = "Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false."] + pub fn resolve_lfs(mut self, resolve_lfs: bool) -> Self { + self.resolve_lfs = Some(resolve_lfs); + self + } + #[doc = "Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false."] + pub fn sanitize(mut self, sanitize: bool) -> Self { + self.sanitize = Some(sanitize); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/items?path={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.path + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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, + ); + } + 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, + ); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitItem>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitItem>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitItemList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitItemList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) scope_path: Option<String>, + pub(crate) recursion_level: Option<String>, + pub(crate) include_content_metadata: Option<bool>, + pub(crate) latest_processed_change: Option<bool>, + pub(crate) download: Option<bool>, + pub(crate) include_links: Option<bool>, + pub(crate) format: Option<String>, + pub(crate) version_descriptor_version: Option<String>, + pub(crate) version_descriptor_version_options: Option<String>, + pub(crate) version_descriptor_version_type: Option<String>, + } + impl RequestBuilder { + #[doc = "The path scope. The default is null."] + pub fn scope_path(mut self, scope_path: impl Into<String>) -> Self { + self.scope_path = Some(scope_path.into()); + self + } + #[doc = "The recursion level of this request. The default is 'none', no recursion."] + pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self { + self.recursion_level = Some(recursion_level.into()); + self + } + #[doc = "Set to true to include content metadata. Default is false."] + pub fn include_content_metadata(mut self, include_content_metadata: bool) -> Self { + self.include_content_metadata = Some(include_content_metadata); + self + } + #[doc = "Set to true to include the latest changes. Default is false."] + pub fn latest_processed_change(mut self, latest_processed_change: bool) -> Self { + self.latest_processed_change = Some(latest_processed_change); + self + } + #[doc = "Set to true to download the response as a file. Default is false."] + pub fn download(mut self, download: bool) -> Self { + self.download = Some(download); + self + } + #[doc = "Set to true to include links to items. Default is false."] + pub fn include_links(mut self, include_links: bool) -> Self { + self.include_links = Some(include_links); + self + } + #[doc = "If specified, this overrides the HTTP Accept request header to return either 'json' or 'zip'. If format is specified, then api-version should also be specified as a query parameter."] + pub fn format(mut self, format: impl Into<String>) -> Self { + self.format = Some(format.into()); + self + } + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn version_descriptor_version( + mut self, + version_descriptor_version: impl Into<String>, + ) -> Self { + self.version_descriptor_version = Some(version_descriptor_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn version_descriptor_version_options( + mut self, + version_descriptor_version_options: impl Into<String>, + ) -> Self { + self.version_descriptor_version_options = Some(version_descriptor_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn version_descriptor_version_type( + mut self, + version_descriptor_version_type: impl Into<String>, + ) -> Self { + self.version_descriptor_version_type = Some(version_descriptor_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/items", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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, + ); + } + 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, + ); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitItemList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitItemList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_items_batch { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/itemsbatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod stats { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve statistics about a single branch."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `name`: Name of the branch."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + name: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitBranchStats> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitBranchStats = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) name: String, + pub(crate) project: String, + pub(crate) base_version_descriptor_version: Option<String>, + pub(crate) base_version_descriptor_version_options: Option<String>, + pub(crate) base_version_descriptor_version_type: Option<String>, + } + impl RequestBuilder { + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn base_version_descriptor_version( + mut self, + base_version_descriptor_version: impl Into<String>, + ) -> Self { + self.base_version_descriptor_version = Some(base_version_descriptor_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn base_version_descriptor_version_options( + mut self, + base_version_descriptor_version_options: impl Into<String>, + ) -> Self { + self.base_version_descriptor_version_options = + Some(base_version_descriptor_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn base_version_descriptor_version_type( + mut self, + base_version_descriptor_version_type: impl Into<String>, + ) -> Self { + self.base_version_descriptor_version_type = + Some(base_version_descriptor_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/stats/branches?name={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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, + ); + } + 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, + ); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitBranchStats>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitBranchStats>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitBranchStatsList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitBranchStatsList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) base_version_descriptor_version: Option<String>, + pub(crate) base_version_descriptor_version_options: Option<String>, + pub(crate) base_version_descriptor_version_type: Option<String>, + } + impl RequestBuilder { + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn base_version_descriptor_version( + mut self, + base_version_descriptor_version: impl Into<String>, + ) -> Self { + self.base_version_descriptor_version = Some(base_version_descriptor_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn base_version_descriptor_version_options( + mut self, + base_version_descriptor_version_options: impl Into<String>, + ) -> Self { + self.base_version_descriptor_version_options = + Some(base_version_descriptor_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn base_version_descriptor_version_type( + mut self, + base_version_descriptor_version_type: impl Into<String>, + ) -> Self { + self.base_version_descriptor_version_type = + Some(base_version_descriptor_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/stats/branches", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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, + ); + } + 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, + ); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitBranchStatsList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitBranchStatsList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod refs_favorites { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the refs favorites for a repo and an identity."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The ref favorite to create."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GitRefFavorite>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `favorite_id`: The Id of the requested ref favorite."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `favorite_id`: The Id of the ref favorite to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + favorite_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + favorite_id, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRefFavoriteList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRefFavoriteList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) repository_id: Option<String>, + pub(crate) identity_id: Option<String>, + } + impl RequestBuilder { + #[doc = "The id of the repository."] + pub fn repository_id(mut self, repository_id: impl Into<String>) -> Self { + self.repository_id = Some(repository_id.into()); + self + } + #[doc = "The id of the identity whose favorites are to be retrieved. If null, the requesting identity is used."] + pub fn identity_id(mut self, identity_id: impl Into<String>) -> Self { + self.identity_id = Some(identity_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/favorites/refs", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRefFavoriteList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitRefFavoriteList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRefFavorite> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRefFavorite = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GitRefFavorite, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/favorites/refs", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRefFavorite>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitRefFavorite>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRefFavorite> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRefFavorite = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/favorites/refs/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.favorite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRefFavorite>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitRefFavorite>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/favorites/refs/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.favorite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod policy_configurations { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PolicyConfigurationList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyConfigurationList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn x_ms_continuationtoken(&self) -> azure_core::Result<&str> { + self + .0 + .get_str(&azure_core::headers::HeaderName::from_static( + "x-ms-continuationtoken", + )) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) repository_id: Option<String>, + pub(crate) ref_name: Option<String>, + pub(crate) policy_type: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + } + impl RequestBuilder { + #[doc = "The repository id."] + pub fn repository_id(mut self, repository_id: impl Into<String>) -> Self { + self.repository_id = Some(repository_id.into()); + self + } + #[doc = "The fully-qualified Git ref name (e.g. refs/heads/master)."] + pub fn ref_name(mut self, ref_name: impl Into<String>) -> Self { + self.ref_name = Some(ref_name.into()); + self + } + #[doc = "The policy type filter."] + pub fn policy_type(mut self, policy_type: impl Into<String>) -> Self { + self.policy_type = Some(policy_type.into()); + self + } + #[doc = "Maximum number of policies to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Pass a policy configuration ID to fetch the next page of results, up to top number of results, for this endpoint."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/policy/configurations", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PolicyConfigurationList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PolicyConfigurationList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod pull_requests { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_pull_requests_by_project( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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_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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `pull_request_id`: The ID of the pull request to retrieve."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_pull_request_by_id( + &self, + organization: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_pull_requests( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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_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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `create_options`: The pull request to create."] + pub fn create( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + create_options: impl Into<models::GitPullRequestCreateOptions>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: The ID of the pull request to retrieve."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_pull_request( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `pull_request_id`: The ID of the pull request to retrieve."] + #[doc = "* `update_options`: The pull request content to update."] + pub fn update( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + pull_request_id: i32, + update_options: impl Into<models::GitPullRequestUpdateOptions>, + ) -> 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 get_pull_requests_by_project { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) search_criteria_creator_id: Option<String>, + pub(crate) search_criteria_include_links: Option<bool>, + pub(crate) search_criteria_repository_id: Option<String>, + pub(crate) search_criteria_reviewer_id: Option<String>, + pub(crate) search_criteria_source_ref_name: Option<String>, + pub(crate) search_criteria_source_repository_id: Option<String>, + pub(crate) search_criteria_status: Option<String>, + pub(crate) search_criteria_target_ref_name: Option<String>, + pub(crate) max_comment_length: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) top: Option<i32>, + } + impl RequestBuilder { + #[doc = "If set, search for pull requests that were created by this identity."] + pub fn search_criteria_creator_id( + mut self, + search_criteria_creator_id: impl Into<String>, + ) -> Self { + self.search_criteria_creator_id = Some(search_criteria_creator_id.into()); + self + } + #[doc = "Whether to include the _links field on the shallow references"] + pub fn search_criteria_include_links(mut self, search_criteria_include_links: bool) -> Self { + self.search_criteria_include_links = Some(search_criteria_include_links); + self + } + #[doc = "If set, search for pull requests whose target branch is in this repository."] + pub fn search_criteria_repository_id( + mut self, + search_criteria_repository_id: impl Into<String>, + ) -> Self { + self.search_criteria_repository_id = Some(search_criteria_repository_id.into()); + self + } + #[doc = "If set, search for pull requests that have this identity as a reviewer."] + pub fn search_criteria_reviewer_id( + mut self, + search_criteria_reviewer_id: impl Into<String>, + ) -> Self { + self.search_criteria_reviewer_id = Some(search_criteria_reviewer_id.into()); + self + } + #[doc = "If set, search for pull requests from this branch."] + pub fn search_criteria_source_ref_name( + mut self, + search_criteria_source_ref_name: impl Into<String>, + ) -> Self { + self.search_criteria_source_ref_name = Some(search_criteria_source_ref_name.into()); + self + } + #[doc = "If set, search for pull requests whose source branch is in this repository."] + pub fn search_criteria_source_repository_id( + mut self, + search_criteria_source_repository_id: impl Into<String>, + ) -> Self { + self.search_criteria_source_repository_id = + Some(search_criteria_source_repository_id.into()); + self + } + #[doc = "If set, search for pull requests that are in this state. Defaults to Active if unset."] + pub fn search_criteria_status(mut self, search_criteria_status: impl Into<String>) -> Self { + self.search_criteria_status = Some(search_criteria_status.into()); + self + } + #[doc = "If set, search for pull requests into this branch."] + pub fn search_criteria_target_ref_name( + mut self, + search_criteria_target_ref_name: impl Into<String>, + ) -> Self { + self.search_criteria_target_ref_name = Some(search_criteria_target_ref_name.into()); + self + } + #[doc = "Not used."] + pub fn max_comment_length(mut self, max_comment_length: i32) -> Self { + self.max_comment_length = Some(max_comment_length); + self + } + #[doc = "The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "The number of pull requests to retrieve."] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/pullrequests", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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_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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequestList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_pull_request_by_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequest> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequest = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/pullrequests/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequest>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequest>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_pull_requests { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) search_criteria_creator_id: Option<String>, + pub(crate) search_criteria_include_links: Option<bool>, + pub(crate) search_criteria_repository_id: Option<String>, + pub(crate) search_criteria_reviewer_id: Option<String>, + pub(crate) search_criteria_source_ref_name: Option<String>, + pub(crate) search_criteria_source_repository_id: Option<String>, + pub(crate) search_criteria_status: Option<String>, + pub(crate) search_criteria_target_ref_name: Option<String>, + pub(crate) max_comment_length: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) top: Option<i32>, + } + impl RequestBuilder { + #[doc = "If set, search for pull requests that were created by this identity."] + pub fn search_criteria_creator_id( + mut self, + search_criteria_creator_id: impl Into<String>, + ) -> Self { + self.search_criteria_creator_id = Some(search_criteria_creator_id.into()); + self + } + #[doc = "Whether to include the _links field on the shallow references"] + pub fn search_criteria_include_links(mut self, search_criteria_include_links: bool) -> Self { + self.search_criteria_include_links = Some(search_criteria_include_links); + self + } + #[doc = "If set, search for pull requests whose target branch is in this repository."] + pub fn search_criteria_repository_id( + mut self, + search_criteria_repository_id: impl Into<String>, + ) -> Self { + self.search_criteria_repository_id = Some(search_criteria_repository_id.into()); + self + } + #[doc = "If set, search for pull requests that have this identity as a reviewer."] + pub fn search_criteria_reviewer_id( + mut self, + search_criteria_reviewer_id: impl Into<String>, + ) -> Self { + self.search_criteria_reviewer_id = Some(search_criteria_reviewer_id.into()); + self + } + #[doc = "If set, search for pull requests from this branch."] + pub fn search_criteria_source_ref_name( + mut self, + search_criteria_source_ref_name: impl Into<String>, + ) -> Self { + self.search_criteria_source_ref_name = Some(search_criteria_source_ref_name.into()); + self + } + #[doc = "If set, search for pull requests whose source branch is in this repository."] + pub fn search_criteria_source_repository_id( + mut self, + search_criteria_source_repository_id: impl Into<String>, + ) -> Self { + self.search_criteria_source_repository_id = + Some(search_criteria_source_repository_id.into()); + self + } + #[doc = "If set, search for pull requests that are in this state. Defaults to Active if unset."] + pub fn search_criteria_status(mut self, search_criteria_status: impl Into<String>) -> Self { + self.search_criteria_status = Some(search_criteria_status.into()); + self + } + #[doc = "If set, search for pull requests into this branch."] + pub fn search_criteria_target_ref_name( + mut self, + search_criteria_target_ref_name: impl Into<String>, + ) -> Self { + self.search_criteria_target_ref_name = Some(search_criteria_target_ref_name.into()); + self + } + #[doc = "Not used."] + pub fn max_comment_length(mut self, max_comment_length: i32) -> Self { + self.max_comment_length = Some(max_comment_length); + self + } + #[doc = "The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "The number of pull requests to retrieve."] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullrequests", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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_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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequestList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequest> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequest = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) create_options: models::GitPullRequestCreateOptions, + pub(crate) supports_iterations: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullrequests", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequest>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequest>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_pull_request { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequest> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequest = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) project: String, + pub(crate) max_comment_length: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) top: Option<i32>, + pub(crate) include_commits: Option<bool>, + pub(crate) include_work_item_refs: Option<bool>, + } + 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); + self + } + #[doc = "Not used."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Not used."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[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); + self + } + #[doc = "If true, the pull request will be returned with the associated work item references."] + pub fn include_work_item_refs(mut self, include_work_item_refs: bool) -> Self { + self.include_work_item_refs = Some(include_work_item_refs); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullrequests/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequest>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequest>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequest> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequest = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) pull_request_id: i32, + pub(crate) update_options: models::GitPullRequestUpdateOptions, + pub(crate) include_commits: Option<bool>, + pub(crate) include_work_item_refs: Option<bool>, + } + 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); + self + } + #[doc = "If true, the pull request will be returned with the associated work item references."] + pub fn include_work_item_refs(mut self, include_work_item_refs: bool) -> Self { + self.include_work_item_refs = Some(include_work_item_refs); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullrequests/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequest>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequest>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod annotated_tags { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Object containing details of tag to be created."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_id`: ID or name of the repository."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GitAnnotatedTag>, + project: impl Into<String>, + repository_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_id`: ID or name of the repository."] + #[doc = "* `object_id`: ObjectId (Sha1Id) of tag to get."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + repository_id: impl Into<String>, + object_id: impl Into<String>, + ) -> 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 create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitAnnotatedTag> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitAnnotatedTag = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GitAnnotatedTag, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/annotatedtags", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitAnnotatedTag>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitAnnotatedTag>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitAnnotatedTag> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitAnnotatedTag = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) repository_id: String, + pub(crate) object_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/annotatedtags/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.object_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitAnnotatedTag>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitAnnotatedTag>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod blobs { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets one or more blobs in a zip file download."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Blob IDs (SHA1 hashes) to be returned in the zip file."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_blobs_zip( + &self, + organization: impl Into<String>, + body: Vec<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `sha1`: SHA1 hash of the file. You can get the SHA1 of a file using the \"Git/Items/Get Item\" endpoint."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_blob( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + sha1: impl Into<String>, + project: impl Into<String>, + ) -> 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 get_blobs_zip { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<String>, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) filename: Option<String>, + } + impl RequestBuilder { + pub fn filename(mut self, filename: impl Into<String>) -> Self { + self.filename = Some(filename.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/blobs", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_blob { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitBlobRef> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitBlobRef = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) sha1: String, + pub(crate) project: String, + pub(crate) download: Option<bool>, + pub(crate) file_name: Option<String>, + pub(crate) format: Option<String>, + pub(crate) resolve_lfs: Option<bool>, + } + 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); + self + } + #[doc = "Provide a filename to use for a download."] + pub fn file_name(mut self, file_name: impl Into<String>) -> Self { + self.file_name = Some(file_name.into()); + self + } + #[doc = "Options: json, zip, text, octetstream. If not set, defaults to the MIME type set in the Accept header."] + pub fn format(mut self, format: impl Into<String>) -> Self { + self.format = Some(format.into()); + self + } + #[doc = "If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or format types"] + pub fn resolve_lfs(mut self, resolve_lfs: bool) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/blobs/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.sha1 + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitBlobRef>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitBlobRef>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod cherry_picks { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_id`: ID of the repository."] + #[doc = "* `ref_name`: The GitAsyncRefOperationParameters generatedRefName used for the cherry pick operation."] + pub fn get_cherry_pick_for_ref_name( + &self, + organization: impl Into<String>, + project: impl Into<String>, + repository_id: impl Into<String>, + ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_id`: ID of the repository."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GitAsyncRefOperationParameters>, + project: impl Into<String>, + repository_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `cherry_pick_id`: ID of the cherry pick."] + #[doc = "* `repository_id`: ID of the repository."] + pub fn get_cherry_pick( + &self, + organization: impl Into<String>, + project: impl Into<String>, + cherry_pick_id: i32, + repository_id: impl Into<String>, + ) -> 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 get_cherry_pick_for_ref_name { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitCherryPick> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitCherryPick = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) repository_id: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/cherryPicks", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let ref_name = &this.ref_name; + req + .url_mut() + .query_pairs_mut() + .append_pair("refName", ref_name); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitCherryPick>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitCherryPick>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitCherryPick> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitCherryPick = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/cherryPicks", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitCherryPick>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitCherryPick>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_cherry_pick { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitCherryPick> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitCherryPick = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) cherry_pick_id: i32, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/cherryPicks/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.cherry_pick_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitCherryPick>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitCherryPick>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod statuses { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get statuses associated with the Git commit."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `commit_id`: ID of the Git commit."] + #[doc = "* `repository_id`: ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + commit_id: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Git commit status object to create."] + #[doc = "* `commit_id`: ID of the Git commit."] + #[doc = "* `repository_id`: ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GitStatus>, + commit_id: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitStatusList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitStatusList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) commit_id: String, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) latest_only: Option<bool>, + } + 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); + self + } + #[doc = "Optional. The number of statuses to ignore. Default is 0. For example, to retrieve results 101-150, set top to 50 and skip to 100."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "The flag indicates whether to get only latest statuses grouped by `Context.Name` and `Context.Genre`."] + pub fn latest_only(mut self, latest_only: bool) -> Self { + self.latest_only = Some(latest_only); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits/{}/statuses", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.commit_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitStatusList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitStatusList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitStatus> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitStatus = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits/{}/statuses", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.commit_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitStatus>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitStatus>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod diffs { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitCommitDiffs> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitCommitDiffs = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) diff_common_commit: Option<bool>, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) base_version: Option<String>, + pub(crate) base_version_options: Option<String>, + pub(crate) base_version_type: Option<String>, + pub(crate) target_version: Option<String>, + pub(crate) target_version_options: Option<String>, + pub(crate) target_version_type: Option<String>, + } + 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); + self + } + #[doc = "Maximum number of changes to return. Defaults to 100."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of changes to skip"] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn base_version(mut self, base_version: impl Into<String>) -> Self { + self.base_version = Some(base_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn base_version_options(mut self, base_version_options: impl Into<String>) -> Self { + self.base_version_options = Some(base_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn base_version_type(mut self, base_version_type: impl Into<String>) -> Self { + self.base_version_type = Some(base_version_type.into()); + self + } + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn target_version(mut self, target_version: impl Into<String>) -> Self { + self.target_version = Some(target_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn target_version_options(mut self, target_version_options: impl Into<String>) -> Self { + self.target_version_options = Some(target_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn target_version_type(mut self, target_version_type: impl Into<String>) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/diffs/commits", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + if let Some(base_version_type) = &this.base_version_type { + req + .url_mut() + .query_pairs_mut() + .append_pair("baseVersionType", base_version_type); + } + 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); + } + if let Some(target_version_type) = &this.target_version_type { + req + .url_mut() + .query_pairs_mut() + .append_pair("targetVersionType", target_version_type); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitCommitDiffs>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitDiffs>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod import_requests { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve import requests for a repository."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_id`: The name or ID of the repository."] + pub fn query( + &self, + organization: impl Into<String>, + project: impl Into<String>, + repository_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The import request to create."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_id`: The name or ID of the repository."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GitImportRequest>, + project: impl Into<String>, + repository_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `import_request_id`: The unique identifier for the import request."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + repository_id: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The updated version of the import request. Currently, the only change allowed is setting the Status to Queued or Abandoned."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `import_request_id`: The unique identifier for the import request to update."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::GitImportRequest>, + project: impl Into<String>, + repository_id: impl Into<String>, + 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 query { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitImportRequestList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitImportRequestList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) repository_id: String, + pub(crate) include_abandoned: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/importRequests", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(include_abandoned) = &this.include_abandoned { + req + .url_mut() + .query_pairs_mut() + .append_pair("includeAbandoned", &include_abandoned.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitImportRequestList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitImportRequestList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitImportRequest> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitImportRequest = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GitImportRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/importRequests", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitImportRequest>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitImportRequest>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitImportRequest> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitImportRequest = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) repository_id: String, + pub(crate) import_request_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/importRequests/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.import_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitImportRequest>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitImportRequest>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitImportRequest> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitImportRequest = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/importRequests/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.import_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitImportRequest>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitImportRequest>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod pull_request_query { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The list of queries to perform."] + #[doc = "* `repository_id`: ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + body: impl Into<models::GitPullRequestQuery>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + project: project.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestQuery> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestQuery = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GitPullRequestQuery, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullrequestquery", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestQuery>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequestQuery>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod pull_request_attachments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of files attached to a given pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `file_name`: The name of the attachment."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + file_name: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Stream to upload"] + #[doc = "* `file_name`: The name of the file."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<String>, + file_name: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `file_name`: The name of the attachment to delete."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + file_name: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AttachmentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::AttachmentList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AttachmentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AttachmentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.file_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Attachment> { + let bytes = self.0.into_body().collect().await?; + let body: models::Attachment = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.file_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/octet-stream"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Attachment>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Attachment>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.file_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod pull_request_commits { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the commits for the specified pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: ID or name of the repository."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_pull_request_commits( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: ID or name of the repository."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `iteration_id`: ID of the iteration from which to get the commits."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_pull_request_iteration_commits( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + iteration_id: i32, + project: impl Into<String>, + ) -> 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 get_pull_request_commits { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitCommitRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitCommitRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) project: String, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + } + impl RequestBuilder { + #[doc = "Maximum number of commits to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "The continuation token used for pagination."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/commits", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitCommitRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_pull_request_iteration_commits { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitCommitRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitCommitRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) iteration_id: i32, + pub(crate) project: String, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + } + 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); + self + } + #[doc = "Number of commits to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/commits", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitCommitRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod pull_request_iterations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the list of iterations for the specified pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: ID or name of the repository."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: ID or name of the repository."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `iteration_id`: ID of the pull request iteration to return."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + iteration_id: i32, + project: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestIterationList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestIterationList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) project: String, + pub(crate) include_commits: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(include_commits) = &this.include_commits { + req + .url_mut() + .query_pairs_mut() + .append_pair("includeCommits", &include_commits.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestIterationList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::GitPullRequestIterationList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestIteration> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestIteration = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestIteration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequestIteration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod pull_request_iteration_changes { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve the changes made in a pull request between two iterations."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `iteration_id`: ID of the pull request iteration. <br /> Iteration one is the head of the source branch at the time the pull request is created and subsequent iterations are created when there are pushes to the source branch. Allowed values are between 1 and the maximum iteration on this pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + iteration_id: i32, + project: impl Into<String>, + ) -> 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 get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestIterationChanges> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestIterationChanges = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) iteration_id: i32, + pub(crate) project: String, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) compare_to: Option<i32>, + } + 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); + self + } + #[doc = "Optional. The number of changes to ignore. For example, to retrieve changes 101-150, set top 50 and skip to 100."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "ID of the pull request iteration to compare against. The default value is zero which indicates the comparison is made against the common commit between the source and target branches"] + pub fn compare_to(mut self, compare_to: i32) -> Self { + self.compare_to = Some(compare_to); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/changes", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestIterationChanges>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::GitPullRequestIterationChanges>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod pull_request_iteration_statuses { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all the statuses associated with a pull request iteration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `iteration_id`: ID of the pull request iteration."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + iteration_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Pull request status to create."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `iteration_id`: ID of the pull request iteration."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GitPullRequestStatus>, + repository_id: impl Into<String>, + pull_request_id: i32, + iteration_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Operations to apply to the pull request statuses in JSON Patch format."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `iteration_id`: ID of the pull request iteration."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::JsonPatchDocument>, + repository_id: impl Into<String>, + pull_request_id: i32, + iteration_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `iteration_id`: ID of the pull request iteration."] + #[doc = "* `status_id`: ID of the pull request status."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + iteration_id: i32, + status_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `iteration_id`: ID of the pull request iteration."] + #[doc = "* `status_id`: ID of the pull request status."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + iteration_id: i32, + status_id: i32, + project: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestStatusList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestStatusList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestStatusList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequestStatusList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestStatus> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestStatus = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GitPullRequestStatus, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestStatus>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequestStatus>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::JsonPatchDocument, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestStatus> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestStatus = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) iteration_id: i32, + pub(crate) status_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.iteration_id, + &this.status_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestStatus>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequestStatus>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) iteration_id: i32, + pub(crate) status_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.iteration_id, + &this.status_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod pull_request_labels { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all the labels assigned to a pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 label for a specified pull request. The only required field is the name of the new label."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Label to assign to the pull request."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::WebApiCreateTagRequestData>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 that has been assigned to a pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `label_id_or_name`: The name or ID of the label requested."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + label_id_or_name: impl Into<String>, + project: impl Into<String>, + ) -> 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 from the set of those assigned to the pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `label_id_or_name`: The name or ID of the label requested."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + label_id_or_name: impl Into<String>, + project: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WebApiTagDefinitionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WebApiTagDefinitionList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) project: String, + pub(crate) project_id: Option<String>, + } + impl RequestBuilder { + #[doc = "Project ID or project name."] + pub fn project_id(mut self, project_id: impl Into<String>) -> Self { + self.project_id = Some(project_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(project_id) = &this.project_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("projectId", project_id); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WebApiTagDefinitionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTagDefinitionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WebApiTagDefinition> { + let bytes = self.0.into_body().collect().await?; + let body: models::WebApiTagDefinition = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WebApiCreateTagRequestData, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) project: String, + pub(crate) project_id: Option<String>, + } + impl RequestBuilder { + #[doc = "Project ID or project name."] + pub fn project_id(mut self, project_id: impl Into<String>) -> Self { + self.project_id = Some(project_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WebApiTagDefinition>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTagDefinition>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WebApiTagDefinition> { + let bytes = self.0.into_body().collect().await?; + let body: models::WebApiTagDefinition = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) label_id_or_name: String, + pub(crate) project: String, + pub(crate) project_id: Option<String>, + } + impl RequestBuilder { + #[doc = "Project ID or project name."] + pub fn project_id(mut self, project_id: impl Into<String>) -> Self { + self.project_id = Some(project_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.label_id_or_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(project_id) = &this.project_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("projectId", project_id); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WebApiTagDefinition>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WebApiTagDefinition>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) label_id_or_name: String, + pub(crate) project: String, + pub(crate) project_id: Option<String>, + } + impl RequestBuilder { + #[doc = "Project ID or project name."] + pub fn project_id(mut self, project_id: impl Into<String>) -> Self { + self.project_id = Some(project_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.label_id_or_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(project_id) = &this.project_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("projectId", project_id); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod pull_request_properties { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get external properties of the pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Properties to add, replace or remove in JSON Patch format."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::JsonPatchDocument>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> { + let bytes = self.0.into_body().collect().await?; + let body: models::PropertiesCollection = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/properties", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PropertiesCollection>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PropertiesCollection>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> { + let bytes = self.0.into_body().collect().await?; + let body: models::PropertiesCollection = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/properties", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PropertiesCollection>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PropertiesCollection>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod pull_request_reviewers { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve the reviewers for a pull request"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Reviewers to add to the pull request."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn create_pull_request_reviewers( + &self, + organization: impl Into<String>, + body: Vec<models::IdentityRef>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Reviewer to add to the pull request."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn create_unmaterialized_pull_request_reviewer( + &self, + organization: impl Into<String>, + body: impl Into<models::IdentityRefWithVote>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: IDs of the reviewers whose votes will be reset to zero"] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request"] + #[doc = "* `project`: Project ID or project name"] + pub fn update_pull_request_reviewers( + &self, + organization: impl Into<String>, + body: Vec<models::IdentityRefWithVote>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `reviewer_id`: ID of the reviewer."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + reviewer_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Reviewer's vote.<br />If the reviewer's ID is included here, it must match the reviewerID parameter.<br />Reviewers can set their own vote with this method. When adding other reviewers, vote must be set to zero."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `reviewer_id`: ID of the reviewer."] + #[doc = "* `project`: Project ID or project name"] + pub fn create_pull_request_reviewer( + &self, + organization: impl Into<String>, + body: impl Into<models::IdentityRefWithVote>, + repository_id: impl Into<String>, + pull_request_id: i32, + reviewer_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Reviewer data.<br />If the reviewer's ID is included here, it must match the reviewerID parameter."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `reviewer_id`: ID of the reviewer."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_pull_request_reviewer( + &self, + organization: impl Into<String>, + body: impl Into<models::IdentityRefWithVote>, + repository_id: impl Into<String>, + pull_request_id: i32, + reviewer_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `reviewer_id`: ID of the reviewer to remove."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + reviewer_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::IdentityRefWithVoteList> { + let bytes = self.0.into_body().collect().await?; + let body: models::IdentityRefWithVoteList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::IdentityRefWithVoteList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::IdentityRefWithVoteList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_pull_request_reviewers { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::IdentityRefWithVoteList> { + let bytes = self.0.into_body().collect().await?; + let body: models::IdentityRefWithVoteList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::IdentityRef>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::IdentityRefWithVoteList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::IdentityRefWithVoteList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_unmaterialized_pull_request_reviewer { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::IdentityRefWithVote> { + let bytes = self.0.into_body().collect().await?; + let body: models::IdentityRefWithVote = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::IdentityRefWithVote>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::IdentityRefWithVote>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_pull_request_reviewers { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::IdentityRefWithVote>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::IdentityRefWithVote> { + let bytes = self.0.into_body().collect().await?; + let body: models::IdentityRefWithVote = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.reviewer_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::IdentityRefWithVote>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::IdentityRefWithVote>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_pull_request_reviewer { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::IdentityRefWithVote> { + let bytes = self.0.into_body().collect().await?; + let body: models::IdentityRefWithVote = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::IdentityRefWithVote, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) reviewer_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.reviewer_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::IdentityRefWithVote>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::IdentityRefWithVote>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_pull_request_reviewer { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::IdentityRefWithVote> { + let bytes = self.0.into_body().collect().await?; + let body: models::IdentityRefWithVote = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::IdentityRefWithVote, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) reviewer_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.reviewer_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::IdentityRefWithVote>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::IdentityRefWithVote>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.reviewer_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod pull_request_share { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: ID of the git repository."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn share_pull_request( + &self, + organization: impl Into<String>, + body: impl Into<models::ShareNotificationContext>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 share_pull_request { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/share", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod pull_request_statuses { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all the statuses associated with a pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Pull request status to create."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GitPullRequestStatus>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Operations to apply to the pull request statuses in JSON Patch format."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::JsonPatchDocument>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `status_id`: ID of the pull request status."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + status_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `status_id`: ID of the pull request status."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + status_id: i32, + project: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestStatusList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestStatusList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestStatusList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequestStatusList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestStatus> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestStatus = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestStatus>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequestStatus>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestStatus> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestStatus = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.status_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestStatus>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequestStatus>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.status_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod pull_request_threads { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve all threads in a pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The thread to create. Thread must contain at least one comment."] + #[doc = "* `repository_id`: Repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GitPullRequestCommentThread>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `thread_id`: ID of the thread."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + thread_id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The thread content that should be updated."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `thread_id`: ID of the thread to update."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::GitPullRequestCommentThread>, + repository_id: impl Into<String>, + pull_request_id: i32, + thread_id: i32, + project: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestCommentThreadList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestCommentThreadList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) project: String, + pub(crate) iteration: Option<i32>, + pub(crate) base_iteration: Option<i32>, + } + 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); + self + } + #[doc = "If specified, thread positions will be tracked using this iteration as the left side of the diff."] + pub fn base_iteration(mut self, base_iteration: i32) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestCommentThreadList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::GitPullRequestCommentThreadList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestCommentThread> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestCommentThread = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GitPullRequestCommentThread, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) project: String, } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestCommentThread>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::GitPullRequestCommentThread>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestCommentThread> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestCommentThread = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) thread_id: i32, + pub(crate) project: String, + pub(crate) iteration: Option<i32>, + pub(crate) base_iteration: Option<i32>, } - pub fn annotated_tags_client(&self) -> annotated_tags::Client { - annotated_tags::Client(self.clone()) + 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); + self + } + #[doc = "If specified, thread position will be tracked using this iteration as the left side of the diff."] + pub fn base_iteration(mut self, base_iteration: i32) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.thread_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub fn blobs_client(&self) -> blobs::Client { - blobs::Client(self.clone()) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestCommentThread>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::GitPullRequestCommentThread>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - pub fn cherry_picks_client(&self) -> cherry_picks::Client { - cherry_picks::Client(self.clone()) + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestCommentThread> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPullRequestCommentThread = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub fn commits_client(&self) -> commits::Client { - commits::Client(self.clone()) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn diffs_client(&self) -> diffs::Client { - diffs::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub fn forks_client(&self) -> forks::Client { - forks::Client(self.clone()) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GitPullRequestCommentThread, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) thread_id: i32, + pub(crate) project: String, } - pub fn import_requests_client(&self) -> import_requests::Client { - import_requests::Client(self.clone()) + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.thread_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub fn items_client(&self) -> items::Client { - items::Client(self.clone()) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPullRequestCommentThread>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::GitPullRequestCommentThread>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - pub fn merge_bases_client(&self) -> merge_bases::Client { - merge_bases::Client(self.clone()) + } +} +pub mod pull_request_thread_comments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve all comments associated with a specific thread in a pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `thread_id`: ID of the thread."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + thread_id: i32, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + thread_id, + project: project.into(), + } } - pub fn merges_client(&self) -> merges::Client { - merges::Client(self.clone()) + #[doc = "Create a comment on a specific thread in a pull request (up to 500 comments can be created per thread)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The comment to create. Comments can be up to 150,000 characters."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `thread_id`: ID of the thread that the desired comment is in."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::Comment>, + repository_id: impl Into<String>, + pull_request_id: i32, + thread_id: i32, + project: impl Into<String>, + ) -> 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(), + } } - pub fn policy_configurations_client(&self) -> policy_configurations::Client { - policy_configurations::Client(self.clone()) + #[doc = "Retrieve a comment associated with a specific thread in a pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `thread_id`: ID of the thread that the desired comment is in."] + #[doc = "* `comment_id`: ID of the comment."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + thread_id: i32, + comment_id: i32, + project: impl Into<String>, + ) -> 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(), + } } - pub fn pull_request_attachments_client(&self) -> pull_request_attachments::Client { - pull_request_attachments::Client(self.clone()) + #[doc = "Update a comment associated with a specific thread in a pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The comment content that should be updated. Comments can be up to 150,000 characters."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `thread_id`: ID of the thread that the desired comment is in."] + #[doc = "* `comment_id`: ID of the comment to update."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::Comment>, + repository_id: impl Into<String>, + pull_request_id: i32, + thread_id: i32, + comment_id: i32, + project: impl Into<String>, + ) -> 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(), + } } - pub fn pull_request_comment_likes_client(&self) -> pull_request_comment_likes::Client { - pull_request_comment_likes::Client(self.clone()) + #[doc = "Delete a comment associated with a specific thread in a pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `thread_id`: ID of the thread that the desired comment is in."] + #[doc = "* `comment_id`: ID of the comment."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + thread_id: i32, + comment_id: i32, + project: impl Into<String>, + ) -> 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 fn pull_request_commits_client(&self) -> pull_request_commits::Client { - pull_request_commits::Client(self.clone()) + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CommentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::CommentList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub fn pull_request_iteration_changes_client(&self) -> pull_request_iteration_changes::Client { - pull_request_iteration_changes::Client(self.clone()) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn pull_request_iteration_statuses_client( - &self, - ) -> pull_request_iteration_statuses::Client { - pull_request_iteration_statuses::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub fn pull_request_iterations_client(&self) -> pull_request_iterations::Client { - pull_request_iterations::Client(self.clone()) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) thread_id: i32, + pub(crate) project: String, } - pub fn pull_request_labels_client(&self) -> pull_request_labels::Client { - pull_request_labels::Client(self.clone()) + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.thread_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub fn pull_request_properties_client(&self) -> pull_request_properties::Client { - pull_request_properties::Client(self.clone()) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CommentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CommentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - pub fn pull_request_query_client(&self) -> pull_request_query::Client { - pull_request_query::Client(self.clone()) + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Comment> { + let bytes = self.0.into_body().collect().await?; + let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub fn pull_request_reviewers_client(&self) -> pull_request_reviewers::Client { - pull_request_reviewers::Client(self.clone()) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn pull_request_share_client(&self) -> pull_request_share::Client { - pull_request_share::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub fn pull_request_statuses_client(&self) -> pull_request_statuses::Client { - pull_request_statuses::Client(self.clone()) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Comment, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) thread_id: i32, + pub(crate) project: String, } - pub fn pull_request_thread_comments_client(&self) -> pull_request_thread_comments::Client { - pull_request_thread_comments::Client(self.clone()) + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.thread_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub fn pull_request_threads_client(&self) -> pull_request_threads::Client { - pull_request_threads::Client(self.clone()) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Comment>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - pub fn pull_request_work_items_client(&self) -> pull_request_work_items::Client { - pull_request_work_items::Client(self.clone()) + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Comment> { + let bytes = self.0.into_body().collect().await?; + let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub fn pull_requests_client(&self) -> pull_requests::Client { - pull_requests::Client(self.clone()) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn pushes_client(&self) -> pushes::Client { - pushes::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub fn refs_client(&self) -> refs::Client { - refs::Client(self.clone()) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) thread_id: i32, + pub(crate) comment_id: i32, + pub(crate) project: String, } - pub fn refs_favorites_client(&self) -> refs_favorites::Client { - refs_favorites::Client(self.clone()) + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.thread_id, + &this.comment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub fn repositories_client(&self) -> repositories::Client { - repositories::Client(self.clone()) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Comment>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - pub fn reverts_client(&self) -> reverts::Client { - reverts::Client(self.clone()) + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Comment> { + let bytes = self.0.into_body().collect().await?; + let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub fn stats_client(&self) -> stats::Client { - stats::Client(self.clone()) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn statuses_client(&self) -> statuses::Client { - statuses::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub fn suggestions_client(&self) -> suggestions::Client { - suggestions::Client(self.clone()) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Comment, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) thread_id: i32, + pub(crate) comment_id: i32, + pub(crate) project: String, } - pub fn trees_client(&self) -> trees::Client { - trees::Client(self.clone()) + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.thread_id, + &this.comment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } -} -pub mod repositories { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve a git repository."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `include_parent`: Set to true to include parent repository. Only available in authenticated calls."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_repository_with_parent( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - include_parent: bool, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_deleted_repositories( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_recycle_bin_repositories( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_id`: The ID of the repository."] - pub fn restore_repository_from_recycle_bin( - &self, - organization: impl Into<String>, - body: impl Into<models::GitRecycleBinRepositoryDetails>, - project: impl Into<String>, - repository_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_id`: The ID of the repository."] - pub fn delete_repository_from_recycle_bin( - &self, - organization: impl Into<String>, - project: impl Into<String>, - repository_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Specify the repo name, team project and/or parent repository. Team project information can be omitted from gitRepositoryToCreate if the request is project-scoped (i.e., includes project Id)."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GitRepositoryCreateOptions>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_repository( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Specify a new repo name or a new default branch of the repository"] - #[doc = "* `repository_id`: The ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::GitRepository>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - repository_id: repository_id.into(), - project: project.into(), - } - } - } - pub mod get_repository_with_parent { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRepository> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) include_parent: bool, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}?includeParent={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.include_parent - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let include_parent = &this.include_parent; - req.url_mut() - .query_pairs_mut() - .append_pair("includeParent", &include_parent.to_string()); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRepository>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRepository>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_deleted_repositories { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitDeletedRepositoryList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitDeletedRepositoryList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/deletedrepositories", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitDeletedRepositoryList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitDeletedRepositoryList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_recycle_bin_repositories { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitDeletedRepositoryList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitDeletedRepositoryList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/recycleBin/repositories", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitDeletedRepositoryList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitDeletedRepositoryList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod restore_repository_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRepository> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GitRecycleBinRepositoryDetails, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/recycleBin/repositories/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRepository>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRepository>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_repository_from_recycle_bin { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/recycleBin/repositories/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRepositoryList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepositoryList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) include_links: Option<bool>, - pub(crate) include_all_urls: Option<bool>, - pub(crate) include_hidden: Option<bool>, - } - 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); - self - } - #[doc = "(optional) Set to true to include all remote URLs. The default value is false."] - pub fn include_all_urls(mut self, include_all_urls: bool) -> Self { - self.include_all_urls = Some(include_all_urls); - self - } - #[doc = "(optional) Set to true to include hidden repositories. The default value is false."] - pub fn include_hidden(mut self, include_hidden: bool) -> Self { - self.include_hidden = Some(include_hidden); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRepositoryList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRepositoryList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRepository> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GitRepositoryCreateOptions, - pub(crate) project: String, - pub(crate) source_ref: Option<String>, - } - 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<String>) -> Self { - self.source_ref = Some(source_ref.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRepository>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRepository>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_repository { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRepository> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRepository>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRepository>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRepository> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepository = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GitRepository, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRepository>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRepository>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Comment>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -pub mod commits { + } + pub mod delete { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The id or friendly name of the repository. To use the friendly name, projectId must also be specified."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_commits( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The id or friendly name of the repository. To use the friendly name, projectId must also be specified."] - #[doc = "* `push_id`: The id of the push."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_push_commits( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - push_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `commit_id`: The id of the commit."] - #[doc = "* `repository_id`: The id or friendly name of the repository. To use the friendly name, projectId must also be specified."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - commit_id: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `commit_id`: The id of the commit."] - #[doc = "* `repository_id`: The id or friendly name of the repository. To use the friendly name, projectId must also be specified."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_changes( - &self, - organization: impl Into<String>, - commit_id: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Search options"] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_commits_batch( - &self, - organization: impl Into<String>, - body: impl Into<models::GitQueryCommitsCriteria>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get_commits { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitCommitRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) search_criteria_skip: Option<i32>, - pub(crate) search_criteria_top: Option<i32>, - pub(crate) search_criteria_author: Option<String>, - pub(crate) search_criteria_compare_version_version: Option<String>, - pub(crate) search_criteria_compare_version_version_options: Option<String>, - pub(crate) search_criteria_compare_version_version_type: Option<String>, - pub(crate) search_criteria_exclude_deletes: Option<bool>, - pub(crate) search_criteria_from_commit_id: Option<String>, - pub(crate) search_criteria_from_date: Option<String>, - pub(crate) search_criteria_history_mode: Option<String>, - pub(crate) search_criteria_ids: Vec<String>, - pub(crate) search_criteria_include_links: Option<bool>, - pub(crate) search_criteria_include_push_data: Option<bool>, - pub(crate) search_criteria_include_user_image_url: Option<bool>, - pub(crate) search_criteria_include_work_items: Option<bool>, - pub(crate) search_criteria_item_path: Option<String>, - pub(crate) search_criteria_item_version_version: Option<String>, - pub(crate) search_criteria_item_version_version_options: Option<String>, - pub(crate) search_criteria_item_version_version_type: Option<String>, - pub(crate) search_criteria_show_oldest_commits_first: Option<bool>, - pub(crate) search_criteria_to_commit_id: Option<String>, - pub(crate) search_criteria_to_date: Option<String>, - pub(crate) search_criteria_user: Option<String>, - } - 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); - self - } - #[doc = "Maximum number of entries to retrieve"] - pub fn search_criteria_top(mut self, search_criteria_top: i32) -> Self { - self.search_criteria_top = Some(search_criteria_top); - self - } - #[doc = "Alias or display name of the author"] - pub fn search_criteria_author( - mut self, - search_criteria_author: impl Into<String>, - ) -> Self { - self.search_criteria_author = Some(search_criteria_author.into()); - self - } - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn search_criteria_compare_version_version( - mut self, - search_criteria_compare_version_version: impl Into<String>, - ) -> Self { - self.search_criteria_compare_version_version = - Some(search_criteria_compare_version_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn search_criteria_compare_version_version_options( - mut self, - search_criteria_compare_version_version_options: impl Into<String>, - ) -> Self { - self.search_criteria_compare_version_version_options = - Some(search_criteria_compare_version_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn search_criteria_compare_version_version_type( - mut self, - search_criteria_compare_version_version_type: impl Into<String>, - ) -> Self { - self.search_criteria_compare_version_version_type = - Some(search_criteria_compare_version_version_type.into()); - self - } - #[doc = "Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path."] - pub fn search_criteria_exclude_deletes( - mut self, - search_criteria_exclude_deletes: bool, - ) -> Self { - self.search_criteria_exclude_deletes = Some(search_criteria_exclude_deletes); - self - } - #[doc = "If provided, a lower bound for filtering commits alphabetically"] - pub fn search_criteria_from_commit_id( - mut self, - search_criteria_from_commit_id: impl Into<String>, - ) -> Self { - self.search_criteria_from_commit_id = Some(search_criteria_from_commit_id.into()); - self - } - #[doc = "If provided, only include history entries created after this date (string)"] - pub fn search_criteria_from_date( - mut self, - search_criteria_from_date: impl Into<String>, - ) -> Self { - self.search_criteria_from_date = Some(search_criteria_from_date.into()); - self - } - #[doc = "What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified."] - pub fn search_criteria_history_mode( - mut self, - search_criteria_history_mode: impl Into<String>, - ) -> Self { - self.search_criteria_history_mode = Some(search_criteria_history_mode.into()); - self - } - #[doc = "If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters."] - pub fn search_criteria_ids(mut self, search_criteria_ids: Vec<String>) -> Self { - self.search_criteria_ids = search_criteria_ids; - self - } - #[doc = "Whether to include the _links field on the shallow references"] - pub fn search_criteria_include_links( - mut self, - search_criteria_include_links: bool, - ) -> Self { - self.search_criteria_include_links = Some(search_criteria_include_links); - self - } - #[doc = "Whether to include the push information"] - pub fn search_criteria_include_push_data( - mut self, - search_criteria_include_push_data: bool, - ) -> Self { - self.search_criteria_include_push_data = Some(search_criteria_include_push_data); - self - } - #[doc = "Whether to include the image Url for committers and authors"] - pub fn search_criteria_include_user_image_url( - mut self, - search_criteria_include_user_image_url: bool, - ) -> Self { - self.search_criteria_include_user_image_url = - Some(search_criteria_include_user_image_url); - self - } - #[doc = "Whether to include linked work items"] - pub fn search_criteria_include_work_items( - mut self, - search_criteria_include_work_items: bool, - ) -> Self { - self.search_criteria_include_work_items = Some(search_criteria_include_work_items); - self - } - #[doc = "Path of item to search under"] - pub fn search_criteria_item_path( - mut self, - search_criteria_item_path: impl Into<String>, - ) -> Self { - self.search_criteria_item_path = Some(search_criteria_item_path.into()); - self - } - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn search_criteria_item_version_version( - mut self, - search_criteria_item_version_version: impl Into<String>, - ) -> Self { - self.search_criteria_item_version_version = - Some(search_criteria_item_version_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn search_criteria_item_version_version_options( - mut self, - search_criteria_item_version_version_options: impl Into<String>, - ) -> Self { - self.search_criteria_item_version_version_options = - Some(search_criteria_item_version_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn search_criteria_item_version_version_type( - mut self, - search_criteria_item_version_version_type: impl Into<String>, - ) -> Self { - self.search_criteria_item_version_version_type = - Some(search_criteria_item_version_version_type.into()); - self - } - #[doc = "If enabled, this option will ignore the itemVersion and compareVersion parameters"] - pub fn search_criteria_show_oldest_commits_first( - mut self, - search_criteria_show_oldest_commits_first: bool, - ) -> Self { - self.search_criteria_show_oldest_commits_first = - Some(search_criteria_show_oldest_commits_first); - self - } - #[doc = "If provided, an upper bound for filtering commits alphabetically"] - pub fn search_criteria_to_commit_id( - mut self, - search_criteria_to_commit_id: impl Into<String>, - ) -> Self { - self.search_criteria_to_commit_id = Some(search_criteria_to_commit_id.into()); - self - } - #[doc = "If provided, only include history entries created before this date (string)"] - pub fn search_criteria_to_date( - mut self, - search_criteria_to_date: impl Into<String>, - ) -> Self { - self.search_criteria_to_date = Some(search_criteria_to_date.into()); - self - } - #[doc = "Alias or display name of the committer"] - pub fn search_criteria_user(mut self, search_criteria_user: impl Into<String>) -> Self { - self.search_criteria_user = Some(search_criteria_user.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits?", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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, - ); - } - 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, - ); - } - 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, - ); - } - 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, - ); - } - 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, - ); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitCommitRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_push_commits { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitCommitRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) push_id: i32, - pub(crate) project: String, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) include_links: Option<bool>, - } - 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); - self - } - #[doc = "The number of commits to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "Set to false to avoid including REST Url links for resources. Defaults to true."] - pub fn include_links(mut self, include_links: bool) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitCommitRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitCommit> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommit = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) commit_id: String, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) change_count: Option<i32>, - } - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.commit_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(change_count) = &this.change_count { - req.url_mut() - .query_pairs_mut() - .append_pair("changeCount", &change_count.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitCommit>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitCommit>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_changes { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitCommitChanges> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitChanges = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) commit_id: String, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - } - impl RequestBuilder { - #[doc = "The maximum number of changes to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "The number of changes to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits/{}/changes", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.commit_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitCommitChanges>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitChanges>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_commits_batch { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitCommitRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GitQueryCommitsCriteria, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) skip: Option<i32>, - pub(crate) top: Option<i32>, - pub(crate) include_statuses: Option<bool>, - } - impl RequestBuilder { - #[doc = "Number of commits to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "Maximum number of commits to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Set to true to include additional commit status information."] - pub fn include_statuses(mut self, include_statuses: bool) -> Self { - self.include_statuses = Some(include_statuses); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commitsbatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitCommitRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) thread_id: i32, + pub(crate) comment_id: i32, + pub(crate) project: String, } -} -pub mod items { - use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `path`: The item path."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - path: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Request data attributes: ItemDescriptors, IncludeContentMetadata, LatestProcessedChange, IncludeLinks. ItemDescriptors: Collection of items to fetch, including path, version, and recursion level. IncludeContentMetadata: Whether to include metadata for all items LatestProcessedChange: Whether to include shallow ref to commit that last changed each item. IncludeLinks: Whether to include the _links field on the shallow references."] - #[doc = "* `repository_id`: The name or ID of the repository"] - #[doc = "* `project`: Project ID or project name"] - pub fn get_items_batch( - &self, - organization: impl Into<String>, - body: impl Into<models::GitItemRequestData>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitItem> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) path: String, - pub(crate) project: String, - pub(crate) scope_path: Option<String>, - pub(crate) recursion_level: Option<String>, - pub(crate) include_content_metadata: Option<bool>, - pub(crate) latest_processed_change: Option<bool>, - pub(crate) download: Option<bool>, - pub(crate) format: Option<String>, - pub(crate) version_descriptor_version: Option<String>, - pub(crate) version_descriptor_version_options: Option<String>, - pub(crate) version_descriptor_version_type: Option<String>, - pub(crate) include_content: Option<bool>, - pub(crate) resolve_lfs: Option<bool>, - pub(crate) sanitize: Option<bool>, - } - impl RequestBuilder { - #[doc = "The path scope. The default is null."] - pub fn scope_path(mut self, scope_path: impl Into<String>) -> Self { - self.scope_path = Some(scope_path.into()); - self - } - #[doc = "The recursion level of this request. The default is 'none', no recursion."] - pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self { - self.recursion_level = Some(recursion_level.into()); - self - } - #[doc = "Set to true to include content metadata. Default is false."] - pub fn include_content_metadata(mut self, include_content_metadata: bool) -> Self { - self.include_content_metadata = Some(include_content_metadata); - self - } - #[doc = "Set to true to include the latest changes. Default is false."] - pub fn latest_processed_change(mut self, latest_processed_change: bool) -> Self { - self.latest_processed_change = Some(latest_processed_change); - self - } - #[doc = "Set to true to download the response as a file. Default is false."] - pub fn download(mut self, download: bool) -> Self { - self.download = Some(download); - self - } - #[doc = "If specified, this overrides the HTTP Accept request header to return either 'json' or 'zip'. If format is specified, then api-version should also be specified as a query parameter."] - pub fn format(mut self, format: impl Into<String>) -> Self { - self.format = Some(format.into()); - self - } - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn version_descriptor_version( - mut self, - version_descriptor_version: impl Into<String>, - ) -> Self { - self.version_descriptor_version = Some(version_descriptor_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn version_descriptor_version_options( - mut self, - version_descriptor_version_options: impl Into<String>, - ) -> Self { - self.version_descriptor_version_options = - Some(version_descriptor_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn version_descriptor_version_type( - mut self, - version_descriptor_version_type: impl Into<String>, - ) -> Self { - self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); - self - } - #[doc = "Set to true to include item content when requesting json. Default is false."] - pub fn include_content(mut self, include_content: bool) -> Self { - self.include_content = Some(include_content); - self - } - #[doc = "Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false."] - pub fn resolve_lfs(mut self, resolve_lfs: bool) -> Self { - self.resolve_lfs = Some(resolve_lfs); - self - } - #[doc = "Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false."] - pub fn sanitize(mut self, sanitize: bool) -> Self { - self.sanitize = Some(sanitize); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/items?path={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.path - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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, - ); - } - 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, - ); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitItem>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitItem>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitItemList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitItemList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) scope_path: Option<String>, - pub(crate) recursion_level: Option<String>, - pub(crate) include_content_metadata: Option<bool>, - pub(crate) latest_processed_change: Option<bool>, - pub(crate) download: Option<bool>, - pub(crate) include_links: Option<bool>, - pub(crate) format: Option<String>, - pub(crate) version_descriptor_version: Option<String>, - pub(crate) version_descriptor_version_options: Option<String>, - pub(crate) version_descriptor_version_type: Option<String>, - pub(crate) zip_for_unix: Option<bool>, - } - impl RequestBuilder { - #[doc = "The path scope. The default is null."] - pub fn scope_path(mut self, scope_path: impl Into<String>) -> Self { - self.scope_path = Some(scope_path.into()); - self - } - #[doc = "The recursion level of this request. The default is 'none', no recursion."] - pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self { - self.recursion_level = Some(recursion_level.into()); - self - } - #[doc = "Set to true to include content metadata. Default is false."] - pub fn include_content_metadata(mut self, include_content_metadata: bool) -> Self { - self.include_content_metadata = Some(include_content_metadata); - self - } - #[doc = "Set to true to include the latest changes. Default is false."] - pub fn latest_processed_change(mut self, latest_processed_change: bool) -> Self { - self.latest_processed_change = Some(latest_processed_change); - self - } - #[doc = "Set to true to download the response as a file. Default is false."] - pub fn download(mut self, download: bool) -> Self { - self.download = Some(download); - self - } - #[doc = "Set to true to include links to items. Default is false."] - pub fn include_links(mut self, include_links: bool) -> Self { - self.include_links = Some(include_links); - self - } - #[doc = "If specified, this overrides the HTTP Accept request header to return either 'json' or 'zip'. If format is specified, then api-version should also be specified as a query parameter."] - pub fn format(mut self, format: impl Into<String>) -> Self { - self.format = Some(format.into()); - self - } - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn version_descriptor_version( - mut self, - version_descriptor_version: impl Into<String>, - ) -> Self { - self.version_descriptor_version = Some(version_descriptor_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn version_descriptor_version_options( - mut self, - version_descriptor_version_options: impl Into<String>, - ) -> Self { - self.version_descriptor_version_options = - Some(version_descriptor_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn version_descriptor_version_type( - mut self, - version_descriptor_version_type: impl Into<String>, - ) -> Self { - self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); - self - } - #[doc = "Set to true to keep the file permissions for unix (and POSIX) systems like executables and symlinks"] - pub fn zip_for_unix(mut self, zip_for_unix: bool) -> Self { - self.zip_for_unix = Some(zip_for_unix); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/items", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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, - ); - } - 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, - ); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitItemList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitItemList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_items_batch { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/itemsbatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.thread_id, + &this.comment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } -} -pub mod stats { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve statistics about a single branch."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `name`: Name of the branch."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - name: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitBranchStats> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitBranchStats = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) name: String, - pub(crate) project: String, - pub(crate) base_version_descriptor_version: Option<String>, - pub(crate) base_version_descriptor_version_options: Option<String>, - pub(crate) base_version_descriptor_version_type: Option<String>, - } - impl RequestBuilder { - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn base_version_descriptor_version( - mut self, - base_version_descriptor_version: impl Into<String>, - ) -> Self { - self.base_version_descriptor_version = Some(base_version_descriptor_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn base_version_descriptor_version_options( - mut self, - base_version_descriptor_version_options: impl Into<String>, - ) -> Self { - self.base_version_descriptor_version_options = - Some(base_version_descriptor_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn base_version_descriptor_version_type( - mut self, - base_version_descriptor_version_type: impl Into<String>, - ) -> Self { - self.base_version_descriptor_version_type = - Some(base_version_descriptor_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/stats/branches?name={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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, - ); - } - 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, - ); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitBranchStats>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitBranchStats>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitBranchStatsList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitBranchStatsList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) base_version_descriptor_version: Option<String>, - pub(crate) base_version_descriptor_version_options: Option<String>, - pub(crate) base_version_descriptor_version_type: Option<String>, - } - impl RequestBuilder { - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn base_version_descriptor_version( - mut self, - base_version_descriptor_version: impl Into<String>, - ) -> Self { - self.base_version_descriptor_version = Some(base_version_descriptor_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn base_version_descriptor_version_options( - mut self, - base_version_descriptor_version_options: impl Into<String>, - ) -> Self { - self.base_version_descriptor_version_options = - Some(base_version_descriptor_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn base_version_descriptor_version_type( - mut self, - base_version_descriptor_version_type: impl Into<String>, - ) -> Self { - self.base_version_descriptor_version_type = - Some(base_version_descriptor_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/stats/branches", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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, - ); - } - 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, - ); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitBranchStatsList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitBranchStatsList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } -pub mod refs_favorites { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the refs favorites for a repo and an identity."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The ref favorite to create."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GitRefFavorite>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `favorite_id`: The Id of the requested ref favorite."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `favorite_id`: The Id of the ref favorite to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - favorite_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - favorite_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRefFavoriteList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRefFavoriteList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) repository_id: Option<String>, - pub(crate) identity_id: Option<String>, - } - impl RequestBuilder { - #[doc = "The id of the repository."] - pub fn repository_id(mut self, repository_id: impl Into<String>) -> Self { - self.repository_id = Some(repository_id.into()); - self - } - #[doc = "The id of the identity whose favorites are to be retrieved. If null, the requesting identity is used."] - pub fn identity_id(mut self, identity_id: impl Into<String>) -> Self { - self.identity_id = Some(identity_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/favorites/refs", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRefFavoriteList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRefFavoriteList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRefFavorite> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRefFavorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GitRefFavorite, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/favorites/refs", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRefFavorite>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRefFavorite>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRefFavorite> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRefFavorite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/favorites/refs/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.favorite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRefFavorite>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRefFavorite>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/favorites/refs/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.favorite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } +pub mod pull_request_comment_likes { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get likes for a comment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `thread_id`: The ID of the thread that contains the comment."] + #[doc = "* `comment_id`: The ID of the comment."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + thread_id: i32, + comment_id: i32, + project: impl Into<String>, + ) -> 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(), + } } -} -pub mod policy_configurations { - use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PolicyConfigurationList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfigurationList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn x_ms_continuationtoken(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static( - "x-ms-continuationtoken", - )) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) repository_id: Option<String>, - pub(crate) ref_name: Option<String>, - pub(crate) policy_type: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - } - impl RequestBuilder { - #[doc = "The repository id."] - pub fn repository_id(mut self, repository_id: impl Into<String>) -> Self { - self.repository_id = Some(repository_id.into()); - self - } - #[doc = "The fully-qualified Git ref name (e.g. refs/heads/master)."] - pub fn ref_name(mut self, ref_name: impl Into<String>) -> Self { - self.ref_name = Some(ref_name.into()); - self - } - #[doc = "The policy type filter."] - pub fn policy_type(mut self, policy_type: impl Into<String>) -> Self { - self.policy_type = Some(policy_type.into()); - self - } - #[doc = "Maximum number of policies to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Pass a policy configuration ID to fetch the next page of results, up to top number of results, for this endpoint."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/policy/configurations", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PolicyConfigurationList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PolicyConfigurationList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + #[doc = "Add a like on a comment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `thread_id`: The ID of the thread that contains the comment."] + #[doc = "* `comment_id`: The ID of the comment."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + thread_id: i32, + comment_id: i32, + project: impl Into<String>, + ) -> 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(), + } } -} -pub mod pull_requests { - use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_pull_requests_by_project( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `pull_request_id`: The ID of the pull request to retrieve."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_pull_request_by_id( - &self, - organization: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_pull_requests( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `create_options`: The pull request to create."] - pub fn create( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - create_options: impl Into<models::GitPullRequestCreateOptions>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: The ID of the pull request to retrieve."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_pull_request( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `pull_request_id`: The ID of the pull request to retrieve."] - #[doc = "* `update_options`: The pull request content to update."] - pub fn update( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - pull_request_id: i32, - update_options: impl Into<models::GitPullRequestUpdateOptions>, - ) -> 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 get_pull_requests_by_project { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) search_criteria_creator_id: Option<String>, - pub(crate) search_criteria_include_links: Option<bool>, - pub(crate) search_criteria_max_time: Option<time::OffsetDateTime>, - pub(crate) search_criteria_min_time: Option<time::OffsetDateTime>, - pub(crate) search_criteria_query_time_range_type: Option<String>, - pub(crate) search_criteria_repository_id: Option<String>, - pub(crate) search_criteria_reviewer_id: Option<String>, - pub(crate) search_criteria_source_ref_name: Option<String>, - pub(crate) search_criteria_source_repository_id: Option<String>, - pub(crate) search_criteria_status: Option<String>, - pub(crate) search_criteria_target_ref_name: Option<String>, - pub(crate) max_comment_length: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) top: Option<i32>, - } - impl RequestBuilder { - #[doc = "If set, search for pull requests that were created by this identity."] - pub fn search_criteria_creator_id( - mut self, - search_criteria_creator_id: impl Into<String>, - ) -> Self { - self.search_criteria_creator_id = Some(search_criteria_creator_id.into()); - self - } - #[doc = "Whether to include the _links field on the shallow references"] - pub fn search_criteria_include_links( - mut self, - search_criteria_include_links: bool, - ) -> Self { - self.search_criteria_include_links = Some(search_criteria_include_links); - self - } - #[doc = "If specified, filters pull requests that created/closed before this date based on the queryTimeRangeType specified."] - pub fn search_criteria_max_time( - mut self, - search_criteria_max_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.search_criteria_max_time = Some(search_criteria_max_time.into()); - self - } - #[doc = "If specified, filters pull requests that created/closed after this date based on the queryTimeRangeType specified."] - pub fn search_criteria_min_time( - mut self, - search_criteria_min_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.search_criteria_min_time = Some(search_criteria_min_time.into()); - self - } - #[doc = "The type of time range which should be used for minTime and maxTime. Defaults to Created if unset."] - pub fn search_criteria_query_time_range_type( - mut self, - search_criteria_query_time_range_type: impl Into<String>, - ) -> Self { - self.search_criteria_query_time_range_type = - Some(search_criteria_query_time_range_type.into()); - self - } - #[doc = "If set, search for pull requests whose target branch is in this repository."] - pub fn search_criteria_repository_id( - mut self, - search_criteria_repository_id: impl Into<String>, - ) -> Self { - self.search_criteria_repository_id = Some(search_criteria_repository_id.into()); - self - } - #[doc = "If set, search for pull requests that have this identity as a reviewer."] - pub fn search_criteria_reviewer_id( - mut self, - search_criteria_reviewer_id: impl Into<String>, - ) -> Self { - self.search_criteria_reviewer_id = Some(search_criteria_reviewer_id.into()); - self - } - #[doc = "If set, search for pull requests from this branch."] - pub fn search_criteria_source_ref_name( - mut self, - search_criteria_source_ref_name: impl Into<String>, - ) -> Self { - self.search_criteria_source_ref_name = Some(search_criteria_source_ref_name.into()); - self - } - #[doc = "If set, search for pull requests whose source branch is in this repository."] - pub fn search_criteria_source_repository_id( - mut self, - search_criteria_source_repository_id: impl Into<String>, - ) -> Self { - self.search_criteria_source_repository_id = - Some(search_criteria_source_repository_id.into()); - self - } - #[doc = "If set, search for pull requests that are in this state. Defaults to Active if unset."] - pub fn search_criteria_status( - mut self, - search_criteria_status: impl Into<String>, - ) -> Self { - self.search_criteria_status = Some(search_criteria_status.into()); - self - } - #[doc = "If set, search for pull requests into this branch."] - pub fn search_criteria_target_ref_name( - mut self, - search_criteria_target_ref_name: impl Into<String>, - ) -> Self { - self.search_criteria_target_ref_name = Some(search_criteria_target_ref_name.into()); - self - } - #[doc = "Not used."] - pub fn max_comment_length(mut self, max_comment_length: i32) -> Self { - self.max_comment_length = Some(max_comment_length); - self - } - #[doc = "The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "The number of pull requests to retrieve."] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/pullrequests", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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, - ); - } - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequestList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_pull_request_by_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequest> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequest = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/pullrequests/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequest>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequest>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_pull_requests { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) search_criteria_creator_id: Option<String>, - pub(crate) search_criteria_include_links: Option<bool>, - pub(crate) search_criteria_max_time: Option<time::OffsetDateTime>, - pub(crate) search_criteria_min_time: Option<time::OffsetDateTime>, - pub(crate) search_criteria_query_time_range_type: Option<String>, - pub(crate) search_criteria_repository_id: Option<String>, - pub(crate) search_criteria_reviewer_id: Option<String>, - pub(crate) search_criteria_source_ref_name: Option<String>, - pub(crate) search_criteria_source_repository_id: Option<String>, - pub(crate) search_criteria_status: Option<String>, - pub(crate) search_criteria_target_ref_name: Option<String>, - pub(crate) max_comment_length: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) top: Option<i32>, - } - impl RequestBuilder { - #[doc = "If set, search for pull requests that were created by this identity."] - pub fn search_criteria_creator_id( - mut self, - search_criteria_creator_id: impl Into<String>, - ) -> Self { - self.search_criteria_creator_id = Some(search_criteria_creator_id.into()); - self - } - #[doc = "Whether to include the _links field on the shallow references"] - pub fn search_criteria_include_links( - mut self, - search_criteria_include_links: bool, - ) -> Self { - self.search_criteria_include_links = Some(search_criteria_include_links); - self - } - #[doc = "If specified, filters pull requests that created/closed before this date based on the queryTimeRangeType specified."] - pub fn search_criteria_max_time( - mut self, - search_criteria_max_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.search_criteria_max_time = Some(search_criteria_max_time.into()); - self - } - #[doc = "If specified, filters pull requests that created/closed after this date based on the queryTimeRangeType specified."] - pub fn search_criteria_min_time( - mut self, - search_criteria_min_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.search_criteria_min_time = Some(search_criteria_min_time.into()); - self - } - #[doc = "The type of time range which should be used for minTime and maxTime. Defaults to Created if unset."] - pub fn search_criteria_query_time_range_type( - mut self, - search_criteria_query_time_range_type: impl Into<String>, - ) -> Self { - self.search_criteria_query_time_range_type = - Some(search_criteria_query_time_range_type.into()); - self - } - #[doc = "If set, search for pull requests whose target branch is in this repository."] - pub fn search_criteria_repository_id( - mut self, - search_criteria_repository_id: impl Into<String>, - ) -> Self { - self.search_criteria_repository_id = Some(search_criteria_repository_id.into()); - self - } - #[doc = "If set, search for pull requests that have this identity as a reviewer."] - pub fn search_criteria_reviewer_id( - mut self, - search_criteria_reviewer_id: impl Into<String>, - ) -> Self { - self.search_criteria_reviewer_id = Some(search_criteria_reviewer_id.into()); - self - } - #[doc = "If set, search for pull requests from this branch."] - pub fn search_criteria_source_ref_name( - mut self, - search_criteria_source_ref_name: impl Into<String>, - ) -> Self { - self.search_criteria_source_ref_name = Some(search_criteria_source_ref_name.into()); - self - } - #[doc = "If set, search for pull requests whose source branch is in this repository."] - pub fn search_criteria_source_repository_id( - mut self, - search_criteria_source_repository_id: impl Into<String>, - ) -> Self { - self.search_criteria_source_repository_id = - Some(search_criteria_source_repository_id.into()); - self - } - #[doc = "If set, search for pull requests that are in this state. Defaults to Active if unset."] - pub fn search_criteria_status( - mut self, - search_criteria_status: impl Into<String>, - ) -> Self { - self.search_criteria_status = Some(search_criteria_status.into()); - self - } - #[doc = "If set, search for pull requests into this branch."] - pub fn search_criteria_target_ref_name( - mut self, - search_criteria_target_ref_name: impl Into<String>, - ) -> Self { - self.search_criteria_target_ref_name = Some(search_criteria_target_ref_name.into()); - self - } - #[doc = "Not used."] - pub fn max_comment_length(mut self, max_comment_length: i32) -> Self { - self.max_comment_length = Some(max_comment_length); - self - } - #[doc = "The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "The number of pull requests to retrieve."] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullrequests", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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, - ); - } - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequestList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequest> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequest = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) create_options: models::GitPullRequestCreateOptions, - pub(crate) supports_iterations: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullrequests", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequest>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequest>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_pull_request { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequest> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequest = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) project: String, - pub(crate) max_comment_length: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) top: Option<i32>, - pub(crate) include_commits: Option<bool>, - pub(crate) include_work_item_refs: Option<bool>, - } - 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); - self - } - #[doc = "Not used."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "Not used."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[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); - self - } - #[doc = "If true, the pull request will be returned with the associated work item references."] - pub fn include_work_item_refs(mut self, include_work_item_refs: bool) -> Self { - self.include_work_item_refs = Some(include_work_item_refs); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullrequests/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequest>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequest>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequest> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequest = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) pull_request_id: i32, - pub(crate) update_options: models::GitPullRequestUpdateOptions, - pub(crate) include_commits: Option<bool>, - pub(crate) include_work_item_refs: Option<bool>, - } - 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); - self - } - #[doc = "If true, the pull request will be returned with the associated work item references."] - pub fn include_work_item_refs(mut self, include_work_item_refs: bool) -> Self { - self.include_work_item_refs = Some(include_work_item_refs); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullrequests/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequest>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitPullRequest>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + #[doc = "Delete a like on a comment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `thread_id`: The ID of the thread that contains the comment."] + #[doc = "* `comment_id`: The ID of the comment."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + thread_id: i32, + comment_id: i32, + project: impl Into<String>, + ) -> 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 annotated_tags { + } + pub mod list { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Object containing details of tag to be created."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_id`: ID or name of the repository."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GitAnnotatedTag>, - project: impl Into<String>, - repository_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_id`: ID or name of the repository."] - #[doc = "* `object_id`: ObjectId (Sha1Id) of tag to get."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - repository_id: impl Into<String>, - object_id: impl Into<String>, - ) -> 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 create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitAnnotatedTag> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitAnnotatedTag = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GitAnnotatedTag, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/annotatedtags", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitAnnotatedTag>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitAnnotatedTag>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitAnnotatedTag> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitAnnotatedTag = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) repository_id: String, - pub(crate) object_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/annotatedtags/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.object_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitAnnotatedTag>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitAnnotatedTag>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::IdentityRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::IdentityRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod blobs { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets one or more blobs in a zip file download."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Blob IDs (SHA1 hashes) to be returned in the zip file."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_blobs_zip( - &self, - organization: impl Into<String>, - body: Vec<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `sha1`: SHA1 hash of the file. You can get the SHA1 of a file using the \"Git/Items/Get Item\" endpoint."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_blob( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - sha1: impl Into<String>, - project: impl Into<String>, - ) -> 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 get_blobs_zip { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<String>, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) filename: Option<String>, - } - impl RequestBuilder { - pub fn filename(mut self, filename: impl Into<String>) -> Self { - self.filename = Some(filename.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/blobs", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_blob { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitBlobRef> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitBlobRef = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) sha1: String, - pub(crate) project: String, - pub(crate) download: Option<bool>, - pub(crate) file_name: Option<String>, - pub(crate) format: Option<String>, - pub(crate) resolve_lfs: Option<bool>, - } - 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); - self - } - #[doc = "Provide a filename to use for a download."] - pub fn file_name(mut self, file_name: impl Into<String>) -> Self { - self.file_name = Some(file_name.into()); - self - } - #[doc = "Options: json, zip, text, octetstream. If not set, defaults to the MIME type set in the Accept header."] - pub fn format(mut self, format: impl Into<String>) -> Self { - self.format = Some(format.into()); - self - } - #[doc = "If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or format types"] - pub fn resolve_lfs(mut self, resolve_lfs: bool) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/blobs/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.sha1 - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitBlobRef>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitBlobRef>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } -} -pub mod cherry_picks { - use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_id`: ID of the repository."] - #[doc = "* `ref_name`: The GitAsyncRefOperationParameters generatedRefName used for the cherry pick operation."] - pub fn get_cherry_pick_for_ref_name( - &self, - organization: impl Into<String>, - project: impl Into<String>, - repository_id: impl Into<String>, - ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_id`: ID of the repository."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GitAsyncRefOperationParameters>, - project: impl Into<String>, - repository_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `cherry_pick_id`: ID of the cherry pick."] - #[doc = "* `repository_id`: ID of the repository."] - pub fn get_cherry_pick( - &self, - organization: impl Into<String>, - project: impl Into<String>, - cherry_pick_id: i32, - repository_id: impl Into<String>, - ) -> 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 get_cherry_pick_for_ref_name { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitCherryPick> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCherryPick = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) repository_id: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/cherryPicks", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let ref_name = &this.ref_name; - req.url_mut() - .query_pairs_mut() - .append_pair("refName", ref_name); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitCherryPick>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitCherryPick>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitCherryPick> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCherryPick = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/cherryPicks", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitCherryPick>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitCherryPick>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_cherry_pick { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitCherryPick> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCherryPick = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) cherry_pick_id: i32, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/cherryPicks/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.cherry_pick_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitCherryPick>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitCherryPick>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } -} -pub mod statuses { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get statuses associated with the Git commit."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `commit_id`: ID of the Git commit."] - #[doc = "* `repository_id`: ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - commit_id: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Git commit status object to create."] - #[doc = "* `commit_id`: ID of the Git commit."] - #[doc = "* `repository_id`: ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GitStatus>, - commit_id: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitStatusList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitStatusList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) commit_id: String, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) latest_only: Option<bool>, - } - 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); - self - } - #[doc = "Optional. The number of statuses to ignore. Default is 0. For example, to retrieve results 101-150, set top to 50 and skip to 100."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "The flag indicates whether to get only latest statuses grouped by `Context.Name` and `Context.Genre`."] - pub fn latest_only(mut self, latest_only: bool) -> Self { - self.latest_only = Some(latest_only); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits/{}/statuses", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.commit_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitStatusList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitStatusList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitStatus> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitStatus = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits/{}/statuses", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.commit_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitStatus>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitStatus>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) thread_id: i32, + pub(crate) comment_id: i32, + pub(crate) project: String, } -} -pub mod diffs { - use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitCommitDiffs> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitDiffs = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) diff_common_commit: Option<bool>, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) base_version: Option<String>, - pub(crate) base_version_options: Option<String>, - pub(crate) base_version_type: Option<String>, - pub(crate) target_version: Option<String>, - pub(crate) target_version_options: Option<String>, - pub(crate) target_version_type: Option<String>, - } - 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); - self - } - #[doc = "Maximum number of changes to return. Defaults to 100."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of changes to skip"] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn base_version(mut self, base_version: impl Into<String>) -> Self { - self.base_version = Some(base_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn base_version_options(mut self, base_version_options: impl Into<String>) -> Self { - self.base_version_options = Some(base_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn base_version_type(mut self, base_version_type: impl Into<String>) -> Self { - self.base_version_type = Some(base_version_type.into()); - self - } - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn target_version(mut self, target_version: impl Into<String>) -> Self { - self.target_version = Some(target_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn target_version_options( - mut self, - target_version_options: impl Into<String>, - ) -> Self { - self.target_version_options = Some(target_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn target_version_type(mut self, target_version_type: impl Into<String>) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/diffs/commits", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - if let Some(base_version_type) = &this.base_version_type { - req.url_mut() - .query_pairs_mut() - .append_pair("baseVersionType", base_version_type); - } - 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); - } - if let Some(target_version_type) = &this.target_version_type { - req.url_mut() - .query_pairs_mut() - .append_pair("targetVersionType", target_version_type); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitCommitDiffs>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitDiffs>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}/likes", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.thread_id, + &this.comment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } -} -pub mod import_requests { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve import requests for a repository."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_id`: The name or ID of the repository."] - pub fn query( - &self, - organization: impl Into<String>, - project: impl Into<String>, - repository_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The import request to create."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_id`: The name or ID of the repository."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GitImportRequest>, - project: impl Into<String>, - repository_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `import_request_id`: The unique identifier for the import request."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - repository_id: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The updated version of the import request. Currently, the only change allowed is setting the Status to Queued or Abandoned."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `import_request_id`: The unique identifier for the import request to update."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::GitImportRequest>, - project: impl Into<String>, - repository_id: impl Into<String>, - 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 query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitImportRequestList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitImportRequestList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) repository_id: String, - pub(crate) include_abandoned: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/importRequests", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(include_abandoned) = &this.include_abandoned { - req.url_mut() - .query_pairs_mut() - .append_pair("includeAbandoned", &include_abandoned.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitImportRequestList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitImportRequestList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitImportRequest> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitImportRequest = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GitImportRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/importRequests", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitImportRequest>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitImportRequest>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitImportRequest> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitImportRequest = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) repository_id: String, - pub(crate) import_request_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/importRequests/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.import_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitImportRequest>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitImportRequest>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitImportRequest> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitImportRequest = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/importRequests/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.import_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitImportRequest>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitImportRequest>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::IdentityRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::IdentityRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -pub mod pull_request_query { + } + pub mod create { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The list of queries to perform."] - #[doc = "* `repository_id`: ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - body: impl Into<models::GitPullRequestQuery>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - repository_id: repository_id.into(), - project: project.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestQuery> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GitPullRequestQuery, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullrequestquery", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestQuery>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestQuery>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) thread_id: i32, + pub(crate) comment_id: i32, + pub(crate) project: String, } -} -pub mod pull_request_attachments { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of files attached to a given pull request."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `file_name`: The name of the attachment."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - file_name: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Stream to upload"] - #[doc = "* `file_name`: The name of the file."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<String>, - file_name: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `file_name`: The name of the attachment to delete."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - file_name: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AttachmentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::AttachmentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AttachmentList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::AttachmentList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.file_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Attachment> { - let bytes = self.0.into_body().collect().await?; - let body: models::Attachment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.file_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Attachment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Attachment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.file_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}/likes", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.thread_id, + &this.comment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } -} -pub mod pull_request_commits { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get the commits for the specified pull request."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: ID or name of the repository."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_pull_request_commits( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: ID or name of the repository."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `iteration_id`: ID of the iteration from which to get the commits."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_pull_request_iteration_commits( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - iteration_id: i32, - project: impl Into<String>, - ) -> 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 get_pull_request_commits { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitCommitRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) project: String, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - } - impl RequestBuilder { - #[doc = "Maximum number of commits to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "The continuation token used for pagination."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/commits", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitCommitRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_pull_request_iteration_commits { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitCommitRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) iteration_id: i32, - pub(crate) project: String, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - } - 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); - self - } - #[doc = "Number of commits to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/commits" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . iteration_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitCommitRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } -} -pub mod pull_request_iterations { + } + pub mod delete { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get the list of iterations for the specified pull request."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: ID or name of the repository."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: ID or name of the repository."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `iteration_id`: ID of the pull request iteration to return."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - iteration_id: i32, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::GitPullRequestIterationList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestIterationList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) project: String, - pub(crate) include_commits: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(include_commits) = &this.include_commits { - req.url_mut() - .query_pairs_mut() - .append_pair("includeCommits", &include_commits.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestIterationList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestIterationList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestIteration> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestIteration = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.iteration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestIteration>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestIteration>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) pull_request_id: i32, + pub(crate) thread_id: i32, + pub(crate) comment_id: i32, + pub(crate) project: String, } -} -pub mod pull_request_iteration_changes { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve the changes made in a pull request between two iterations."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `iteration_id`: ID of the pull request iteration. <br /> Iteration one is the head of the source branch at the time the pull request is created and subsequent iterations are created when there are pushes to the source branch. Allowed values are between 1 and the maximum iteration on this pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - iteration_id: i32, - project: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::GitPullRequestIterationChanges> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestIterationChanges = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) iteration_id: i32, - pub(crate) project: String, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) compare_to: Option<i32>, - } - 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); - self - } - #[doc = "Optional. The number of changes to ignore. For example, to retrieve changes 101-150, set top 50 and skip to 100."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "ID of the pull request iteration to compare against. The default value is zero which indicates the comparison is made against the common commit between the source and target branches"] - pub fn compare_to(mut self, compare_to: i32) -> Self { - self.compare_to = Some(compare_to); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/changes" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . iteration_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestIterationChanges>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestIterationChanges>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}/likes", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id, + &this.thread_id, + &this.comment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } -} -pub mod pull_request_iteration_statuses { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get all the statuses associated with a pull request iteration."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `iteration_id`: ID of the pull request iteration."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - iteration_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Pull request status to create."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `iteration_id`: ID of the pull request iteration."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GitPullRequestStatus>, - repository_id: impl Into<String>, - pull_request_id: i32, - iteration_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Operations to apply to the pull request statuses in JSON Patch format."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `iteration_id`: ID of the pull request iteration."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - repository_id: impl Into<String>, - pull_request_id: i32, - iteration_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `iteration_id`: ID of the pull request iteration."] - #[doc = "* `status_id`: ID of the pull request status."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - iteration_id: i32, - status_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `iteration_id`: ID of the pull request iteration."] - #[doc = "* `status_id`: ID of the pull request status."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - iteration_id: i32, - status_id: i32, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestStatusList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestStatusList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . iteration_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestStatusList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestStatusList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestStatus> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestStatus = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GitPullRequestStatus, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . iteration_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestStatus>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestStatus>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::JsonPatchDocument, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . iteration_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestStatus> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestStatus = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) iteration_id: i32, - pub(crate) status_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses/{}" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . iteration_id , & this . status_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestStatus>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestStatus>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) iteration_id: i32, - pub(crate) status_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses/{}" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . iteration_id , & this . status_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } -pub mod pull_request_labels { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get all the labels (tags) assigned to a pull request."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Label to assign to the pull request."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::WebApiCreateTagRequestData>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `label_id_or_name`: The name or ID of the label requested."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - label_id_or_name: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `label_id_or_name`: The name or ID of the label requested."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - label_id_or_name: impl Into<String>, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WebApiTagDefinitionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTagDefinitionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) project: String, - pub(crate) project_id: Option<String>, - } - impl RequestBuilder { - #[doc = "Project ID or project name."] - pub fn project_id(mut self, project_id: impl Into<String>) -> Self { - self.project_id = Some(project_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(project_id) = &this.project_id { - req.url_mut() - .query_pairs_mut() - .append_pair("projectId", project_id); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WebApiTagDefinitionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WebApiTagDefinitionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WebApiTagDefinition> { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTagDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WebApiCreateTagRequestData, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) project: String, - pub(crate) project_id: Option<String>, - } - impl RequestBuilder { - #[doc = "Project ID or project name."] - pub fn project_id(mut self, project_id: impl Into<String>) -> Self { - self.project_id = Some(project_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WebApiTagDefinition>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WebApiTagDefinition>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WebApiTagDefinition> { - let bytes = self.0.into_body().collect().await?; - let body: models::WebApiTagDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) label_id_or_name: String, - pub(crate) project: String, - pub(crate) project_id: Option<String>, - } - impl RequestBuilder { - #[doc = "Project ID or project name."] - pub fn project_id(mut self, project_id: impl Into<String>) -> Self { - self.project_id = Some(project_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.label_id_or_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(project_id) = &this.project_id { - req.url_mut() - .query_pairs_mut() - .append_pair("projectId", project_id); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WebApiTagDefinition>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WebApiTagDefinition>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) label_id_or_name: String, - pub(crate) project: String, - pub(crate) project_id: Option<String>, - } - impl RequestBuilder { - #[doc = "Project ID or project name."] - pub fn project_id(mut self, project_id: impl Into<String>) -> Self { - self.project_id = Some(project_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.label_id_or_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(project_id) = &this.project_id { - req.url_mut() - .query_pairs_mut() - .append_pair("projectId", project_id); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } +pub mod pull_request_work_items { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve a list of work items associated with a pull request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: ID or name of the repository."] + #[doc = "* `pull_request_id`: ID of the pull request."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + pull_request_id: i32, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } } -} -pub mod pull_request_properties { + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get external properties of the pull request."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Properties to add, replace or remove in JSON Patch format."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> { - let bytes = self.0.into_body().collect().await?; - let body: models::PropertiesCollection = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/properties", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PropertiesCollection>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PropertiesCollection>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> { - let bytes = self.0.into_body().collect().await?; - let body: models::PropertiesCollection = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/properties", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PropertiesCollection>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PropertiesCollection>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ResourceRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ResourceRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod pull_request_reviewers { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve the reviewers for a pull request"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Reviewers to add to the pull request."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn create_pull_request_reviewers( - &self, - organization: impl Into<String>, - body: Vec<models::IdentityRef>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Reviewer to add to the pull request."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn create_unmaterialized_pull_request_reviewer( - &self, - organization: impl Into<String>, - body: impl Into<models::IdentityRefWithVote>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: IDs of the reviewers whose votes will be reset to zero"] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request"] - #[doc = "* `project`: Project ID or project name"] - pub fn update_pull_request_reviewers( - &self, - organization: impl Into<String>, - body: Vec<models::IdentityRefWithVote>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `reviewer_id`: ID of the reviewer."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - reviewer_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Reviewer's vote.<br />If the reviewer's ID is included here, it must match the reviewerID parameter.<br />Reviewers can set their own vote with this method. When adding other reviewers, vote must be set to zero."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `reviewer_id`: ID of the reviewer."] - #[doc = "* `project`: Project ID or project name"] - pub fn create_pull_request_reviewer( - &self, - organization: impl Into<String>, - body: impl Into<models::IdentityRefWithVote>, - repository_id: impl Into<String>, - pull_request_id: i32, - reviewer_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Reviewer data.<br />If the reviewer's ID is included here, it must match the reviewerID parameter."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `reviewer_id`: ID of the reviewer."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_pull_request_reviewer( - &self, - organization: impl Into<String>, - body: impl Into<models::IdentityRefWithVote>, - repository_id: impl Into<String>, - pull_request_id: i32, - reviewer_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `reviewer_id`: ID of the reviewer to remove."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - reviewer_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::IdentityRefWithVoteList> { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefWithVoteList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::IdentityRefWithVoteList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::IdentityRefWithVoteList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_pull_request_reviewers { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::IdentityRefWithVoteList> { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefWithVoteList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::IdentityRef>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::IdentityRefWithVoteList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::IdentityRefWithVoteList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_unmaterialized_pull_request_reviewer { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::IdentityRefWithVote> { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefWithVote = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::IdentityRefWithVote>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::IdentityRefWithVote>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_pull_request_reviewers { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::IdentityRefWithVote>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::IdentityRefWithVote> { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefWithVote = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.reviewer_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::IdentityRefWithVote>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::IdentityRefWithVote>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_pull_request_reviewer { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::IdentityRefWithVote> { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefWithVote = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::IdentityRefWithVote, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) reviewer_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.reviewer_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::IdentityRefWithVote>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::IdentityRefWithVote>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_pull_request_reviewer { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::IdentityRefWithVote> { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefWithVote = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::IdentityRefWithVote, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) reviewer_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.reviewer_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::IdentityRefWithVote>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::IdentityRefWithVote>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.reviewer_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/workitems", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.pull_request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ResourceRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ResourceRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } -pub mod pull_request_share { +pub mod pushes { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieves pushes associated with the specified repository."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GitPush>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `push_id`: ID of the push."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + push_id: i32, + project: impl Into<String>, + ) -> 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 list { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: ID of the git repository."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn share_pull_request( - &self, - organization: impl Into<String>, - body: impl Into<models::ShareNotificationContext>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 share_pull_request { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/share", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPushList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPushList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod pull_request_statuses { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) skip: Option<i32>, + pub(crate) top: Option<i32>, + pub(crate) search_criteria_from_date: Option<time::OffsetDateTime>, + pub(crate) search_criteria_include_links: Option<bool>, + pub(crate) search_criteria_include_ref_updates: Option<bool>, + pub(crate) search_criteria_pusher_id: Option<String>, + pub(crate) search_criteria_ref_name: Option<String>, + pub(crate) search_criteria_to_date: Option<time::OffsetDateTime>, + } + impl RequestBuilder { + #[doc = "Number of pushes to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Number of pushes to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references."] + pub fn search_criteria_from_date( + mut self, + search_criteria_from_date: impl Into<time::OffsetDateTime>, + ) -> Self { + self.search_criteria_from_date = Some(search_criteria_from_date.into()); + self + } + #[doc = "Whether to include the _links field on the shallow references"] + pub fn search_criteria_include_links(mut self, search_criteria_include_links: bool) -> Self { + self.search_criteria_include_links = Some(search_criteria_include_links); + self + } + #[doc = "Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references."] + pub fn search_criteria_include_ref_updates( + mut self, + search_criteria_include_ref_updates: bool, + ) -> Self { + self.search_criteria_include_ref_updates = Some(search_criteria_include_ref_updates); + self + } + #[doc = "Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references."] + pub fn search_criteria_pusher_id( + mut self, + search_criteria_pusher_id: impl Into<String>, + ) -> Self { + self.search_criteria_pusher_id = Some(search_criteria_pusher_id.into()); + self + } + #[doc = "Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references."] + pub fn search_criteria_ref_name( + mut self, + search_criteria_ref_name: impl Into<String>, + ) -> Self { + self.search_criteria_ref_name = Some(search_criteria_ref_name.into()); + self + } + #[doc = "Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references."] + pub fn search_criteria_to_date( + mut self, + search_criteria_to_date: impl Into<time::OffsetDateTime>, + ) -> Self { + self.search_criteria_to_date = Some(search_criteria_to_date.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pushes", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPushList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitPushList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get all the statuses associated with a pull request."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Pull request status to create."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GitPullRequestStatus>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Operations to apply to the pull request statuses in JSON Patch format."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `status_id`: ID of the pull request status."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - status_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request’s target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `status_id`: ID of the pull request status."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - status_id: i32, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestStatusList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestStatusList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestStatusList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestStatusList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestStatus> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestStatus = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestStatus>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestStatus>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPullRequestStatus> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestStatus = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.status_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestStatus>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestStatus>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.status_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPush> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPush = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod pull_request_threads { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pushes", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPush>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitPush>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve all threads in a pull request."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The thread to create. Thread must contain at least one comment."] - #[doc = "* `repository_id`: Repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GitPullRequestCommentThread>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `thread_id`: ID of the thread."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - thread_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The thread content that should be updated."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `thread_id`: ID of the thread to update."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::GitPullRequestCommentThread>, - repository_id: impl Into<String>, - pull_request_id: i32, - thread_id: i32, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::GitPullRequestCommentThreadList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestCommentThreadList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) project: String, - pub(crate) iteration: Option<i32>, - pub(crate) base_iteration: Option<i32>, - } - 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); - self - } - #[doc = "If specified, thread positions will be tracked using this iteration as the left side of the diff."] - pub fn base_iteration(mut self, base_iteration: i32) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestCommentThreadList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestCommentThreadList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::GitPullRequestCommentThread> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestCommentThread = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestCommentThread>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestCommentThread>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::GitPullRequestCommentThread> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestCommentThread = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) thread_id: i32, - pub(crate) project: String, - pub(crate) iteration: Option<i32>, - pub(crate) base_iteration: Option<i32>, - } - 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); - self - } - #[doc = "If specified, thread position will be tracked using this iteration as the left side of the diff."] - pub fn base_iteration(mut self, base_iteration: i32) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.thread_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestCommentThread>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestCommentThread>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::GitPullRequestCommentThread> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPullRequestCommentThread = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GitPullRequestCommentThread, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) thread_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id, - &this.thread_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPullRequestCommentThread>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitPullRequestCommentThread>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitPush> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitPush = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) push_id: i32, + pub(crate) project: String, + pub(crate) include_commits: Option<i32>, + pub(crate) include_ref_updates: Option<bool>, + } + 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); + self + } + #[doc = "If true, include the list of refs that were updated by the push."] + pub fn include_ref_updates(mut self, include_ref_updates: bool) -> Self { + self.include_ref_updates = Some(include_ref_updates); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pushes/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.push_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitPush>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitPush>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } -pub mod pull_request_thread_comments { +pub mod refs { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Queries the provided repository for its refs and returns them."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: List of ref updates to attempt to perform"] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn update_refs( + &self, + organization: impl Into<String>, + body: Vec<models::GitRefUpdate>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The ref update action (lock/unlock) to perform"] + #[doc = "* `repository_id`: The name or ID of the repository."] + #[doc = "* `filter`: The name of the branch to lock/unlock"] + #[doc = "* `project`: Project ID or project name"] + pub fn update_ref( + &self, + organization: impl Into<String>, + body: impl Into<models::GitRefUpdate>, + repository_id: impl Into<String>, + filter: impl Into<String>, + project: impl Into<String>, + ) -> 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve all comments associated with a specific thread in a pull request."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `thread_id`: ID of the thread."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - thread_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The comment to create. Comments can be up to 150,000 characters."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `thread_id`: ID of the thread that the desired comment is in."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::Comment>, - repository_id: impl Into<String>, - pull_request_id: i32, - thread_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `thread_id`: ID of the thread that the desired comment is in."] - #[doc = "* `comment_id`: ID of the comment."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - thread_id: i32, - comment_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The comment content that should be updated. Comments can be up to 150,000 characters."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `thread_id`: ID of the thread that the desired comment is in."] - #[doc = "* `comment_id`: ID of the comment to update."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::Comment>, - repository_id: impl Into<String>, - pull_request_id: i32, - thread_id: i32, - comment_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `thread_id`: ID of the thread that the desired comment is in."] - #[doc = "* `comment_id`: ID of the comment."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - thread_id: i32, - comment_id: i32, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CommentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . thread_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CommentList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CommentList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Comment> { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Comment, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) thread_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . thread_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Comment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Comment> { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) thread_id: i32, - pub(crate) comment_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . thread_id , & this . comment_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Comment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Comment> { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Comment, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) thread_id: i32, - pub(crate) comment_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . thread_id , & this . comment_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Comment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) thread_id: i32, - pub(crate) comment_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . thread_id , & this . comment_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod pull_request_comment_likes { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) filter: Option<String>, + pub(crate) include_links: Option<bool>, + pub(crate) include_statuses: Option<bool>, + pub(crate) include_my_branches: Option<bool>, + pub(crate) latest_statuses_only: Option<bool>, + pub(crate) peel_tags: Option<bool>, + pub(crate) filter_contains: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + } + impl RequestBuilder { + #[doc = "\\[optional\\] A filter to apply to the refs (starts with)."] + pub fn filter(mut self, filter: impl Into<String>) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "\\[optional\\] Specifies if referenceLinks should be included in the result. default is false."] + pub fn include_links(mut self, include_links: bool) -> Self { + self.include_links = Some(include_links); + self + } + #[doc = "\\[optional\\] Includes up to the first 1000 commit statuses for each ref. The default value is false."] + pub fn include_statuses(mut self, include_statuses: bool) -> Self { + self.include_statuses = Some(include_statuses); + self + } + #[doc = "\\[optional\\] Includes only branches that the user owns, the branches the user favorites, and the default branch. The default value is false. Cannot be combined with the filter parameter."] + pub fn include_my_branches(mut self, include_my_branches: bool) -> Self { + self.include_my_branches = Some(include_my_branches); + self + } + #[doc = "(optional) Set to true to include only the tip commit status for each ref. This option requires `includeStatuses` to be true. The default value is false."] + pub fn latest_statuses_only(mut self, latest_statuses_only: bool) -> Self { + self.latest_statuses_only = Some(latest_statuses_only); + self + } + #[doc = "\\[optional\\] Annotated tags will populate the PeeledObjectId property. default is false."] + pub fn peel_tags(mut self, peel_tags: bool) -> Self { + self.peel_tags = Some(peel_tags); + self + } + #[doc = "\\[optional\\] A filter to apply to the refs (contains)."] + pub fn filter_contains(mut self, filter_contains: impl Into<String>) -> Self { + self.filter_contains = Some(filter_contains.into()); + self + } + #[doc = "\\[optional\\] Maximum number of refs to return. It cannot be bigger than 1000. If it is not provided but continuation token is, top will default to 100."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "The continuation token used for pagination."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/refs", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRefList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_refs { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get likes for a comment."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `thread_id`: The ID of the thread that contains the comment."] - #[doc = "* `comment_id`: The ID of the comment."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - thread_id: i32, - comment_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `thread_id`: The ID of the thread that contains the comment."] - #[doc = "* `comment_id`: The ID of the comment."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - thread_id: i32, - comment_id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The repository ID of the pull request's target branch."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `thread_id`: The ID of the thread that contains the comment."] - #[doc = "* `comment_id`: The ID of the comment."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - thread_id: i32, - comment_id: i32, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::IdentityRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) thread_id: i32, - pub(crate) comment_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}/likes" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . thread_id , & this . comment_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::IdentityRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::IdentityRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) thread_id: i32, - pub(crate) comment_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}/likes" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . thread_id , & this . comment_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) pull_request_id: i32, - pub(crate) thread_id: i32, - pub(crate) comment_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}/likes" , this . client . endpoint () , & this . organization , & this . project , & this . repository_id , & this . pull_request_id , & this . thread_id , & this . comment_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRefUpdateResultList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRefUpdateResultList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod pull_request_work_items { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::GitRefUpdate>, + pub(crate) repository_id: String, + pub(crate) project: String, + pub(crate) project_id: Option<String>, + } + 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<String>) -> Self { + self.project_id = Some(project_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/refs", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRefUpdateResultList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitRefUpdateResultList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_ref { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve a list of work items associated with a pull request."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: ID or name of the repository."] - #[doc = "* `pull_request_id`: ID of the pull request."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - pull_request_id: i32, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - repository_id: repository_id.into(), - pull_request_id, - project: project.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ResourceRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/workitems", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.pull_request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ResourceRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ResourceRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRef> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRef = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GitRefUpdate, + pub(crate) repository_id: String, + pub(crate) filter: String, + pub(crate) project: String, + pub(crate) project_id: Option<String>, + } + 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<String>) -> Self { + self.project_id = Some(project_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/refs", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRef>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitRef>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } -pub mod pushes { +pub mod reverts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve information about a revert operation for a specific branch."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_id`: ID of the repository."] + #[doc = "* `ref_name`: The GitAsyncRefOperationParameters generatedRefName used for the revert operation."] + pub fn get_revert_for_ref_name( + &self, + organization: impl Into<String>, + project: impl Into<String>, + repository_id: impl Into<String>, + ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_id`: ID of the repository."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GitAsyncRefOperationParameters>, + project: impl Into<String>, + repository_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `revert_id`: ID of the revert operation."] + #[doc = "* `repository_id`: ID of the repository."] + pub fn get_revert( + &self, + organization: impl Into<String>, + project: impl Into<String>, + revert_id: i32, + repository_id: impl Into<String>, + ) -> 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 get_revert_for_ref_name { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieves pushes associated with the specified repository."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GitPush>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `push_id`: ID of the push."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - push_id: i32, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPushList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPushList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) skip: Option<i32>, - pub(crate) top: Option<i32>, - pub(crate) search_criteria_from_date: Option<time::OffsetDateTime>, - pub(crate) search_criteria_include_links: Option<bool>, - pub(crate) search_criteria_include_ref_updates: Option<bool>, - pub(crate) search_criteria_pusher_id: Option<String>, - pub(crate) search_criteria_ref_name: Option<String>, - pub(crate) search_criteria_to_date: Option<time::OffsetDateTime>, - } - impl RequestBuilder { - #[doc = "Number of pushes to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "Number of pushes to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references."] - pub fn search_criteria_from_date( - mut self, - search_criteria_from_date: impl Into<time::OffsetDateTime>, - ) -> Self { - self.search_criteria_from_date = Some(search_criteria_from_date.into()); - self - } - #[doc = "Whether to include the _links field on the shallow references"] - pub fn search_criteria_include_links( - mut self, - search_criteria_include_links: bool, - ) -> Self { - self.search_criteria_include_links = Some(search_criteria_include_links); - self - } - #[doc = "Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references."] - pub fn search_criteria_include_ref_updates( - mut self, - search_criteria_include_ref_updates: bool, - ) -> Self { - self.search_criteria_include_ref_updates = - Some(search_criteria_include_ref_updates); - self - } - #[doc = "Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references."] - pub fn search_criteria_pusher_id( - mut self, - search_criteria_pusher_id: impl Into<String>, - ) -> Self { - self.search_criteria_pusher_id = Some(search_criteria_pusher_id.into()); - self - } - #[doc = "Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references."] - pub fn search_criteria_ref_name( - mut self, - search_criteria_ref_name: impl Into<String>, - ) -> Self { - self.search_criteria_ref_name = Some(search_criteria_ref_name.into()); - self - } - #[doc = "Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references."] - pub fn search_criteria_to_date( - mut self, - search_criteria_to_date: impl Into<time::OffsetDateTime>, - ) -> Self { - self.search_criteria_to_date = Some(search_criteria_to_date.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pushes", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPushList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitPushList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPush> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPush = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pushes", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPush>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitPush>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitPush> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitPush = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) push_id: i32, - pub(crate) project: String, - pub(crate) include_commits: Option<i32>, - pub(crate) include_ref_updates: Option<bool>, - } - 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); - self - } - #[doc = "If true, include the list of refs that were updated by the push."] - pub fn include_ref_updates(mut self, include_ref_updates: bool) -> Self { - self.include_ref_updates = Some(include_ref_updates); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pushes/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.push_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitPush>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitPush>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRevert> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRevert = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod refs { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) repository_id: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/reverts", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let ref_name = &this.ref_name; + req + .url_mut() + .query_pairs_mut() + .append_pair("refName", ref_name); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRevert>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitRevert>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Queries the provided repository for its refs and returns them."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: List of ref updates to attempt to perform"] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn update_refs( - &self, - organization: impl Into<String>, - body: Vec<models::GitRefUpdate>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The ref update action (lock/unlock) to perform"] - #[doc = "* `repository_id`: The name or ID of the repository."] - #[doc = "* `filter`: The name of the branch to lock/unlock"] - #[doc = "* `project`: Project ID or project name"] - pub fn update_ref( - &self, - organization: impl Into<String>, - body: impl Into<models::GitRefUpdate>, - repository_id: impl Into<String>, - filter: impl Into<String>, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRefList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) filter: Option<String>, - pub(crate) include_links: Option<bool>, - pub(crate) include_statuses: Option<bool>, - pub(crate) include_my_branches: Option<bool>, - pub(crate) latest_statuses_only: Option<bool>, - pub(crate) peel_tags: Option<bool>, - pub(crate) filter_contains: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - } - impl RequestBuilder { - #[doc = "\\[optional\\] A filter to apply to the refs (starts with)."] - pub fn filter(mut self, filter: impl Into<String>) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "\\[optional\\] Specifies if referenceLinks should be included in the result. default is false."] - pub fn include_links(mut self, include_links: bool) -> Self { - self.include_links = Some(include_links); - self - } - #[doc = "\\[optional\\] Includes up to the first 1000 commit statuses for each ref. The default value is false."] - pub fn include_statuses(mut self, include_statuses: bool) -> Self { - self.include_statuses = Some(include_statuses); - self - } - #[doc = "\\[optional\\] Includes only branches that the user owns, the branches the user favorites, and the default branch. The default value is false. Cannot be combined with the filter parameter."] - pub fn include_my_branches(mut self, include_my_branches: bool) -> Self { - self.include_my_branches = Some(include_my_branches); - self - } - #[doc = "(optional) Set to true to include only the tip commit status for each ref. This option requires `includeStatuses` to be true. The default value is false."] - pub fn latest_statuses_only(mut self, latest_statuses_only: bool) -> Self { - self.latest_statuses_only = Some(latest_statuses_only); - self - } - #[doc = "\\[optional\\] Annotated tags will populate the PeeledObjectId property. default is false."] - pub fn peel_tags(mut self, peel_tags: bool) -> Self { - self.peel_tags = Some(peel_tags); - self - } - #[doc = "\\[optional\\] A filter to apply to the refs (contains)."] - pub fn filter_contains(mut self, filter_contains: impl Into<String>) -> Self { - self.filter_contains = Some(filter_contains.into()); - self - } - #[doc = "\\[optional\\] Maximum number of refs to return. It cannot be bigger than 1000. If it is not provided but continuation token is, top will default to 100."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "The continuation token used for pagination."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/refs", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_refs { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRefUpdateResultList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRefUpdateResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::GitRefUpdate>, - pub(crate) repository_id: String, - pub(crate) project: String, - pub(crate) project_id: Option<String>, - } - 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<String>) -> Self { - self.project_id = Some(project_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/refs", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRefUpdateResultList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitRefUpdateResultList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_ref { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRef> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRef = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GitRefUpdate, - pub(crate) repository_id: String, - pub(crate) filter: String, - pub(crate) project: String, - pub(crate) project_id: Option<String>, - } - 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<String>) -> Self { - self.project_id = Some(project_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/refs", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRef>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRef>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRevert> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRevert = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod reverts { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/reverts", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRevert>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitRevert>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_revert { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve information about a revert operation for a specific branch."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_id`: ID of the repository."] - #[doc = "* `ref_name`: The GitAsyncRefOperationParameters generatedRefName used for the revert operation."] - pub fn get_revert_for_ref_name( - &self, - organization: impl Into<String>, - project: impl Into<String>, - repository_id: impl Into<String>, - ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_id`: ID of the repository."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GitAsyncRefOperationParameters>, - project: impl Into<String>, - repository_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `revert_id`: ID of the revert operation."] - #[doc = "* `repository_id`: ID of the repository."] - pub fn get_revert( - &self, - organization: impl Into<String>, - project: impl Into<String>, - revert_id: i32, - repository_id: impl Into<String>, - ) -> 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 get_revert_for_ref_name { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRevert> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRevert = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) repository_id: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/reverts", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let ref_name = &this.ref_name; - req.url_mut() - .query_pairs_mut() - .append_pair("refName", ref_name); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRevert>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRevert>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRevert> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRevert = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/reverts", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRevert>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRevert>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_revert { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRevert> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRevert = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) revert_id: i32, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/reverts/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.revert_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRevert>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitRevert>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRevert> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRevert = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) revert_id: i32, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/reverts/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.revert_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRevert>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitRevert>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod suggestions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve a pull request suggestion for a particular repository or team project."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: ID of the git repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve a pull request suggestion for a particular repository or team project."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: ID of the git repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - repository_id: repository_id.into(), - project: project.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitSuggestionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitSuggestionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/suggestions", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitSuggestionList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitSuggestionList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitSuggestionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitSuggestionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/suggestions", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitSuggestionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitSuggestionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod trees { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_id`: Repository Id."] + #[doc = "* `sha1`: SHA1 hash of the tree object."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + repository_id: impl Into<String>, + sha1: impl Into<String>, + project: impl Into<String>, + ) -> 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 get { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_id`: Repository Id."] - #[doc = "* `sha1`: SHA1 hash of the tree object."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - repository_id: impl Into<String>, - sha1: impl Into<String>, - project: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitTreeRef> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitTreeRef = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_id: String, - pub(crate) sha1: String, - pub(crate) project: String, - pub(crate) project_id: Option<String>, - pub(crate) recursive: Option<bool>, - pub(crate) file_name: Option<String>, - pub(crate) format: Option<String>, - } - impl RequestBuilder { - #[doc = "Project Id."] - pub fn project_id(mut self, project_id: impl Into<String>) -> Self { - self.project_id = Some(project_id.into()); - self - } - #[doc = "Search recursively. Include trees underneath this tree. Default is false."] - pub fn recursive(mut self, recursive: bool) -> Self { - self.recursive = Some(recursive); - self - } - #[doc = "Name to use if a .zip file is returned. Default is the object ID."] - pub fn file_name(mut self, file_name: impl Into<String>) -> Self { - self.file_name = Some(file_name.into()); - self - } - #[doc = "Use \"zip\". Defaults to the MIME type set in the Accept header."] - pub fn format(mut self, format: impl Into<String>) -> Self { - self.format = Some(format.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/trees/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_id, - &this.sha1 - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitTreeRef>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitTreeRef>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitTreeRef> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitTreeRef = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_id: String, + pub(crate) sha1: String, + pub(crate) project: String, + pub(crate) project_id: Option<String>, + pub(crate) recursive: Option<bool>, + pub(crate) file_name: Option<String>, + pub(crate) format: Option<String>, + } + impl RequestBuilder { + #[doc = "Project Id."] + pub fn project_id(mut self, project_id: impl Into<String>) -> Self { + self.project_id = Some(project_id.into()); + self + } + #[doc = "Search recursively. Include trees underneath this tree. Default is false."] + pub fn recursive(mut self, recursive: bool) -> Self { + self.recursive = Some(recursive); + self + } + #[doc = "Name to use if a .zip file is returned. Default is the object ID."] + pub fn file_name(mut self, file_name: impl Into<String>) -> Self { + self.file_name = Some(file_name.into()); + self + } + #[doc = "Use \"zip\". Defaults to the MIME type set in the Accept header."] + pub fn format(mut self, format: impl Into<String>) -> Self { + self.format = Some(format.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/trees/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_id, + &this.sha1 + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitTreeRef>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitTreeRef>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod merge_bases { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_name_or_id`: ID or name of the local repository."] + #[doc = "* `commit_id`: First commit, usually the tip of the target branch of the potential merge."] + #[doc = "* `other_commit_id`: Other commit, usually the tip of the source branch of the potential merge."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_name_or_id: impl Into<String>, + commit_id: impl Into<String>, + other_commit_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 list { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_name_or_id`: ID or name of the local repository."] - #[doc = "* `commit_id`: First commit, usually the tip of the target branch of the potential merge."] - #[doc = "* `other_commit_id`: Other commit, usually the tip of the source branch of the potential merge."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_name_or_id: impl Into<String>, - commit_id: impl Into<String>, - other_commit_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitCommitRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitCommitRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_name_or_id: String, - pub(crate) commit_id: String, - pub(crate) other_commit_id: String, - pub(crate) project: String, - pub(crate) other_collection_id: Option<String>, - pub(crate) other_repository_id: Option<String>, - } - impl RequestBuilder { - #[doc = "The collection ID where otherCommitId lives."] - pub fn other_collection_id(mut self, other_collection_id: impl Into<String>) -> Self { - self.other_collection_id = Some(other_collection_id.into()); - self - } - #[doc = "The repository ID where otherCommitId lives."] - pub fn other_repository_id(mut self, other_repository_id: impl Into<String>) -> Self { - self.other_repository_id = Some(other_repository_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits/{}/mergebases", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_name_or_id, - &this.commit_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitCommitRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitCommitRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitCommitRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_name_or_id: String, + pub(crate) commit_id: String, + pub(crate) other_commit_id: String, + pub(crate) project: String, + pub(crate) other_collection_id: Option<String>, + pub(crate) other_repository_id: Option<String>, + } + impl RequestBuilder { + #[doc = "The collection ID where otherCommitId lives."] + pub fn other_collection_id(mut self, other_collection_id: impl Into<String>) -> Self { + self.other_collection_id = Some(other_collection_id.into()); + self + } + #[doc = "The repository ID where otherCommitId lives."] + pub fn other_repository_id(mut self, other_repository_id: impl Into<String>) -> Self { + self.other_repository_id = Some(other_repository_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits/{}/mergebases", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_name_or_id, + &this.commit_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitCommitRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitCommitRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod forks { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve all forks of a repository in the collection."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_name_or_id`: The name or ID of the repository."] + #[doc = "* `collection_id`: Team project collection ID."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + repository_name_or_id: impl Into<String>, + collection_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_name_or_id`: The name or ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_fork_sync_requests( + &self, + organization: impl Into<String>, + repository_name_or_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 <a href=\"https://docs.microsoft.com/en-us/rest/api/vsts/git/repositories/create?view=azure-devops-rest-5.1\"> repositories endpoint</a>"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Source repository and ref mapping."] + #[doc = "* `repository_name_or_id`: The name or ID of the repository."] + #[doc = "* `project`: Project ID or project name"] + pub fn create_fork_sync_request( + &self, + organization: impl Into<String>, + body: impl Into<models::GitForkSyncRequestParameters>, + repository_name_or_id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `repository_name_or_id`: The name or ID of the repository."] + #[doc = "* `fork_sync_operation_id`: OperationId of the sync request."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_fork_sync_request( + &self, + organization: impl Into<String>, + repository_name_or_id: impl Into<String>, + fork_sync_operation_id: i32, + project: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitRepositoryRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitRepositoryRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/forks/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_name_or_id, + &this.collection_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(include_links) = &this.include_links { + req + .url_mut() + .query_pairs_mut() + .append_pair("includeLinks", &include_links.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitRepositoryRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitRepositoryRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_fork_sync_requests { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitForkSyncRequestList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitForkSyncRequestList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) repository_name_or_id: String, + pub(crate) project: String, + pub(crate) include_abandoned: Option<bool>, + pub(crate) include_links: Option<bool>, + } + 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); + self + } + #[doc = "Set to true to include links."] + pub fn include_links(mut self, include_links: bool) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_name_or_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitForkSyncRequestList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitForkSyncRequestList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_fork_sync_request { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitForkSyncRequest> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitForkSyncRequest = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_name_or_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitForkSyncRequest>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitForkSyncRequest>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_fork_sync_request { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve all forks of a repository in the collection."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_name_or_id`: The name or ID of the repository."] - #[doc = "* `collection_id`: Team project collection ID."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - repository_name_or_id: impl Into<String>, - collection_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_name_or_id`: The name or ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_fork_sync_requests( - &self, - organization: impl Into<String>, - repository_name_or_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 <a href=\"https://docs.microsoft.com/en-us/rest/api/vsts/git/repositories/create?view=azure-devops-rest-5.1\"> repositories endpoint</a>"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Source repository and ref mapping."] - #[doc = "* `repository_name_or_id`: The name or ID of the repository."] - #[doc = "* `project`: Project ID or project name"] - pub fn create_fork_sync_request( - &self, - organization: impl Into<String>, - body: impl Into<models::GitForkSyncRequestParameters>, - repository_name_or_id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `repository_name_or_id`: The name or ID of the repository."] - #[doc = "* `fork_sync_operation_id`: OperationId of the sync request."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_fork_sync_request( - &self, - organization: impl Into<String>, - repository_name_or_id: impl Into<String>, - fork_sync_operation_id: i32, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitRepositoryRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitRepositoryRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/forks/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_name_or_id, - &this.collection_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(include_links) = &this.include_links { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLinks", &include_links.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitRepositoryRefList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitRepositoryRefList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_fork_sync_requests { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitForkSyncRequestList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitForkSyncRequestList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) repository_name_or_id: String, - pub(crate) project: String, - pub(crate) include_abandoned: Option<bool>, - pub(crate) include_links: Option<bool>, - } - 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); - self - } - #[doc = "Set to true to include links."] - pub fn include_links(mut self, include_links: bool) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_name_or_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitForkSyncRequestList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GitForkSyncRequestList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_fork_sync_request { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitForkSyncRequest> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitForkSyncRequest = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_name_or_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitForkSyncRequest>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitForkSyncRequest>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_fork_sync_request { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitForkSyncRequest> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitForkSyncRequest = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_name_or_id, - &this.fork_sync_operation_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(include_links) = &this.include_links { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLinks", &include_links.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitForkSyncRequest>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitForkSyncRequest>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitForkSyncRequest> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitForkSyncRequest = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_name_or_id, + &this.fork_sync_operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(include_links) = &this.include_links { + req + .url_mut() + .query_pairs_mut() + .append_pair("includeLinks", &include_links.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitForkSyncRequest>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GitForkSyncRequest>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } pub mod merges { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Parents commitIds and merge commit messsage."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_name_or_id`: The name or ID of the repository."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GitMergeParameters>, + project: impl Into<String>, + repository_name_or_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository_name_or_id`: The name or ID of the repository."] + #[doc = "* `merge_operation_id`: OperationId of the merge request."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + repository_name_or_id: impl Into<String>, + 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, + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitMerge> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitMerge = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/merges", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_name_or_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitMerge>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitMerge>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Parents commitIds and merge commit messsage."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_name_or_id`: The name or ID of the repository."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GitMergeParameters>, - project: impl Into<String>, - repository_name_or_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository_name_or_id`: The name or ID of the repository."] - #[doc = "* `merge_operation_id`: OperationId of the merge request."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - repository_name_or_id: impl Into<String>, - 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, - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitMerge> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitMerge = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/merges", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_name_or_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitMerge>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitMerge>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GitMerge> { - let bytes = self.0.into_body().collect().await?; - let body: models::GitMerge = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/merges/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository_name_or_id, - &this.merge_operation_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(include_links) = &this.include_links { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLinks", &include_links.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GitMerge>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GitMerge>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GitMerge> { + let bytes = self.0.into_body().collect().await?; + let body: models::GitMerge = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/merges/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository_name_or_id, + &this.merge_operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(include_links) = &this.include_links { + req + .url_mut() + .query_pairs_mut() + .append_pair("includeLinks", &include_links.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GitMerge>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GitMerge>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/git/models.rs b/azure_devops_rust_api/src/git/models.rs index 8bb6e63b..20bc1019 100644 --- a/azure_devops_rust_api/src/git/models.rs +++ b/azure_devops_rust_api/src/git/models.rs @@ -7,7869 +7,7680 @@ use serde::{Deserialize, Serialize, Serializer}; use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AdvSecEnablementStatus { - #[doc = "Enabled by VSID"] - #[serde( - rename = "changedById", - default, - skip_serializing_if = "Option::is_none" - )] - pub changed_by_id: Option<String>, - #[doc = "Enabled changed on datetime"] - #[serde( - rename = "changedOnDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub changed_on_date: Option<time::OffsetDateTime>, - #[doc = "Enabled status 0 disabled, 1 enabled, Null never explicitly set, always whatever project is, ya this should probably be an enum somewhere"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[doc = "Enabled changed on datetime To Be Removed M223 +"] - #[serde( - rename = "enabledChangedOnDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub enabled_changed_on_date: Option<time::OffsetDateTime>, - #[doc = "ProjectId"] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "RepositoryId"] - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, -} -impl AdvSecEnablementStatus { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AdvSecEnablementUpdate { - #[doc = "New status"] - #[serde(rename = "newStatus", default, skip_serializing_if = "Option::is_none")] - pub new_status: Option<bool>, - #[doc = "ProjectId"] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "RepositoryId Actual RepositoryId to Modify or Magic Repository Id \"FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF\" for ALL Repositories for that project"] - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, -} -impl AdvSecEnablementUpdate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AssociatedWorkItem { - #[serde( - rename = "assignedTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_to: Option<String>, - #[doc = "Id of associated the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[doc = "REST Url of the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] - pub web_url: Option<String>, - #[serde( - rename = "workItemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type: Option<String>, + #[serde( + rename = "assignedTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_to: Option<String>, + #[doc = "Id of associated the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[doc = "REST Url of the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] + pub web_url: Option<String>, + #[serde( + rename = "workItemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type: Option<String>, } impl AssociatedWorkItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AsyncGitOperationNotification { - #[serde( - rename = "operationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_id: Option<i32>, + #[serde( + rename = "operationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_id: Option<i32>, } impl AsyncGitOperationNotification { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AsyncRefOperationCommitLevelEventNotification { - #[serde(flatten)] - pub async_git_operation_notification: AsyncGitOperationNotification, - #[serde(rename = "commitId", default, skip_serializing_if = "Option::is_none")] - pub commit_id: Option<String>, + #[serde(flatten)] + pub async_git_operation_notification: AsyncGitOperationNotification, + #[serde(rename = "commitId", default, skip_serializing_if = "Option::is_none")] + pub commit_id: Option<String>, } impl AsyncRefOperationCommitLevelEventNotification { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AsyncRefOperationCompletedNotification { - #[serde(flatten)] - pub async_git_operation_notification: AsyncGitOperationNotification, - #[serde( - rename = "newRefName", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_ref_name: Option<String>, + #[serde(flatten)] + pub async_git_operation_notification: AsyncGitOperationNotification, + #[serde( + rename = "newRefName", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_ref_name: Option<String>, } impl AsyncRefOperationCompletedNotification { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AsyncRefOperationConflictNotification { - #[serde(flatten)] - pub async_ref_operation_commit_level_event_notification: - AsyncRefOperationCommitLevelEventNotification, + #[serde(flatten)] + pub async_ref_operation_commit_level_event_notification: + AsyncRefOperationCommitLevelEventNotification, } impl AsyncRefOperationConflictNotification { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AsyncRefOperationGeneralFailureNotification { - #[serde(flatten)] - pub async_git_operation_notification: AsyncGitOperationNotification, + #[serde(flatten)] + pub async_git_operation_notification: AsyncGitOperationNotification, } impl AsyncRefOperationGeneralFailureNotification { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AsyncRefOperationProgressNotification { - #[serde(flatten)] - pub async_ref_operation_commit_level_event_notification: - AsyncRefOperationCommitLevelEventNotification, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub progress: Option<f64>, + #[serde(flatten)] + pub async_ref_operation_commit_level_event_notification: + AsyncRefOperationCommitLevelEventNotification, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub progress: Option<f64>, } impl AsyncRefOperationProgressNotification { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AsyncRefOperationTimeoutNotification { - #[serde(flatten)] - pub async_git_operation_notification: AsyncGitOperationNotification, + #[serde(flatten)] + pub async_git_operation_notification: AsyncGitOperationNotification, } impl AsyncRefOperationTimeoutNotification { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Meta data for a file attached to an artifact."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Attachment { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<IdentityRef>, - #[doc = "Content hash of on-disk representation of file content. Its calculated by the server by using SHA1 hash function."] - #[serde( - rename = "contentHash", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_hash: Option<String>, - #[doc = "The time the attachment was uploaded."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "The description of the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The display name of the attachment. Can't be null or empty."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Id of the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "The url to download the content of the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<IdentityRef>, + #[doc = "Content hash of on-disk representation of file content. Its calculated by the server by using SHA1 hash function."] + #[serde( + rename = "contentHash", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_hash: Option<String>, + #[doc = "The time the attachment was uploaded."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "The description of the attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The display name of the attachment. Can't be null or empty."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Id of the attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "The url to download the content of the attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Attachment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AttachmentList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Attachment>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Attachment>, } impl AttachmentList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for an auto-complete update on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AutoCompleteUpdatedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl AutoCompleteUpdatedEvent { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Used by AdvSec to return billable committers."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BillableCommitter { - #[doc = "RepositoryId commit was pushed to."] - #[serde(rename = "repoId", default, skip_serializing_if = "Option::is_none")] - pub repo_id: Option<String>, - #[doc = "Visual Studio ID /Team Foundation ID"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub vsid: Option<String>, -} -impl BillableCommitter { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BillableCommitterDetail { - #[serde(flatten)] - pub billable_committer: BillableCommitter, - #[doc = "ID (SHA-1) of the commit."] - #[serde(rename = "commitId", default, skip_serializing_if = "Option::is_none")] - pub commit_id: Option<String>, - #[doc = "Committer email address after parsing."] - #[serde( - rename = "committerEmail", - default, - skip_serializing_if = "Option::is_none" - )] - pub committer_email: Option<String>, - #[doc = "Time reported by the commit."] - #[serde( - rename = "commitTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub commit_time: Option<time::OffsetDateTime>, - #[doc = "Project Id commit was pushed to."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "Project name commit was pushed to."] - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[doc = "Time of the push that contained the commit."] - #[serde( - rename = "pushedTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub pushed_time: Option<time::OffsetDateTime>, - #[doc = "Push Id that contained the commit."] - #[serde(rename = "pushId", default, skip_serializing_if = "Option::is_none")] - pub push_id: Option<i32>, - #[doc = "Repository name commit was pushed to."] - #[serde(rename = "repoName", default, skip_serializing_if = "Option::is_none")] - pub repo_name: Option<String>, -} -impl BillableCommitterDetail { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for a source/target branch update on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BranchUpdatedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, - #[doc = "If true, the source branch of the pull request was updated"] - #[serde( - rename = "isSourceUpdate", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_source_update: Option<bool>, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, + #[doc = "If true, the source branch of the pull request was updated"] + #[serde( + rename = "isSourceUpdate", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_source_update: Option<bool>, } impl BranchUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Change { - #[doc = "The type of change that was made to the item."] - #[serde(rename = "changeType")] - pub change_type: change::ChangeType, - pub item: serde_json::Value, + #[doc = "The type of change that was made to the item."] + #[serde(rename = "changeType")] + pub change_type: change::ChangeType, + pub item: serde_json::Value, } impl Change { - pub fn new(change_type: change::ChangeType, item: serde_json::Value) -> Self { - Self { change_type, item } - } + pub fn new(change_type: change::ChangeType, item: serde_json::Value) -> Self { + Self { change_type, item } + } } pub mod change { - use super::*; - #[doc = "The type of change that was made to the item."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ChangeType { - #[serde(rename = "none")] - None, - #[serde(rename = "add")] - Add, - #[serde(rename = "edit")] - Edit, - #[serde(rename = "encoding")] - Encoding, - #[serde(rename = "rename")] - Rename, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "undelete")] - Undelete, - #[serde(rename = "branch")] - Branch, - #[serde(rename = "merge")] - Merge, - #[serde(rename = "lock")] - Lock, - #[serde(rename = "rollback")] - Rollback, - #[serde(rename = "sourceRename")] - SourceRename, - #[serde(rename = "targetRename")] - TargetRename, - #[serde(rename = "property")] - Property, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "The type of change that was made to the item."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ChangeType { + #[serde(rename = "none")] + None, + #[serde(rename = "add")] + Add, + #[serde(rename = "edit")] + Edit, + #[serde(rename = "encoding")] + Encoding, + #[serde(rename = "rename")] + Rename, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "undelete")] + Undelete, + #[serde(rename = "branch")] + Branch, + #[serde(rename = "merge")] + Merge, + #[serde(rename = "lock")] + Lock, + #[serde(rename = "rollback")] + Rollback, + #[serde(rename = "sourceRename")] + SourceRename, + #[serde(rename = "targetRename")] + TargetRename, + #[serde(rename = "property")] + Property, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChangeCountDictionary {} impl ChangeCountDictionary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChangeList { - #[serde( - rename = "allChangesIncluded", - default, - skip_serializing_if = "Option::is_none" - )] - pub all_changes_included: Option<bool>, - #[serde( - rename = "changeCounts", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_counts: Option<serde_json::Value>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub changes: Vec<Change>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - rename = "commentTruncated", - default, - skip_serializing_if = "Option::is_none" - )] - pub comment_truncated: Option<bool>, - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub notes: Vec<CheckinNote>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[serde( - rename = "ownerDisplayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub owner_display_name: Option<String>, - #[serde(rename = "ownerId", default, skip_serializing_if = "Option::is_none")] - pub owner_id: Option<String>, - #[serde( - rename = "sortDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub sort_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde( + rename = "allChangesIncluded", + default, + skip_serializing_if = "Option::is_none" + )] + pub all_changes_included: Option<bool>, + #[serde( + rename = "changeCounts", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_counts: Option<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub changes: Vec<Change>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + rename = "commentTruncated", + default, + skip_serializing_if = "Option::is_none" + )] + pub comment_truncated: Option<bool>, + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub notes: Vec<CheckinNote>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[serde( + rename = "ownerDisplayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub owner_display_name: Option<String>, + #[serde(rename = "ownerId", default, skip_serializing_if = "Option::is_none")] + pub owner_id: Option<String>, + #[serde( + rename = "sortDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub sort_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl ChangeList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Criteria used in a search for change lists"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChangeListSearchCriteria { - #[doc = "If provided, a version descriptor to compare against base"] - #[serde( - rename = "compareVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub compare_version: Option<String>, - #[doc = "If true, don't include delete history entries"] - #[serde( - rename = "excludeDeletes", - default, - skip_serializing_if = "Option::is_none" - )] - pub exclude_deletes: Option<bool>, - #[doc = "Whether or not to follow renames for the given item being queried"] - #[serde( - rename = "followRenames", - default, - skip_serializing_if = "Option::is_none" - )] - pub follow_renames: Option<bool>, - #[doc = "If provided, only include history entries created after this date (string)"] - #[serde(rename = "fromDate", default, skip_serializing_if = "Option::is_none")] - pub from_date: Option<String>, - #[doc = "If provided, a version descriptor for the earliest change list to include"] - #[serde( - rename = "fromVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub from_version: Option<String>, - #[doc = "Path of item to search under. If the itemPaths memebr is used then it will take precedence over this."] - #[serde(rename = "itemPath", default, skip_serializing_if = "Option::is_none")] - pub item_path: Option<String>, - #[doc = "List of item paths to search under. If this member is used then itemPath will be ignored."] - #[serde( - rename = "itemPaths", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub item_paths: Vec<String>, - #[doc = "Version of the items to search"] - #[serde( - rename = "itemVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub item_version: Option<String>, - #[doc = "Number of results to skip (used when clicking more...)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub skip: Option<i32>, - #[doc = "If provided, only include history entries created before this date (string)"] - #[serde(rename = "toDate", default, skip_serializing_if = "Option::is_none")] - pub to_date: Option<String>, - #[doc = "If provided, the maximum number of history entries to return"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub top: Option<i32>, - #[doc = "If provided, a version descriptor for the latest change list to include"] - #[serde(rename = "toVersion", default, skip_serializing_if = "Option::is_none")] - pub to_version: Option<String>, - #[doc = "Alias or display name of user who made the changes"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub user: Option<String>, + #[doc = "If provided, a version descriptor to compare against base"] + #[serde( + rename = "compareVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub compare_version: Option<String>, + #[doc = "If true, don't include delete history entries"] + #[serde( + rename = "excludeDeletes", + default, + skip_serializing_if = "Option::is_none" + )] + pub exclude_deletes: Option<bool>, + #[doc = "Whether or not to follow renames for the given item being queried"] + #[serde( + rename = "followRenames", + default, + skip_serializing_if = "Option::is_none" + )] + pub follow_renames: Option<bool>, + #[doc = "If provided, only include history entries created after this date (string)"] + #[serde(rename = "fromDate", default, skip_serializing_if = "Option::is_none")] + pub from_date: Option<String>, + #[doc = "If provided, a version descriptor for the earliest change list to include"] + #[serde( + rename = "fromVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub from_version: Option<String>, + #[doc = "Path of item to search under. If the itemPaths memebr is used then it will take precedence over this."] + #[serde(rename = "itemPath", default, skip_serializing_if = "Option::is_none")] + pub item_path: Option<String>, + #[doc = "List of item paths to search under. If this member is used then itemPath will be ignored."] + #[serde( + rename = "itemPaths", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub item_paths: Vec<String>, + #[doc = "Version of the items to search"] + #[serde( + rename = "itemVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub item_version: Option<String>, + #[doc = "Number of results to skip (used when clicking more...)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub skip: Option<i32>, + #[doc = "If provided, only include history entries created before this date (string)"] + #[serde(rename = "toDate", default, skip_serializing_if = "Option::is_none")] + pub to_date: Option<String>, + #[doc = "If provided, the maximum number of history entries to return"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub top: Option<i32>, + #[doc = "If provided, a version descriptor for the latest change list to include"] + #[serde(rename = "toVersion", default, skip_serializing_if = "Option::is_none")] + pub to_version: Option<String>, + #[doc = "Alias or display name of user who made the changes"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub user: Option<String>, } impl ChangeListSearchCriteria { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckinNote { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl CheckinNote { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a comment which is one of potentially many in a comment thread."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Comment { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<IdentityRef>, - #[doc = "The comment type at the time of creation."] - #[serde( - rename = "commentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub comment_type: Option<comment::CommentType>, - #[doc = "The comment content."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub content: Option<String>, - #[doc = "The comment ID. IDs start at 1 and are unique to a pull request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i64>, - #[doc = "Whether or not this comment was soft-deleted."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "The date the comment's content was last updated."] - #[serde( - rename = "lastContentUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_content_updated_date: Option<time::OffsetDateTime>, - #[doc = "The date the comment was last updated."] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "The ID of the parent comment. This is used for replies."] - #[serde( - rename = "parentCommentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_comment_id: Option<i64>, - #[doc = "The date the comment was first published."] - #[serde( - rename = "publishedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub published_date: Option<time::OffsetDateTime>, - #[doc = "A list of the users who have liked this comment."] - #[serde( - rename = "usersLiked", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub users_liked: Vec<IdentityRef>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<IdentityRef>, + #[doc = "The comment type at the time of creation."] + #[serde( + rename = "commentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub comment_type: Option<comment::CommentType>, + #[doc = "The comment content."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content: Option<String>, + #[doc = "The comment ID. IDs start at 1 and are unique to a pull request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i64>, + #[doc = "Whether or not this comment was soft-deleted."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "The date the comment's content was last updated."] + #[serde( + rename = "lastContentUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_content_updated_date: Option<time::OffsetDateTime>, + #[doc = "The date the comment was last updated."] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "The ID of the parent comment. This is used for replies."] + #[serde( + rename = "parentCommentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_comment_id: Option<i64>, + #[doc = "The date the comment was first published."] + #[serde( + rename = "publishedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub published_date: Option<time::OffsetDateTime>, + #[doc = "A list of the users who have liked this comment."] + #[serde( + rename = "usersLiked", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub users_liked: Vec<IdentityRef>, } impl Comment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod comment { - use super::*; - #[doc = "The comment type at the time of creation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum CommentType { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "text")] - Text, - #[serde(rename = "codeChange")] - CodeChange, - #[serde(rename = "system")] - System, - } + use super::*; + #[doc = "The comment type at the time of creation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum CommentType { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "text")] + Text, + #[serde(rename = "codeChange")] + CodeChange, + #[serde(rename = "system")] + System, + } } #[doc = "Comment iteration context is used to identify which diff was being viewed when the thread was created."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentIterationContext { - #[doc = "The iteration of the file on the left side of the diff when the thread was created. If this value is equal to SecondComparingIteration, then this version is the common commit between the source and target branches of the pull request."] - #[serde( - rename = "firstComparingIteration", - default, - skip_serializing_if = "Option::is_none" - )] - pub first_comparing_iteration: Option<i64>, - #[doc = "The iteration of the file on the right side of the diff when the thread was created."] - #[serde( - rename = "secondComparingIteration", - default, - skip_serializing_if = "Option::is_none" - )] - pub second_comparing_iteration: Option<i64>, + #[doc = "The iteration of the file on the left side of the diff when the thread was created. If this value is equal to SecondComparingIteration, then this version is the common commit between the source and target branches of the pull request."] + #[serde( + rename = "firstComparingIteration", + default, + skip_serializing_if = "Option::is_none" + )] + pub first_comparing_iteration: Option<i64>, + #[doc = "The iteration of the file on the right side of the diff when the thread was created."] + #[serde( + rename = "secondComparingIteration", + default, + skip_serializing_if = "Option::is_none" + )] + pub second_comparing_iteration: Option<i64>, } impl CommentIterationContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Comment>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Comment>, } impl CommentList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentPosition { - #[doc = "The line number of a thread's position. Starts at 1."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub line: Option<i32>, - #[doc = "The character offset of a thread's position inside of a line. Starts at 0."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub offset: Option<i32>, + #[doc = "The line number of a thread's position. Starts at 1."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub line: Option<i32>, + #[doc = "The character offset of a thread's position inside of a line. Starts at 0."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub offset: Option<i32>, } impl CommentPosition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a comment thread of a pull request. A thread contains meta data about the file it was left on along with one or more comments (an initial comment and the subsequent replies)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentThread { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "A list of the comments."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub comments: Vec<Comment>, - #[doc = "The comment thread id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Set of identities related to this thread"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identities: Option<serde_json::Value>, - #[doc = "Specify if the thread is deleted which happens when all comments are deleted."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "The time this thread was last updated."] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "The time this thread was published."] - #[serde( - rename = "publishedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub published_date: Option<time::OffsetDateTime>, - #[doc = "The status of the comment thread."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<comment_thread::Status>, - #[doc = ""] - #[serde( - rename = "threadContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub thread_context: Option<CommentThreadContext>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "A list of the comments."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub comments: Vec<Comment>, + #[doc = "The comment thread id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Set of identities related to this thread"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identities: Option<serde_json::Value>, + #[doc = "Specify if the thread is deleted which happens when all comments are deleted."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "The time this thread was last updated."] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "The time this thread was published."] + #[serde( + rename = "publishedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub published_date: Option<time::OffsetDateTime>, + #[doc = "The status of the comment thread."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<comment_thread::Status>, + #[doc = ""] + #[serde( + rename = "threadContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub thread_context: Option<CommentThreadContext>, } impl CommentThread { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod comment_thread { - use super::*; - #[doc = "The status of the comment thread."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "active")] - Active, - #[serde(rename = "fixed")] - Fixed, - #[serde(rename = "wontFix")] - WontFix, - #[serde(rename = "closed")] - Closed, - #[serde(rename = "byDesign")] - ByDesign, - #[serde(rename = "pending")] - Pending, - } + use super::*; + #[doc = "The status of the comment thread."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "active")] + Active, + #[serde(rename = "fixed")] + Fixed, + #[serde(rename = "wontFix")] + WontFix, + #[serde(rename = "closed")] + Closed, + #[serde(rename = "byDesign")] + ByDesign, + #[serde(rename = "pending")] + Pending, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentThreadContext { - #[doc = "File path relative to the root of the repository. It's up to the client to use any path format."] - #[serde(rename = "filePath", default, skip_serializing_if = "Option::is_none")] - pub file_path: Option<String>, - #[doc = ""] - #[serde( - rename = "leftFileEnd", - default, - skip_serializing_if = "Option::is_none" - )] - pub left_file_end: Option<CommentPosition>, - #[doc = ""] - #[serde( - rename = "leftFileStart", - default, - skip_serializing_if = "Option::is_none" - )] - pub left_file_start: Option<CommentPosition>, - #[doc = ""] - #[serde( - rename = "rightFileEnd", - default, - skip_serializing_if = "Option::is_none" - )] - pub right_file_end: Option<CommentPosition>, - #[doc = ""] - #[serde( - rename = "rightFileStart", - default, - skip_serializing_if = "Option::is_none" - )] - pub right_file_start: Option<CommentPosition>, + #[doc = "File path relative to the root of the repository. It's up to the client to use any path format."] + #[serde(rename = "filePath", default, skip_serializing_if = "Option::is_none")] + pub file_path: Option<String>, + #[doc = ""] + #[serde( + rename = "leftFileEnd", + default, + skip_serializing_if = "Option::is_none" + )] + pub left_file_end: Option<CommentPosition>, + #[doc = ""] + #[serde( + rename = "leftFileStart", + default, + skip_serializing_if = "Option::is_none" + )] + pub left_file_start: Option<CommentPosition>, + #[doc = ""] + #[serde( + rename = "rightFileEnd", + default, + skip_serializing_if = "Option::is_none" + )] + pub right_file_end: Option<CommentPosition>, + #[doc = ""] + #[serde( + rename = "rightFileStart", + default, + skip_serializing_if = "Option::is_none" + )] + pub right_file_start: Option<CommentPosition>, } impl CommentThreadContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Comment tracking criteria is used to identify which iteration context the thread has been tracked to (if any) along with some detail about the original position and filename."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentTrackingCriteria { - #[doc = "The iteration of the file on the left side of the diff that the thread will be tracked to. Threads were tracked if this is greater than 0."] - #[serde( - rename = "firstComparingIteration", - default, - skip_serializing_if = "Option::is_none" - )] - pub first_comparing_iteration: Option<i32>, - #[doc = "Original filepath the thread was created on before tracking. This will be different than the current thread filepath if the file in question was renamed in a later iteration."] - #[serde( - rename = "origFilePath", - default, - skip_serializing_if = "Option::is_none" - )] - pub orig_file_path: Option<String>, - #[doc = ""] - #[serde( - rename = "origLeftFileEnd", - default, - skip_serializing_if = "Option::is_none" - )] - pub orig_left_file_end: Option<CommentPosition>, - #[doc = ""] - #[serde( - rename = "origLeftFileStart", - default, - skip_serializing_if = "Option::is_none" - )] - pub orig_left_file_start: Option<CommentPosition>, - #[doc = ""] - #[serde( - rename = "origRightFileEnd", - default, - skip_serializing_if = "Option::is_none" - )] - pub orig_right_file_end: Option<CommentPosition>, - #[doc = ""] - #[serde( - rename = "origRightFileStart", - default, - skip_serializing_if = "Option::is_none" - )] - pub orig_right_file_start: Option<CommentPosition>, - #[doc = "The iteration of the file on the right side of the diff that the thread will be tracked to. Threads were tracked if this is greater than 0."] - #[serde( - rename = "secondComparingIteration", - default, - skip_serializing_if = "Option::is_none" - )] - pub second_comparing_iteration: Option<i32>, + #[doc = "The iteration of the file on the left side of the diff that the thread will be tracked to. Threads were tracked if this is greater than 0."] + #[serde( + rename = "firstComparingIteration", + default, + skip_serializing_if = "Option::is_none" + )] + pub first_comparing_iteration: Option<i32>, + #[doc = "Original filepath the thread was created on before tracking. This will be different than the current thread filepath if the file in question was renamed in a later iteration."] + #[serde( + rename = "origFilePath", + default, + skip_serializing_if = "Option::is_none" + )] + pub orig_file_path: Option<String>, + #[doc = ""] + #[serde( + rename = "origLeftFileEnd", + default, + skip_serializing_if = "Option::is_none" + )] + pub orig_left_file_end: Option<CommentPosition>, + #[doc = ""] + #[serde( + rename = "origLeftFileStart", + default, + skip_serializing_if = "Option::is_none" + )] + pub orig_left_file_start: Option<CommentPosition>, + #[doc = ""] + #[serde( + rename = "origRightFileEnd", + default, + skip_serializing_if = "Option::is_none" + )] + pub orig_right_file_end: Option<CommentPosition>, + #[doc = ""] + #[serde( + rename = "origRightFileStart", + default, + skip_serializing_if = "Option::is_none" + )] + pub orig_right_file_start: Option<CommentPosition>, + #[doc = "The iteration of the file on the right side of the diff that the thread will be tracked to. Threads were tracked if this is greater than 0."] + #[serde( + rename = "secondComparingIteration", + default, + skip_serializing_if = "Option::is_none" + )] + pub second_comparing_iteration: Option<i32>, } impl CommentTrackingCriteria { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for a completion errors on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CompletionErrorsEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, - #[doc = "The error message associated with the completion error"] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, + #[doc = "The error message associated with the completion error"] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, } impl CompletionErrorsEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for a discussions update on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DiscussionsUpdatedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl DiscussionsUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FileContentMetadata { - #[serde( - rename = "contentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_type: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encoding: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub extension: Option<String>, - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[serde(rename = "isBinary", default, skip_serializing_if = "Option::is_none")] - pub is_binary: Option<bool>, - #[serde(rename = "isImage", default, skip_serializing_if = "Option::is_none")] - pub is_image: Option<bool>, - #[serde(rename = "vsLink", default, skip_serializing_if = "Option::is_none")] - pub vs_link: Option<String>, + #[serde( + rename = "contentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_type: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encoding: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub extension: Option<String>, + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[serde(rename = "isBinary", default, skip_serializing_if = "Option::is_none")] + pub is_binary: Option<bool>, + #[serde(rename = "isImage", default, skip_serializing_if = "Option::is_none")] + pub is_image: Option<bool>, + #[serde(rename = "vsLink", default, skip_serializing_if = "Option::is_none")] + pub vs_link: Option<String>, } impl FileContentMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Provides properties that describe file differences"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FileDiff { - #[doc = "The collection of line diff blocks"] - #[serde( - rename = "lineDiffBlocks", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub line_diff_blocks: Vec<LineDiffBlock>, - #[doc = "Original path of item if different from current path."] - #[serde( - rename = "originalPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub original_path: Option<String>, - #[doc = "Current path of item"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[doc = "The collection of line diff blocks"] + #[serde( + rename = "lineDiffBlocks", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub line_diff_blocks: Vec<LineDiffBlock>, + #[doc = "Original path of item if different from current path."] + #[serde( + rename = "originalPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub original_path: Option<String>, + #[doc = "Current path of item"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl FileDiff { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Provides parameters that describe inputs for the file diff"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FileDiffParams { - #[doc = "Original path of the file"] - #[serde( - rename = "originalPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub original_path: Option<String>, - #[doc = "Current path of the file"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[doc = "Original path of the file"] + #[serde( + rename = "originalPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub original_path: Option<String>, + #[doc = "Current path of the file"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl FileDiffParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Provides properties that describe inputs for the file diffs"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FileDiffsCriteria { - #[doc = "Commit ID of the base version"] - #[serde( - rename = "baseVersionCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub base_version_commit: Option<String>, - #[doc = "List of parameters for each of the files for which we need to get the file diff"] - #[serde( - rename = "fileDiffParams", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub file_diff_params: Vec<FileDiffParams>, - #[doc = "Commit ID of the target version"] - #[serde( - rename = "targetVersionCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_version_commit: Option<String>, + #[doc = "Commit ID of the base version"] + #[serde( + rename = "baseVersionCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub base_version_commit: Option<String>, + #[doc = "List of parameters for each of the files for which we need to get the file diff"] + #[serde( + rename = "fileDiffParams", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub file_diff_params: Vec<FileDiffParams>, + #[doc = "Commit ID of the target version"] + #[serde( + rename = "targetVersionCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_version_commit: Option<String>, } impl FileDiffsCriteria { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A Git annotated tag."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitAnnotatedTag { - #[doc = "The tagging Message"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "The name of the annotated tag."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The objectId (Sha1Id) of the tag."] - #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] - pub object_id: Option<String>, - #[doc = "User info and date for Git operations."] - #[serde(rename = "taggedBy", default, skip_serializing_if = "Option::is_none")] - pub tagged_by: Option<GitUserDate>, - #[doc = "Git object identifier and type information."] - #[serde( - rename = "taggedObject", - default, - skip_serializing_if = "Option::is_none" - )] - pub tagged_object: Option<GitObject>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The tagging Message"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "The name of the annotated tag."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The objectId (Sha1Id) of the tag."] + #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] + pub object_id: Option<String>, + #[doc = "User info and date for Git operations."] + #[serde(rename = "taggedBy", default, skip_serializing_if = "Option::is_none")] + pub tagged_by: Option<GitUserDate>, + #[doc = "Git object identifier and type information."] + #[serde( + rename = "taggedObject", + default, + skip_serializing_if = "Option::is_none" + )] + pub tagged_object: Option<GitObject>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitAnnotatedTag { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitAsyncRefOperation { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "Information about the progress of a cherry pick or revert operation."] - #[serde( - rename = "detailedStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub detailed_status: Option<GitAsyncRefOperationDetail>, - #[doc = "Parameters that are provided in the request body when requesting to cherry pick or revert."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<GitAsyncRefOperationParameters>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<git_async_ref_operation::Status>, - #[doc = "A URL that can be used to make further requests for status about the operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "Information about the progress of a cherry pick or revert operation."] + #[serde( + rename = "detailedStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub detailed_status: Option<GitAsyncRefOperationDetail>, + #[doc = "Parameters that are provided in the request body when requesting to cherry pick or revert."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<GitAsyncRefOperationParameters>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<git_async_ref_operation::Status>, + #[doc = "A URL that can be used to make further requests for status about the operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitAsyncRefOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_async_ref_operation { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "queued")] - Queued, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "queued")] + Queued, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = "Information about the progress of a cherry pick or revert operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitAsyncRefOperationDetail { - #[doc = "Indicates if there was a conflict generated when trying to cherry pick or revert the changes."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub conflict: Option<bool>, - #[doc = "The current commit from the list of commits that are being cherry picked or reverted."] - #[serde( - rename = "currentCommitId", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_commit_id: Option<String>, - #[doc = "Detailed information about why the cherry pick or revert failed to complete."] - #[serde( - rename = "failureMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub failure_message: Option<String>, - #[doc = "A number between 0 and 1 indicating the percent complete of the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub progress: Option<f64>, - #[doc = "Provides a status code that indicates the reason the cherry pick or revert failed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<git_async_ref_operation_detail::Status>, - #[doc = "Indicates if the operation went beyond the maximum time allowed for a cherry pick or revert operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timedout: Option<bool>, + #[doc = "Indicates if there was a conflict generated when trying to cherry pick or revert the changes."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conflict: Option<bool>, + #[doc = "The current commit from the list of commits that are being cherry picked or reverted."] + #[serde( + rename = "currentCommitId", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_commit_id: Option<String>, + #[doc = "Detailed information about why the cherry pick or revert failed to complete."] + #[serde( + rename = "failureMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub failure_message: Option<String>, + #[doc = "A number between 0 and 1 indicating the percent complete of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub progress: Option<f64>, + #[doc = "Provides a status code that indicates the reason the cherry pick or revert failed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<git_async_ref_operation_detail::Status>, + #[doc = "Indicates if the operation went beyond the maximum time allowed for a cherry pick or revert operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timedout: Option<bool>, } impl GitAsyncRefOperationDetail { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_async_ref_operation_detail { - use super::*; - #[doc = "Provides a status code that indicates the reason the cherry pick or revert failed."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "none")] - None, - #[serde(rename = "invalidRefName")] - InvalidRefName, - #[serde(rename = "refNameConflict")] - RefNameConflict, - #[serde(rename = "createBranchPermissionRequired")] - CreateBranchPermissionRequired, - #[serde(rename = "writePermissionRequired")] - WritePermissionRequired, - #[serde(rename = "targetBranchDeleted")] - TargetBranchDeleted, - #[serde(rename = "gitObjectTooLarge")] - GitObjectTooLarge, - #[serde(rename = "operationIndentityNotFound")] - OperationIndentityNotFound, - #[serde(rename = "asyncOperationNotFound")] - AsyncOperationNotFound, - #[serde(rename = "other")] - Other, - #[serde(rename = "emptyCommitterSignature")] - EmptyCommitterSignature, - } + use super::*; + #[doc = "Provides a status code that indicates the reason the cherry pick or revert failed."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "none")] + None, + #[serde(rename = "invalidRefName")] + InvalidRefName, + #[serde(rename = "refNameConflict")] + RefNameConflict, + #[serde(rename = "createBranchPermissionRequired")] + CreateBranchPermissionRequired, + #[serde(rename = "writePermissionRequired")] + WritePermissionRequired, + #[serde(rename = "targetBranchDeleted")] + TargetBranchDeleted, + #[serde(rename = "gitObjectTooLarge")] + GitObjectTooLarge, + #[serde(rename = "operationIndentityNotFound")] + OperationIndentityNotFound, + #[serde(rename = "asyncOperationNotFound")] + AsyncOperationNotFound, + #[serde(rename = "other")] + Other, + #[serde(rename = "emptyCommitterSignature")] + EmptyCommitterSignature, + } } #[doc = "Parameters that are provided in the request body when requesting to cherry pick or revert."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitAsyncRefOperationParameters { - #[doc = "Proposed target branch name for the cherry pick or revert operation."] - #[serde( - rename = "generatedRefName", - default, - skip_serializing_if = "Option::is_none" - )] - pub generated_ref_name: Option<String>, - #[doc = "The target branch for the cherry pick or revert operation."] - #[serde( - rename = "ontoRefName", - default, - skip_serializing_if = "Option::is_none" - )] - pub onto_ref_name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<GitRepository>, - #[doc = "GitAsyncRefOperationSource specifies the pull request or list of commits to use when making a cherry pick and revert operation request. Only one should be provided."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<GitAsyncRefOperationSource>, + #[doc = "Proposed target branch name for the cherry pick or revert operation."] + #[serde( + rename = "generatedRefName", + default, + skip_serializing_if = "Option::is_none" + )] + pub generated_ref_name: Option<String>, + #[doc = "The target branch for the cherry pick or revert operation."] + #[serde( + rename = "ontoRefName", + default, + skip_serializing_if = "Option::is_none" + )] + pub onto_ref_name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<GitRepository>, + #[doc = "GitAsyncRefOperationSource specifies the pull request or list of commits to use when making a cherry pick and revert operation request. Only one should be provided."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<GitAsyncRefOperationSource>, } impl GitAsyncRefOperationParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "GitAsyncRefOperationSource specifies the pull request or list of commits to use when making a cherry pick and revert operation request. Only one should be provided."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitAsyncRefOperationSource { - #[doc = "A list of commits to cherry pick or revert"] - #[serde( - rename = "commitList", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub commit_list: Vec<GitCommitRef>, - #[doc = "Id of the pull request to cherry pick or revert"] - #[serde( - rename = "pullRequestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_id: Option<i32>, + #[doc = "A list of commits to cherry pick or revert"] + #[serde( + rename = "commitList", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub commit_list: Vec<GitCommitRef>, + #[doc = "Id of the pull request to cherry pick or revert"] + #[serde( + rename = "pullRequestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_id: Option<i32>, } impl GitAsyncRefOperationSource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitBaseVersionDescriptor { - #[serde(flatten)] - pub git_version_descriptor: GitVersionDescriptor, - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - #[serde( - rename = "baseVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub base_version: Option<String>, - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - #[serde( - rename = "baseVersionOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub base_version_options: Option<git_base_version_descriptor::BaseVersionOptions>, - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - #[serde( - rename = "baseVersionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub base_version_type: Option<git_base_version_descriptor::BaseVersionType>, + #[serde(flatten)] + pub git_version_descriptor: GitVersionDescriptor, + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + #[serde( + rename = "baseVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub base_version: Option<String>, + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + #[serde( + rename = "baseVersionOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub base_version_options: Option<git_base_version_descriptor::BaseVersionOptions>, + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + #[serde( + rename = "baseVersionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub base_version_type: Option<git_base_version_descriptor::BaseVersionType>, } impl GitBaseVersionDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_base_version_descriptor { - use super::*; - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum BaseVersionOptions { - #[serde(rename = "none")] - None, - #[serde(rename = "previousChange")] - PreviousChange, - #[serde(rename = "firstParent")] - FirstParent, - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum BaseVersionType { - #[serde(rename = "branch")] - Branch, - #[serde(rename = "tag")] - Tag, - #[serde(rename = "commit")] - Commit, - } + use super::*; + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum BaseVersionOptions { + #[serde(rename = "none")] + None, + #[serde(rename = "previousChange")] + PreviousChange, + #[serde(rename = "firstParent")] + FirstParent, + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum BaseVersionType { + #[serde(rename = "branch")] + Branch, + #[serde(rename = "tag")] + Tag, + #[serde(rename = "commit")] + Commit, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitBlobRef { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "SHA1 hash of git object"] - #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] - pub object_id: Option<String>, - #[doc = "Size of blob content (in bytes)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "SHA1 hash of git object"] + #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] + pub object_id: Option<String>, + #[doc = "Size of blob content (in bytes)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitBlobRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Ahead and behind counts for a particular ref."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitBranchStats { - #[doc = "Number of commits ahead."] - #[serde( - rename = "aheadCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub ahead_count: Option<i32>, - #[doc = "Number of commits behind."] - #[serde( - rename = "behindCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub behind_count: Option<i32>, - #[doc = "Provides properties that describe a Git commit and associated metadata."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub commit: Option<GitCommitRef>, - #[doc = "True if this is the result for the base version."] - #[serde( - rename = "isBaseVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_base_version: Option<bool>, - #[doc = "Name of the ref."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Number of commits ahead."] + #[serde( + rename = "aheadCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub ahead_count: Option<i32>, + #[doc = "Number of commits behind."] + #[serde( + rename = "behindCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub behind_count: Option<i32>, + #[doc = "Provides properties that describe a Git commit and associated metadata."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub commit: Option<GitCommitRef>, + #[doc = "True if this is the result for the base version."] + #[serde( + rename = "isBaseVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_base_version: Option<bool>, + #[doc = "Name of the ref."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl GitBranchStats { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitBranchStatsList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitBranchStats>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitBranchStats>, } impl GitBranchStatsList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GitChange { - #[serde(flatten)] - pub change: Change, + #[serde(flatten)] + pub change: Change, } impl GitChange { - pub fn new(change: Change) -> Self { - Self { change } - } + pub fn new(change: Change) -> Self { + Self { change } + } } #[doc = "This object is returned from Cherry Pick operations and provides the id and status of the operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitCherryPick { - #[serde(flatten)] - pub git_async_ref_operation: GitAsyncRefOperation, - #[serde( - rename = "cherryPickId", - default, - skip_serializing_if = "Option::is_none" - )] - pub cherry_pick_id: Option<i32>, + #[serde(flatten)] + pub git_async_ref_operation: GitAsyncRefOperation, + #[serde( + rename = "cherryPickId", + default, + skip_serializing_if = "Option::is_none" + )] + pub cherry_pick_id: Option<i32>, } impl GitCherryPick { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GitCommit { - #[serde(flatten)] - pub git_commit_ref: GitCommitRef, - #[serde(rename = "treeId", default, skip_serializing_if = "Option::is_none")] - pub tree_id: Option<String>, + #[serde(flatten)] + pub git_commit_ref: GitCommitRef, + #[serde(rename = "treeId", default, skip_serializing_if = "Option::is_none")] + pub tree_id: Option<String>, } impl GitCommit { - pub fn new(git_commit_ref: GitCommitRef) -> Self { - Self { - git_commit_ref, - tree_id: None, - } + pub fn new(git_commit_ref: GitCommitRef) -> Self { + Self { + git_commit_ref, + tree_id: None, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitCommitChanges { - #[serde( - rename = "changeCounts", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_counts: Option<serde_json::Value>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub changes: Vec<GitChange>, + #[serde( + rename = "changeCounts", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_counts: Option<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub changes: Vec<GitChange>, } impl GitCommitChanges { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitCommitDiffs { - #[serde( - rename = "aheadCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub ahead_count: Option<i32>, - #[serde( - rename = "allChangesIncluded", - default, - skip_serializing_if = "Option::is_none" - )] - pub all_changes_included: Option<bool>, - #[serde( - rename = "baseCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub base_commit: Option<String>, - #[serde( - rename = "behindCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub behind_count: Option<i32>, - #[serde( - rename = "changeCounts", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_counts: Option<serde_json::Value>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub changes: Vec<GitChange>, - #[serde( - rename = "commonCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub common_commit: Option<String>, - #[serde( - rename = "targetCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_commit: Option<String>, + #[serde( + rename = "aheadCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub ahead_count: Option<i32>, + #[serde( + rename = "allChangesIncluded", + default, + skip_serializing_if = "Option::is_none" + )] + pub all_changes_included: Option<bool>, + #[serde( + rename = "baseCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub base_commit: Option<String>, + #[serde( + rename = "behindCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub behind_count: Option<i32>, + #[serde( + rename = "changeCounts", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_counts: Option<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub changes: Vec<GitChange>, + #[serde( + rename = "commonCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub common_commit: Option<String>, + #[serde( + rename = "targetCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_commit: Option<String>, } impl GitCommitDiffs { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Provides properties that describe a Git commit and associated metadata."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GitCommitRef { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "User info and date for Git operations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<GitUserDate>, - #[serde( - rename = "changeCounts", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_counts: Option<serde_json::Value>, - #[doc = "An enumeration of the changes included with the commit."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub changes: Vec<GitChange>, - #[doc = "Comment or message of the commit."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Indicates if the comment is truncated from the full Git commit comment message."] - #[serde( - rename = "commentTruncated", - default, - skip_serializing_if = "Option::is_none" - )] - pub comment_truncated: Option<bool>, - #[doc = "ID (SHA-1) of the commit."] - #[serde(rename = "commitId")] - pub commit_id: String, - #[doc = "User info and date for Git operations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub committer: Option<GitUserDate>, - #[doc = "Indicates that commit contains too many changes to be displayed"] - #[serde( - rename = "commitTooManyChanges", - default, - skip_serializing_if = "Option::is_none" - )] - pub commit_too_many_changes: Option<bool>, - #[doc = "An enumeration of the parent commit IDs for this commit."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub parents: Vec<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub push: Option<GitPushRef>, - #[doc = "Remote URL path to the commit."] - #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] - pub remote_url: Option<String>, - #[doc = "A list of status metadata from services and extensions that may associate additional information to the commit."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub statuses: Vec<GitStatus>, - #[doc = "REST URL for this resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "A list of workitems associated with this commit."] - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<ResourceRef>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "User info and date for Git operations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<GitUserDate>, + #[serde( + rename = "changeCounts", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_counts: Option<serde_json::Value>, + #[doc = "An enumeration of the changes included with the commit."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub changes: Vec<GitChange>, + #[doc = "Comment or message of the commit."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Indicates if the comment is truncated from the full Git commit comment message."] + #[serde( + rename = "commentTruncated", + default, + skip_serializing_if = "Option::is_none" + )] + pub comment_truncated: Option<bool>, + #[doc = "ID (SHA-1) of the commit."] + #[serde(rename = "commitId")] + pub commit_id: String, + #[doc = "User info and date for Git operations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub committer: Option<GitUserDate>, + #[doc = "An enumeration of the parent commit IDs for this commit."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub parents: Vec<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub push: Option<GitPushRef>, + #[doc = "Remote URL path to the commit."] + #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] + pub remote_url: Option<String>, + #[doc = "A list of status metadata from services and extensions that may associate additional information to the commit."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub statuses: Vec<GitStatus>, + #[doc = "REST URL for this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "A list of workitems associated with this commit."] + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<ResourceRef>, } impl GitCommitRef { - pub fn new(commit_id: String) -> Self { - Self { - links: None, - author: None, - change_counts: None, - changes: Vec::new(), - comment: None, - comment_truncated: None, - commit_id, - committer: None, - commit_too_many_changes: None, - parents: Vec::new(), - push: None, - remote_url: None, - statuses: Vec::new(), - url: None, - work_items: Vec::new(), - } - } + pub fn new(commit_id: String) -> Self { + Self { + links: None, + author: None, + change_counts: None, + changes: Vec::new(), + comment: None, + comment_truncated: None, + commit_id, + committer: None, + parents: Vec::new(), + push: None, + remote_url: None, + statuses: Vec::new(), + url: None, + work_items: Vec::new(), + } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitCommitRefList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitCommitRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitCommitRef>, } impl GitCommitRefList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitCommitToCreate { - #[doc = ""] - #[serde(rename = "baseRef", default, skip_serializing_if = "Option::is_none")] - pub base_ref: Option<GitRef>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - rename = "pathActions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub path_actions: Vec<GitPathAction>, + #[doc = ""] + #[serde(rename = "baseRef", default, skip_serializing_if = "Option::is_none")] + pub base_ref: Option<GitRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + rename = "pathActions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub path_actions: Vec<GitPathAction>, } impl GitCommitToCreate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflict { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde( - rename = "conflictId", - default, - skip_serializing_if = "Option::is_none" - )] - pub conflict_id: Option<i32>, - #[serde( - rename = "conflictPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub conflict_path: Option<String>, - #[serde( - rename = "conflictType", - default, - skip_serializing_if = "Option::is_none" - )] - pub conflict_type: Option<git_conflict::ConflictType>, - #[doc = "Provides properties that describe a Git commit and associated metadata."] - #[serde( - rename = "mergeBaseCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_base_commit: Option<GitCommitRef>, - #[doc = ""] - #[serde( - rename = "mergeOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_origin: Option<GitMergeOriginRef>, - #[doc = "Provides properties that describe a Git commit and associated metadata."] - #[serde( - rename = "mergeSourceCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_source_commit: Option<GitCommitRef>, - #[doc = "Provides properties that describe a Git commit and associated metadata."] - #[serde( - rename = "mergeTargetCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_target_commit: Option<GitCommitRef>, - #[serde( - rename = "resolutionError", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_error: Option<git_conflict::ResolutionError>, - #[serde( - rename = "resolutionStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_status: Option<git_conflict::ResolutionStatus>, - #[doc = ""] - #[serde( - rename = "resolvedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolved_by: Option<IdentityRef>, - #[serde( - rename = "resolvedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub resolved_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde( + rename = "conflictId", + default, + skip_serializing_if = "Option::is_none" + )] + pub conflict_id: Option<i32>, + #[serde( + rename = "conflictPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub conflict_path: Option<String>, + #[serde( + rename = "conflictType", + default, + skip_serializing_if = "Option::is_none" + )] + pub conflict_type: Option<git_conflict::ConflictType>, + #[doc = "Provides properties that describe a Git commit and associated metadata."] + #[serde( + rename = "mergeBaseCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_base_commit: Option<GitCommitRef>, + #[doc = ""] + #[serde( + rename = "mergeOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_origin: Option<GitMergeOriginRef>, + #[doc = "Provides properties that describe a Git commit and associated metadata."] + #[serde( + rename = "mergeSourceCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_source_commit: Option<GitCommitRef>, + #[doc = "Provides properties that describe a Git commit and associated metadata."] + #[serde( + rename = "mergeTargetCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_target_commit: Option<GitCommitRef>, + #[serde( + rename = "resolutionError", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_error: Option<git_conflict::ResolutionError>, + #[serde( + rename = "resolutionStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_status: Option<git_conflict::ResolutionStatus>, + #[doc = ""] + #[serde( + rename = "resolvedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolved_by: Option<IdentityRef>, + #[serde( + rename = "resolvedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub resolved_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitConflict { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_conflict { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ConflictType { - #[serde(rename = "none")] - None, - #[serde(rename = "addAdd")] - AddAdd, - #[serde(rename = "addRename")] - AddRename, - #[serde(rename = "deleteEdit")] - DeleteEdit, - #[serde(rename = "deleteRename")] - DeleteRename, - #[serde(rename = "directoryFile")] - DirectoryFile, - #[serde(rename = "directoryChild")] - DirectoryChild, - #[serde(rename = "editDelete")] - EditDelete, - #[serde(rename = "editEdit")] - EditEdit, - #[serde(rename = "fileDirectory")] - FileDirectory, - #[serde(rename = "rename1to2")] - Rename1to2, - #[serde(rename = "rename2to1")] - Rename2to1, - #[serde(rename = "renameAdd")] - RenameAdd, - #[serde(rename = "renameDelete")] - RenameDelete, - #[serde(rename = "renameRename")] - RenameRename, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ResolutionError { - #[serde(rename = "none")] - None, - #[serde(rename = "mergeContentNotFound")] - MergeContentNotFound, - #[serde(rename = "pathInUse")] - PathInUse, - #[serde(rename = "invalidPath")] - InvalidPath, - #[serde(rename = "unknownAction")] - UnknownAction, - #[serde(rename = "unknownMergeType")] - UnknownMergeType, - #[serde(rename = "otherError")] - OtherError, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ResolutionStatus { - #[serde(rename = "unresolved")] - Unresolved, - #[serde(rename = "partiallyResolved")] - PartiallyResolved, - #[serde(rename = "resolved")] - Resolved, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ConflictType { + #[serde(rename = "none")] + None, + #[serde(rename = "addAdd")] + AddAdd, + #[serde(rename = "addRename")] + AddRename, + #[serde(rename = "deleteEdit")] + DeleteEdit, + #[serde(rename = "deleteRename")] + DeleteRename, + #[serde(rename = "directoryFile")] + DirectoryFile, + #[serde(rename = "directoryChild")] + DirectoryChild, + #[serde(rename = "editDelete")] + EditDelete, + #[serde(rename = "editEdit")] + EditEdit, + #[serde(rename = "fileDirectory")] + FileDirectory, + #[serde(rename = "rename1to2")] + Rename1to2, + #[serde(rename = "rename2to1")] + Rename2to1, + #[serde(rename = "renameAdd")] + RenameAdd, + #[serde(rename = "renameDelete")] + RenameDelete, + #[serde(rename = "renameRename")] + RenameRename, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ResolutionError { + #[serde(rename = "none")] + None, + #[serde(rename = "mergeContentNotFound")] + MergeContentNotFound, + #[serde(rename = "pathInUse")] + PathInUse, + #[serde(rename = "invalidPath")] + InvalidPath, + #[serde(rename = "unknownAction")] + UnknownAction, + #[serde(rename = "unknownMergeType")] + UnknownMergeType, + #[serde(rename = "otherError")] + OtherError, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ResolutionStatus { + #[serde(rename = "unresolved")] + Unresolved, + #[serde(rename = "partiallyResolved")] + PartiallyResolved, + #[serde(rename = "resolved")] + Resolved, + } } #[doc = "Data object for AddAdd conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictAddAdd { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionMergeContent>, - #[doc = ""] - #[serde( - rename = "sourceBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde( - rename = "targetBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_blob: Option<GitBlobRef>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionMergeContent>, + #[doc = ""] + #[serde( + rename = "sourceBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde( + rename = "targetBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_blob: Option<GitBlobRef>, } impl GitConflictAddAdd { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data object for RenameAdd conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictAddRename { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] - pub base_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionPathConflict>, - #[doc = ""] - #[serde( - rename = "sourceBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde( - rename = "targetBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_blob: Option<GitBlobRef>, - #[serde( - rename = "targetOriginalPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_original_path: Option<String>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] + pub base_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionPathConflict>, + #[doc = ""] + #[serde( + rename = "sourceBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde( + rename = "targetBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_blob: Option<GitBlobRef>, + #[serde( + rename = "targetOriginalPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_original_path: Option<String>, } impl GitConflictAddRename { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data object for EditDelete conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictDeleteEdit { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] - pub base_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionPickOneAction>, - #[doc = ""] - #[serde( - rename = "targetBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_blob: Option<GitBlobRef>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] + pub base_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionPickOneAction>, + #[doc = ""] + #[serde( + rename = "targetBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_blob: Option<GitBlobRef>, } impl GitConflictDeleteEdit { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data object for RenameDelete conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictDeleteRename { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] - pub base_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionPickOneAction>, - #[doc = ""] - #[serde( - rename = "targetBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_blob: Option<GitBlobRef>, - #[serde( - rename = "targetNewPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_new_path: Option<String>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] + pub base_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionPickOneAction>, + #[doc = ""] + #[serde( + rename = "targetBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_blob: Option<GitBlobRef>, + #[serde( + rename = "targetNewPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_new_path: Option<String>, } impl GitConflictDeleteRename { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data object for FileDirectory conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictDirectoryFile { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionPathConflict>, - #[doc = ""] - #[serde( - rename = "sourceTree", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_tree: Option<GitTreeRef>, - #[doc = ""] - #[serde( - rename = "targetBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_blob: Option<GitBlobRef>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionPathConflict>, + #[doc = ""] + #[serde( + rename = "sourceTree", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_tree: Option<GitTreeRef>, + #[doc = ""] + #[serde( + rename = "targetBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_blob: Option<GitBlobRef>, } impl GitConflictDirectoryFile { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data object for DeleteEdit conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictEditDelete { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] - pub base_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionPickOneAction>, - #[doc = ""] - #[serde( - rename = "sourceBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_blob: Option<GitBlobRef>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] + pub base_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionPickOneAction>, + #[doc = ""] + #[serde( + rename = "sourceBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_blob: Option<GitBlobRef>, } impl GitConflictEditDelete { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data object for EditEdit conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictEditEdit { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] - pub base_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionMergeContent>, - #[doc = ""] - #[serde( - rename = "sourceBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde( - rename = "targetBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_blob: Option<GitBlobRef>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] + pub base_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionMergeContent>, + #[doc = ""] + #[serde( + rename = "sourceBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde( + rename = "targetBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_blob: Option<GitBlobRef>, } impl GitConflictEditEdit { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data object for DirectoryFile conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictFileDirectory { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionPathConflict>, - #[doc = ""] - #[serde( - rename = "sourceBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde( - rename = "targetTree", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_tree: Option<GitTreeRef>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionPathConflict>, + #[doc = ""] + #[serde( + rename = "sourceBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde( + rename = "targetTree", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_tree: Option<GitTreeRef>, } impl GitConflictFileDirectory { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data object for Rename1to2 conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictRename1to2 { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] - pub base_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionRename1to2>, - #[doc = ""] - #[serde( - rename = "sourceBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_blob: Option<GitBlobRef>, - #[serde( - rename = "sourceNewPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_new_path: Option<String>, - #[doc = ""] - #[serde( - rename = "targetBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_blob: Option<GitBlobRef>, - #[serde( - rename = "targetNewPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_new_path: Option<String>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] + pub base_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionRename1to2>, + #[doc = ""] + #[serde( + rename = "sourceBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_blob: Option<GitBlobRef>, + #[serde( + rename = "sourceNewPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_new_path: Option<String>, + #[doc = ""] + #[serde( + rename = "targetBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_blob: Option<GitBlobRef>, + #[serde( + rename = "targetNewPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_new_path: Option<String>, } impl GitConflictRename1to2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data object for Rename2to1 conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictRename2to1 { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionPathConflict>, - #[doc = ""] - #[serde( - rename = "sourceNewBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_new_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde( - rename = "sourceOriginalBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_original_blob: Option<GitBlobRef>, - #[serde( - rename = "sourceOriginalPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_original_path: Option<String>, - #[doc = ""] - #[serde( - rename = "targetNewBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_new_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde( - rename = "targetOriginalBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_original_blob: Option<GitBlobRef>, - #[serde( - rename = "targetOriginalPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_original_path: Option<String>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionPathConflict>, + #[doc = ""] + #[serde( + rename = "sourceNewBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_new_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde( + rename = "sourceOriginalBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_original_blob: Option<GitBlobRef>, + #[serde( + rename = "sourceOriginalPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_original_path: Option<String>, + #[doc = ""] + #[serde( + rename = "targetNewBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_new_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde( + rename = "targetOriginalBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_original_blob: Option<GitBlobRef>, + #[serde( + rename = "targetOriginalPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_original_path: Option<String>, } impl GitConflictRename2to1 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data object for AddRename conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictRenameAdd { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] - pub base_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionPathConflict>, - #[doc = ""] - #[serde( - rename = "sourceBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_blob: Option<GitBlobRef>, - #[serde( - rename = "sourceOriginalPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_original_path: Option<String>, - #[doc = ""] - #[serde( - rename = "targetBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_blob: Option<GitBlobRef>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] + pub base_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionPathConflict>, + #[doc = ""] + #[serde( + rename = "sourceBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_blob: Option<GitBlobRef>, + #[serde( + rename = "sourceOriginalPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_original_path: Option<String>, + #[doc = ""] + #[serde( + rename = "targetBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_blob: Option<GitBlobRef>, } impl GitConflictRenameAdd { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data object for DeleteRename conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictRenameDelete { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] - pub base_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionPickOneAction>, - #[doc = ""] - #[serde( - rename = "sourceBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_blob: Option<GitBlobRef>, - #[serde( - rename = "sourceNewPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_new_path: Option<String>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] + pub base_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionPickOneAction>, + #[doc = ""] + #[serde( + rename = "sourceBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_blob: Option<GitBlobRef>, + #[serde( + rename = "sourceNewPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_new_path: Option<String>, } impl GitConflictRenameDelete { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data object for RenameRename conflict"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictRenameRename { - #[serde(flatten)] - pub git_conflict: GitConflict, - #[doc = ""] - #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] - pub base_blob: Option<GitBlobRef>, - #[serde( - rename = "originalPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub original_path: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resolution: Option<GitResolutionMergeContent>, - #[doc = ""] - #[serde( - rename = "sourceBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_blob: Option<GitBlobRef>, - #[doc = ""] - #[serde( - rename = "targetBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_blob: Option<GitBlobRef>, + #[serde(flatten)] + pub git_conflict: GitConflict, + #[doc = ""] + #[serde(rename = "baseBlob", default, skip_serializing_if = "Option::is_none")] + pub base_blob: Option<GitBlobRef>, + #[serde( + rename = "originalPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub original_path: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolution: Option<GitResolutionMergeContent>, + #[doc = ""] + #[serde( + rename = "sourceBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_blob: Option<GitBlobRef>, + #[doc = ""] + #[serde( + rename = "targetBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_blob: Option<GitBlobRef>, } impl GitConflictRenameRename { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitConflictUpdateResult { - #[doc = "Conflict ID that was provided by input"] - #[serde( - rename = "conflictId", - default, - skip_serializing_if = "Option::is_none" - )] - pub conflict_id: Option<i32>, - #[doc = "Reason for failing"] - #[serde( - rename = "customMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub custom_message: Option<String>, - #[doc = ""] - #[serde( - rename = "updatedConflict", - default, - skip_serializing_if = "Option::is_none" - )] - pub updated_conflict: Option<GitConflict>, - #[doc = "Status of the update on the server"] - #[serde( - rename = "updateStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub update_status: Option<git_conflict_update_result::UpdateStatus>, + #[doc = "Conflict ID that was provided by input"] + #[serde( + rename = "conflictId", + default, + skip_serializing_if = "Option::is_none" + )] + pub conflict_id: Option<i32>, + #[doc = "Reason for failing"] + #[serde( + rename = "customMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub custom_message: Option<String>, + #[doc = ""] + #[serde( + rename = "updatedConflict", + default, + skip_serializing_if = "Option::is_none" + )] + pub updated_conflict: Option<GitConflict>, + #[doc = "Status of the update on the server"] + #[serde( + rename = "updateStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub update_status: Option<git_conflict_update_result::UpdateStatus>, } impl GitConflictUpdateResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_conflict_update_result { - use super::*; - #[doc = "Status of the update on the server"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum UpdateStatus { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "badRequest")] - BadRequest, - #[serde(rename = "invalidResolution")] - InvalidResolution, - #[serde(rename = "unsupportedConflictType")] - UnsupportedConflictType, - #[serde(rename = "notFound")] - NotFound, - } + use super::*; + #[doc = "Status of the update on the server"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum UpdateStatus { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "badRequest")] + BadRequest, + #[serde(rename = "invalidResolution")] + InvalidResolution, + #[serde(rename = "unsupportedConflictType")] + UnsupportedConflictType, + #[serde(rename = "notFound")] + NotFound, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitDeletedRepository { - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde(rename = "deletedBy", default, skip_serializing_if = "Option::is_none")] - pub deleted_by: Option<IdentityRef>, - #[serde( - rename = "deletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deleted_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(rename = "deletedBy", default, skip_serializing_if = "Option::is_none")] + pub deleted_by: Option<IdentityRef>, + #[serde( + rename = "deletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deleted_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, } impl GitDeletedRepository { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitDeletedRepositoryList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitDeletedRepository>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitDeletedRepository>, } impl GitDeletedRepositoryList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitFilePathsCollection { - #[serde(rename = "commitId", default, skip_serializing_if = "Option::is_none")] - pub commit_id: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub paths: Vec<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(rename = "commitId", default, skip_serializing_if = "Option::is_none")] + pub commit_id: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub paths: Vec<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitFilePathsCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Status information about a requested fork operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitForkOperationStatusDetail { - #[doc = "All valid steps for the forking process"] - #[serde( - rename = "allSteps", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub all_steps: Vec<String>, - #[doc = "Index into AllSteps for the current step"] - #[serde( - rename = "currentStep", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_step: Option<i32>, - #[doc = "Error message if the operation failed."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, + #[doc = "All valid steps for the forking process"] + #[serde( + rename = "allSteps", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub all_steps: Vec<String>, + #[doc = "Index into AllSteps for the current step"] + #[serde( + rename = "currentStep", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_step: Option<i32>, + #[doc = "Error message if the operation failed."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, } impl GitForkOperationStatusDetail { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Information about a fork ref."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GitForkRef { - #[serde(flatten)] - pub git_ref: GitRef, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<GitRepository>, + #[serde(flatten)] + pub git_ref: GitRef, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<GitRepository>, } impl GitForkRef { - pub fn new(git_ref: GitRef) -> Self { - Self { - git_ref, - repository: None, - } + pub fn new(git_ref: GitRef) -> Self { + Self { + git_ref, + repository: None, } + } } #[doc = "Request to sync data between two forks."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitForkSyncRequest { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Status information about a requested fork operation."] - #[serde( - rename = "detailedStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub detailed_status: Option<GitForkOperationStatusDetail>, - #[doc = "Unique identifier for the operation."] - #[serde( - rename = "operationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_id: Option<i32>, - #[doc = "Globally unique key for a repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<GlobalGitRepositoryKey>, - #[doc = "If supplied, the set of ref mappings to use when performing a \"sync\" or create. If missing, all refs will be synchronized."] - #[serde( - rename = "sourceToTargetRefs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub source_to_target_refs: Vec<SourceToTargetRef>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<git_fork_sync_request::Status>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Status information about a requested fork operation."] + #[serde( + rename = "detailedStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub detailed_status: Option<GitForkOperationStatusDetail>, + #[doc = "Unique identifier for the operation."] + #[serde( + rename = "operationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_id: Option<i32>, + #[doc = "Globally unique key for a repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<GlobalGitRepositoryKey>, + #[doc = "If supplied, the set of ref mappings to use when performing a \"sync\" or create. If missing, all refs will be synchronized."] + #[serde( + rename = "sourceToTargetRefs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub source_to_target_refs: Vec<SourceToTargetRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<git_fork_sync_request::Status>, } impl GitForkSyncRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_fork_sync_request { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "queued")] - Queued, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "queued")] + Queued, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitForkSyncRequestList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitForkSyncRequest>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitForkSyncRequest>, } impl GitForkSyncRequestList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Parameters for creating a fork request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitForkSyncRequestParameters { - #[doc = "Globally unique key for a repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<GlobalGitRepositoryKey>, - #[doc = "If supplied, the set of ref mappings to use when performing a \"sync\" or create. If missing, all refs will be synchronized."] - #[serde( - rename = "sourceToTargetRefs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub source_to_target_refs: Vec<SourceToTargetRef>, + #[doc = "Globally unique key for a repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<GlobalGitRepositoryKey>, + #[doc = "If supplied, the set of ref mappings to use when performing a \"sync\" or create. If missing, all refs will be synchronized."] + #[serde( + rename = "sourceToTargetRefs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub source_to_target_refs: Vec<SourceToTargetRef>, } impl GitForkSyncRequestParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GitForkTeamProjectReference { - #[serde(flatten)] - pub team_project_reference: TeamProjectReference, + #[serde(flatten)] + pub team_project_reference: TeamProjectReference, } impl GitForkTeamProjectReference { - pub fn new(team_project_reference: TeamProjectReference) -> Self { - Self { - team_project_reference, - } + pub fn new(team_project_reference: TeamProjectReference) -> Self { + Self { + team_project_reference, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitImportFailedEvent { - #[serde( - rename = "sourceRepositoryName", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_repository_name: Option<String>, - #[doc = ""] - #[serde( - rename = "targetRepository", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_repository: Option<GitRepository>, + #[serde( + rename = "sourceRepositoryName", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_repository_name: Option<String>, + #[doc = ""] + #[serde( + rename = "targetRepository", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_repository: Option<GitRepository>, } impl GitImportFailedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Parameter for creating a git import request when source is Git version control"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitImportGitSource { - #[doc = "Tells if this is a sync request or not"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub overwrite: Option<bool>, - #[doc = "Url for the source repo"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Tells if this is a sync request or not"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overwrite: Option<bool>, + #[doc = "Url for the source repo"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitImportGitSource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A request to import data from a remote source control system."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitImportRequest { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Additional status information about an import request."] - #[serde( - rename = "detailedStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub detailed_status: Option<GitImportStatusDetail>, - #[doc = "The unique identifier for this import request."] - #[serde( - rename = "importRequestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub import_request_id: Option<i32>, - #[doc = "Parameters for creating an import request"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<GitImportRequestParameters>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<GitRepository>, - #[doc = "Current status of the import."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<git_import_request::Status>, - #[doc = "A link back to this import request resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Additional status information about an import request."] + #[serde( + rename = "detailedStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub detailed_status: Option<GitImportStatusDetail>, + #[doc = "The unique identifier for this import request."] + #[serde( + rename = "importRequestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub import_request_id: Option<i32>, + #[doc = "Parameters for creating an import request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<GitImportRequestParameters>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<GitRepository>, + #[doc = "Current status of the import."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<git_import_request::Status>, + #[doc = "A link back to this import request resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitImportRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_import_request { - use super::*; - #[doc = "Current status of the import."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "queued")] - Queued, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[doc = "Current status of the import."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "queued")] + Queued, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitImportRequestList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitImportRequest>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitImportRequest>, } impl GitImportRequestList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Parameters for creating an import request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitImportRequestParameters { - #[doc = "Option to delete service endpoint when import is done"] - #[serde( - rename = "deleteServiceEndpointAfterImportIsDone", - default, - skip_serializing_if = "Option::is_none" - )] - pub delete_service_endpoint_after_import_is_done: Option<bool>, - #[doc = "Parameter for creating a git import request when source is Git version control"] - #[serde(rename = "gitSource", default, skip_serializing_if = "Option::is_none")] - pub git_source: Option<GitImportGitSource>, - #[doc = "Service Endpoint for connection to external endpoint"] - #[serde( - rename = "serviceEndpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_id: Option<String>, - #[doc = "Parameter for creating a git import request when source is tfvc version control"] - #[serde( - rename = "tfvcSource", - default, - skip_serializing_if = "Option::is_none" - )] - pub tfvc_source: Option<GitImportTfvcSource>, + #[doc = "Option to delete service endpoint when import is done"] + #[serde( + rename = "deleteServiceEndpointAfterImportIsDone", + default, + skip_serializing_if = "Option::is_none" + )] + pub delete_service_endpoint_after_import_is_done: Option<bool>, + #[doc = "Parameter for creating a git import request when source is Git version control"] + #[serde(rename = "gitSource", default, skip_serializing_if = "Option::is_none")] + pub git_source: Option<GitImportGitSource>, + #[doc = "Service Endpoint for connection to external endpoint"] + #[serde( + rename = "serviceEndpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_id: Option<String>, + #[doc = "Parameter for creating a git import request when source is tfvc version control"] + #[serde( + rename = "tfvcSource", + default, + skip_serializing_if = "Option::is_none" + )] + pub tfvc_source: Option<GitImportTfvcSource>, } impl GitImportRequestParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Additional status information about an import request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitImportStatusDetail { - #[doc = "All valid steps for the import process"] - #[serde( - rename = "allSteps", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub all_steps: Vec<String>, - #[doc = "Index into AllSteps for the current step"] - #[serde( - rename = "currentStep", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_step: Option<i32>, - #[doc = "Error message if the operation failed."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, + #[doc = "All valid steps for the import process"] + #[serde( + rename = "allSteps", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub all_steps: Vec<String>, + #[doc = "Index into AllSteps for the current step"] + #[serde( + rename = "currentStep", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_step: Option<i32>, + #[doc = "Error message if the operation failed."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, } impl GitImportStatusDetail { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitImportSucceededEvent { - #[serde( - rename = "sourceRepositoryName", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_repository_name: Option<String>, - #[doc = ""] - #[serde( - rename = "targetRepository", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_repository: Option<GitRepository>, + #[serde( + rename = "sourceRepositoryName", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_repository_name: Option<String>, + #[doc = ""] + #[serde( + rename = "targetRepository", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_repository: Option<GitRepository>, } impl GitImportSucceededEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Parameter for creating a git import request when source is tfvc version control"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitImportTfvcSource { - #[doc = "Set true to import History, false otherwise"] - #[serde( - rename = "importHistory", - default, - skip_serializing_if = "Option::is_none" - )] - pub import_history: Option<bool>, - #[doc = "Get history for last n days (max allowed value is 180 days)"] - #[serde( - rename = "importHistoryDurationInDays", - default, - skip_serializing_if = "Option::is_none" - )] - pub import_history_duration_in_days: Option<i32>, - #[doc = "Path which we want to import (this can be copied from Path Control in Explorer)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[doc = "Set true to import History, false otherwise"] + #[serde( + rename = "importHistory", + default, + skip_serializing_if = "Option::is_none" + )] + pub import_history: Option<bool>, + #[doc = "Get history for last n days (max allowed value is 180 days)"] + #[serde( + rename = "importHistoryDurationInDays", + default, + skip_serializing_if = "Option::is_none" + )] + pub import_history_duration_in_days: Option<i32>, + #[doc = "Path which we want to import (this can be copied from Path Control in Explorer)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl GitImportTfvcSource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitItem { - #[serde(flatten)] - pub item_model: ItemModel, - #[doc = "SHA1 of commit item was fetched at"] - #[serde(rename = "commitId", default, skip_serializing_if = "Option::is_none")] - pub commit_id: Option<String>, - #[doc = "Type of object (Commit, Tree, Blob, Tag, ...)"] - #[serde( - rename = "gitObjectType", - default, - skip_serializing_if = "Option::is_none" - )] - pub git_object_type: Option<git_item::GitObjectType>, - #[doc = "Provides properties that describe a Git commit and associated metadata."] - #[serde( - rename = "latestProcessedChange", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_processed_change: Option<GitCommitRef>, - #[doc = "Git object id"] - #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] - pub object_id: Option<String>, - #[doc = "Git object id"] - #[serde( - rename = "originalObjectId", - default, - skip_serializing_if = "Option::is_none" - )] - pub original_object_id: Option<String>, + #[serde(flatten)] + pub item_model: ItemModel, + #[doc = "SHA1 of commit item was fetched at"] + #[serde(rename = "commitId", default, skip_serializing_if = "Option::is_none")] + pub commit_id: Option<String>, + #[doc = "Type of object (Commit, Tree, Blob, Tag, ...)"] + #[serde( + rename = "gitObjectType", + default, + skip_serializing_if = "Option::is_none" + )] + pub git_object_type: Option<git_item::GitObjectType>, + #[doc = "Provides properties that describe a Git commit and associated metadata."] + #[serde( + rename = "latestProcessedChange", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_processed_change: Option<GitCommitRef>, + #[doc = "Git object id"] + #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] + pub object_id: Option<String>, + #[doc = "Git object id"] + #[serde( + rename = "originalObjectId", + default, + skip_serializing_if = "Option::is_none" + )] + pub original_object_id: Option<String>, } impl GitItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_item { - use super::*; - #[doc = "Type of object (Commit, Tree, Blob, Tag, ...)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum GitObjectType { - #[serde(rename = "bad")] - Bad, - #[serde(rename = "commit")] - Commit, - #[serde(rename = "tree")] - Tree, - #[serde(rename = "blob")] - Blob, - #[serde(rename = "tag")] - Tag, - #[serde(rename = "ext2")] - Ext2, - #[serde(rename = "ofsDelta")] - OfsDelta, - #[serde(rename = "refDelta")] - RefDelta, - } + use super::*; + #[doc = "Type of object (Commit, Tree, Blob, Tag, ...)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum GitObjectType { + #[serde(rename = "bad")] + Bad, + #[serde(rename = "commit")] + Commit, + #[serde(rename = "tree")] + Tree, + #[serde(rename = "blob")] + Blob, + #[serde(rename = "tag")] + Tag, + #[serde(rename = "ext2")] + Ext2, + #[serde(rename = "ofsDelta")] + OfsDelta, + #[serde(rename = "refDelta")] + RefDelta, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitItemDescriptor { - #[doc = "Path to item"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Specifies whether to include children (OneLevel), all descendants (Full), or None"] - #[serde( - rename = "recursionLevel", - default, - skip_serializing_if = "Option::is_none" - )] - pub recursion_level: Option<git_item_descriptor::RecursionLevel>, - #[doc = "Version string (interpretation based on VersionType defined in subclass"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, - #[doc = "Version modifiers (e.g. previous)"] - #[serde( - rename = "versionOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_options: Option<git_item_descriptor::VersionOptions>, - #[doc = "How to interpret version (branch,tag,commit)"] - #[serde( - rename = "versionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_type: Option<git_item_descriptor::VersionType>, + #[doc = "Path to item"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Specifies whether to include children (OneLevel), all descendants (Full), or None"] + #[serde( + rename = "recursionLevel", + default, + skip_serializing_if = "Option::is_none" + )] + pub recursion_level: Option<git_item_descriptor::RecursionLevel>, + #[doc = "Version string (interpretation based on VersionType defined in subclass"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, + #[doc = "Version modifiers (e.g. previous)"] + #[serde( + rename = "versionOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_options: Option<git_item_descriptor::VersionOptions>, + #[doc = "How to interpret version (branch,tag,commit)"] + #[serde( + rename = "versionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_type: Option<git_item_descriptor::VersionType>, } impl GitItemDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_item_descriptor { - use super::*; - #[doc = "Specifies whether to include children (OneLevel), all descendants (Full), or None"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum RecursionLevel { - #[serde(rename = "none")] - None, - #[serde(rename = "oneLevel")] - OneLevel, - #[serde(rename = "oneLevelPlusNestedEmptyFolders")] - OneLevelPlusNestedEmptyFolders, - #[serde(rename = "full")] - Full, - } - #[doc = "Version modifiers (e.g. previous)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionOptions { - #[serde(rename = "none")] - None, - #[serde(rename = "previousChange")] - PreviousChange, - #[serde(rename = "firstParent")] - FirstParent, - } - #[doc = "How to interpret version (branch,tag,commit)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionType { - #[serde(rename = "branch")] - Branch, - #[serde(rename = "tag")] - Tag, - #[serde(rename = "commit")] - Commit, - } + use super::*; + #[doc = "Specifies whether to include children (OneLevel), all descendants (Full), or None"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum RecursionLevel { + #[serde(rename = "none")] + None, + #[serde(rename = "oneLevel")] + OneLevel, + #[serde(rename = "oneLevelPlusNestedEmptyFolders")] + OneLevelPlusNestedEmptyFolders, + #[serde(rename = "full")] + Full, + } + #[doc = "Version modifiers (e.g. previous)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionOptions { + #[serde(rename = "none")] + None, + #[serde(rename = "previousChange")] + PreviousChange, + #[serde(rename = "firstParent")] + FirstParent, + } + #[doc = "How to interpret version (branch,tag,commit)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionType { + #[serde(rename = "branch")] + Branch, + #[serde(rename = "tag")] + Tag, + #[serde(rename = "commit")] + Commit, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitItemList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitItem>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitItem>, } impl GitItemList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitItemRequestData { - #[doc = "Whether to include metadata for all items"] - #[serde( - rename = "includeContentMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_content_metadata: Option<bool>, - #[doc = "Whether to include the _links field on the shallow references"] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[doc = "Collection of items to fetch, including path, version, and recursion level"] - #[serde( - rename = "itemDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub item_descriptors: Vec<GitItemDescriptor>, - #[doc = "Whether to include shallow ref to commit that last changed each item"] - #[serde( - rename = "latestProcessedChange", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_processed_change: Option<bool>, + #[doc = "Whether to include metadata for all items"] + #[serde( + rename = "includeContentMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_content_metadata: Option<bool>, + #[doc = "Whether to include the _links field on the shallow references"] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[doc = "Collection of items to fetch, including path, version, and recursion level"] + #[serde( + rename = "itemDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub item_descriptors: Vec<GitItemDescriptor>, + #[doc = "Whether to include shallow ref to commit that last changed each item"] + #[serde( + rename = "latestProcessedChange", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_processed_change: Option<bool>, } impl GitItemRequestData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitLastChangeItem { - #[doc = "Gets or sets the commit Id this item was modified most recently for the provided version."] - #[serde(rename = "commitId", default, skip_serializing_if = "Option::is_none")] - pub commit_id: Option<String>, - #[doc = "Gets or sets the path of the item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[doc = "Gets or sets the commit Id this item was modified most recently for the provided version."] + #[serde(rename = "commitId", default, skip_serializing_if = "Option::is_none")] + pub commit_id: Option<String>, + #[doc = "Gets or sets the path of the item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl GitLastChangeItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitLastChangeTreeItems { - #[doc = "The list of commits referenced by Items, if they were requested."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub commits: Vec<GitCommitRef>, - #[doc = "The last change of items."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub items: Vec<GitLastChangeItem>, - #[doc = "The last explored time, in case the result is not comprehensive. Null otherwise."] - #[serde( - rename = "lastExploredTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_explored_time: Option<time::OffsetDateTime>, + #[doc = "The list of commits referenced by Items, if they were requested."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub commits: Vec<GitCommitRef>, + #[doc = "The last change of items."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub items: Vec<GitLastChangeItem>, + #[doc = "The last explored time, in case the result is not comprehensive. Null otherwise."] + #[serde( + rename = "lastExploredTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_explored_time: Option<time::OffsetDateTime>, } impl GitLastChangeTreeItems { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitMerge { - #[serde(flatten)] - pub git_merge_parameters: GitMergeParameters, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Status information about a requested merge operation."] - #[serde( - rename = "detailedStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub detailed_status: Option<GitMergeOperationStatusDetail>, - #[doc = "Unique identifier for the merge operation."] - #[serde( - rename = "mergeOperationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_operation_id: Option<i32>, - #[doc = "Status of the merge operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<git_merge::Status>, + #[serde(flatten)] + pub git_merge_parameters: GitMergeParameters, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Status information about a requested merge operation."] + #[serde( + rename = "detailedStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub detailed_status: Option<GitMergeOperationStatusDetail>, + #[doc = "Unique identifier for the merge operation."] + #[serde( + rename = "mergeOperationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_operation_id: Option<i32>, + #[doc = "Status of the merge operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<git_merge::Status>, } impl GitMerge { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_merge { - use super::*; - #[doc = "Status of the merge operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "queued")] - Queued, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[doc = "Status of the merge operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "queued")] + Queued, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = "Status information about a requested merge operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitMergeOperationStatusDetail { - #[doc = "Error message if the operation failed."] - #[serde( - rename = "failureMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub failure_message: Option<String>, - #[doc = "The commitId of the resultant merge commit."] - #[serde( - rename = "mergeCommitId", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_commit_id: Option<String>, + #[doc = "Error message if the operation failed."] + #[serde( + rename = "failureMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub failure_message: Option<String>, + #[doc = "The commitId of the resultant merge commit."] + #[serde( + rename = "mergeCommitId", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_commit_id: Option<String>, } impl GitMergeOperationStatusDetail { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitMergeOriginRef { - #[serde( - rename = "cherryPickId", - default, - skip_serializing_if = "Option::is_none" - )] - pub cherry_pick_id: Option<i32>, - #[serde( - rename = "pullRequestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_id: Option<i32>, - #[serde(rename = "revertId", default, skip_serializing_if = "Option::is_none")] - pub revert_id: Option<i32>, + #[serde( + rename = "cherryPickId", + default, + skip_serializing_if = "Option::is_none" + )] + pub cherry_pick_id: Option<i32>, + #[serde( + rename = "pullRequestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_id: Option<i32>, + #[serde(rename = "revertId", default, skip_serializing_if = "Option::is_none")] + pub revert_id: Option<i32>, } impl GitMergeOriginRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Parameters required for performing git merge."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitMergeParameters { - #[doc = "Comment or message of the commit."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "An enumeration of the parent commit IDs for the merge commit."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub parents: Vec<String>, + #[doc = "Comment or message of the commit."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "An enumeration of the parent commit IDs for the merge commit."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub parents: Vec<String>, } impl GitMergeParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Git object identifier and type information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitObject { - #[doc = "Object Id (Sha1Id)."] - #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] - pub object_id: Option<String>, - #[doc = "Type of object (Commit, Tree, Blob, Tag)"] - #[serde( - rename = "objectType", - default, - skip_serializing_if = "Option::is_none" - )] - pub object_type: Option<git_object::ObjectType>, + #[doc = "Object Id (Sha1Id)."] + #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] + pub object_id: Option<String>, + #[doc = "Type of object (Commit, Tree, Blob, Tag)"] + #[serde( + rename = "objectType", + default, + skip_serializing_if = "Option::is_none" + )] + pub object_type: Option<git_object::ObjectType>, } impl GitObject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_object { - use super::*; - #[doc = "Type of object (Commit, Tree, Blob, Tag)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ObjectType { - #[serde(rename = "bad")] - Bad, - #[serde(rename = "commit")] - Commit, - #[serde(rename = "tree")] - Tree, - #[serde(rename = "blob")] - Blob, - #[serde(rename = "tag")] - Tag, - #[serde(rename = "ext2")] - Ext2, - #[serde(rename = "ofsDelta")] - OfsDelta, - #[serde(rename = "refDelta")] - RefDelta, - } + use super::*; + #[doc = "Type of object (Commit, Tree, Blob, Tag)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ObjectType { + #[serde(rename = "bad")] + Bad, + #[serde(rename = "commit")] + Commit, + #[serde(rename = "tree")] + Tree, + #[serde(rename = "blob")] + Blob, + #[serde(rename = "tag")] + Tag, + #[serde(rename = "ext2")] + Ext2, + #[serde(rename = "ofsDelta")] + OfsDelta, + #[serde(rename = "refDelta")] + RefDelta, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPathAction { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub action: Option<git_path_action::Action>, - #[serde( - rename = "base64Content", - default, - skip_serializing_if = "Option::is_none" - )] - pub base64_content: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[serde( - rename = "rawTextContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub raw_text_content: Option<String>, - #[serde( - rename = "targetPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_path: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub action: Option<git_path_action::Action>, + #[serde( + rename = "base64Content", + default, + skip_serializing_if = "Option::is_none" + )] + pub base64_content: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[serde( + rename = "rawTextContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub raw_text_content: Option<String>, + #[serde( + rename = "targetPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_path: Option<String>, } impl GitPathAction { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_path_action { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Action { - #[serde(rename = "none")] - None, - #[serde(rename = "edit")] - Edit, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "add")] - Add, - #[serde(rename = "rename")] - Rename, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Action { + #[serde(rename = "none")] + None, + #[serde(rename = "edit")] + Edit, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "add")] + Add, + #[serde(rename = "rename")] + Rename, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPathToItemsCollection { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub items: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub items: Option<serde_json::Value>, } impl GitPathToItemsCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPolicyConfigurationResponse { - #[doc = "The HTTP client methods find the continuation token header in the response and populate this field."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[serde( - rename = "policyConfigurations", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub policy_configurations: Vec<PolicyConfiguration>, + #[doc = "The HTTP client methods find the continuation token header in the response and populate this field."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[serde( + rename = "policyConfigurations", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub policy_configurations: Vec<PolicyConfiguration>, } impl GitPolicyConfigurationResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents all the data associated with a pull request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GitPullRequest { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "A string which uniquely identifies this pull request. To generate an artifact ID for a pull request, use this template: ```vstfs:///Git/PullRequestId/{projectId}/{repositoryId}/{pullRequestId}```"] - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<String>, - #[doc = ""] - #[serde( - rename = "autoCompleteSetBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub auto_complete_set_by: Option<IdentityRef>, - #[doc = ""] - #[serde(rename = "closedBy", default, skip_serializing_if = "Option::is_none")] - pub closed_by: Option<IdentityRef>, - #[doc = "The date when the pull request was closed (completed, abandoned, or merged externally)."] - #[serde( - rename = "closedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub closed_date: Option<time::OffsetDateTime>, - #[doc = "The code review ID of the pull request. Used internally."] - #[serde( - rename = "codeReviewId", - default, - skip_serializing_if = "Option::is_none" - )] - pub code_review_id: Option<i32>, - #[doc = "The commits contained in the pull request."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub commits: Vec<GitCommitRef>, - #[doc = "Preferences about how the pull request should be completed."] - #[serde( - rename = "completionOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub completion_options: Option<GitPullRequestCompletionOptions>, - #[doc = "The most recent date at which the pull request entered the queue to be completed. Used internally."] - #[serde( - rename = "completionQueueTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completion_queue_time: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde(rename = "createdBy")] - pub created_by: IdentityRef, - #[doc = "The date when the pull request was created."] - #[serde(rename = "creationDate", with = "crate::date_time::rfc3339")] - pub creation_date: time::OffsetDateTime, - #[doc = "The description of the pull request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Information about a fork ref."] - #[serde( - rename = "forkSource", - default, - skip_serializing_if = "Option::is_none" - )] - pub fork_source: Option<GitForkRef>, - #[doc = "Multiple mergebases warning"] - #[serde( - rename = "hasMultipleMergeBases", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_multiple_merge_bases: Option<bool>, - #[doc = "Draft / WIP pull request."] - #[serde(rename = "isDraft")] - pub is_draft: bool, - #[doc = "The labels associated with the pull request."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub labels: Vec<WebApiTagDefinition>, - #[doc = "Provides properties that describe a Git commit and associated metadata."] - #[serde( - rename = "lastMergeCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_merge_commit: Option<GitCommitRef>, - #[doc = "Provides properties that describe a Git commit and associated metadata."] - #[serde( - rename = "lastMergeSourceCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_merge_source_commit: Option<GitCommitRef>, - #[doc = "Provides properties that describe a Git commit and associated metadata."] - #[serde( - rename = "lastMergeTargetCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_merge_target_commit: Option<GitCommitRef>, - #[doc = "If set, pull request merge failed for this reason."] - #[serde( - rename = "mergeFailureMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_failure_message: Option<String>, - #[doc = "The type of failure (if any) of the pull request merge."] - #[serde( - rename = "mergeFailureType", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_failure_type: Option<git_pull_request::MergeFailureType>, - #[doc = "The ID of the job used to run the pull request merge. Used internally."] - #[serde(rename = "mergeId", default, skip_serializing_if = "Option::is_none")] - pub merge_id: Option<String>, - #[doc = "The options which are used when a pull request merge is created."] - #[serde( - rename = "mergeOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_options: Option<GitPullRequestMergeOptions>, - #[doc = "The current status of the pull request merge."] - #[serde( - rename = "mergeStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_status: Option<git_pull_request::MergeStatus>, - #[doc = "The ID of the pull request."] - #[serde(rename = "pullRequestId")] - pub pull_request_id: i32, - #[doc = "Used internally."] - #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] - pub remote_url: Option<String>, - #[doc = ""] - pub repository: GitRepository, - #[doc = "A list of reviewers on the pull request along with the state of their votes."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub reviewers: Vec<IdentityRefWithVote>, - #[doc = "The name of the source branch of the pull request."] - #[serde(rename = "sourceRefName")] - pub source_ref_name: String, - #[doc = "The status of the pull request."] - pub status: git_pull_request::Status, - #[doc = "If true, this pull request supports multiple iterations. Iteration support means individual pushes to the source branch of the pull request can be reviewed and comments left in one iteration will be tracked across future iterations."] - #[serde( - rename = "supportsIterations", - default, - skip_serializing_if = "Option::is_none" - )] - pub supports_iterations: Option<bool>, - #[doc = "The name of the target branch of the pull request."] - #[serde(rename = "targetRefName")] - pub target_ref_name: String, - #[doc = "The title of the pull request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[doc = "Used internally."] - pub url: String, - #[doc = "Any work item references associated with this pull request."] - #[serde( - rename = "workItemRefs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_refs: Vec<ResourceRef>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "A string which uniquely identifies this pull request. To generate an artifact ID for a pull request, use this template: ```vstfs:///Git/PullRequestId/{projectId}/{repositoryId}/{pullRequestId}```"] + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<String>, + #[doc = ""] + #[serde( + rename = "autoCompleteSetBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub auto_complete_set_by: Option<IdentityRef>, + #[doc = ""] + #[serde(rename = "closedBy", default, skip_serializing_if = "Option::is_none")] + pub closed_by: Option<IdentityRef>, + #[doc = "The date when the pull request was closed (completed, abandoned, or merged externally)."] + #[serde( + rename = "closedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub closed_date: Option<time::OffsetDateTime>, + #[doc = "The code review ID of the pull request. Used internally."] + #[serde( + rename = "codeReviewId", + default, + skip_serializing_if = "Option::is_none" + )] + pub code_review_id: Option<i32>, + #[doc = "The commits contained in the pull request."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub commits: Vec<GitCommitRef>, + #[doc = "Preferences about how the pull request should be completed."] + #[serde( + rename = "completionOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub completion_options: Option<GitPullRequestCompletionOptions>, + #[doc = "The most recent date at which the pull request entered the queue to be completed. Used internally."] + #[serde( + rename = "completionQueueTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completion_queue_time: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(rename = "createdBy")] + pub created_by: IdentityRef, + #[doc = "The date when the pull request was created."] + #[serde(rename = "creationDate", with = "crate::date_time::rfc3339")] + pub creation_date: time::OffsetDateTime, + #[doc = "The description of the pull request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Information about a fork ref."] + #[serde( + rename = "forkSource", + default, + skip_serializing_if = "Option::is_none" + )] + pub fork_source: Option<GitForkRef>, + #[doc = "Multiple mergebases warning"] + #[serde( + rename = "hasMultipleMergeBases", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_multiple_merge_bases: Option<bool>, + #[doc = "Draft / WIP pull request."] + #[serde(rename = "isDraft")] + pub is_draft: bool, + #[doc = "The labels associated with the pull request."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub labels: Vec<WebApiTagDefinition>, + #[doc = "Provides properties that describe a Git commit and associated metadata."] + #[serde( + rename = "lastMergeCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_merge_commit: Option<GitCommitRef>, + #[doc = "Provides properties that describe a Git commit and associated metadata."] + #[serde( + rename = "lastMergeSourceCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_merge_source_commit: Option<GitCommitRef>, + #[doc = "Provides properties that describe a Git commit and associated metadata."] + #[serde( + rename = "lastMergeTargetCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_merge_target_commit: Option<GitCommitRef>, + #[doc = "If set, pull request merge failed for this reason."] + #[serde( + rename = "mergeFailureMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_failure_message: Option<String>, + #[doc = "The type of failure (if any) of the pull request merge."] + #[serde( + rename = "mergeFailureType", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_failure_type: Option<git_pull_request::MergeFailureType>, + #[doc = "The ID of the job used to run the pull request merge. Used internally."] + #[serde(rename = "mergeId", default, skip_serializing_if = "Option::is_none")] + pub merge_id: Option<String>, + #[doc = "The options which are used when a pull request merge is created."] + #[serde( + rename = "mergeOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_options: Option<GitPullRequestMergeOptions>, + #[doc = "The current status of the pull request merge."] + #[serde( + rename = "mergeStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_status: Option<git_pull_request::MergeStatus>, + #[doc = "The ID of the pull request."] + #[serde(rename = "pullRequestId")] + pub pull_request_id: i32, + #[doc = "Used internally."] + #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] + pub remote_url: Option<String>, + #[doc = ""] + pub repository: GitRepository, + #[doc = "A list of reviewers on the pull request along with the state of their votes."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub reviewers: Vec<IdentityRefWithVote>, + #[doc = "The name of the source branch of the pull request."] + #[serde(rename = "sourceRefName")] + pub source_ref_name: String, + #[doc = "The status of the pull request."] + pub status: git_pull_request::Status, + #[doc = "If true, this pull request supports multiple iterations. Iteration support means individual pushes to the source branch of the pull request can be reviewed and comments left in one iteration will be tracked across future iterations."] + #[serde( + rename = "supportsIterations", + default, + skip_serializing_if = "Option::is_none" + )] + pub supports_iterations: Option<bool>, + #[doc = "The name of the target branch of the pull request."] + #[serde(rename = "targetRefName")] + pub target_ref_name: String, + #[doc = "The title of the pull request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[doc = "Used internally."] + pub url: String, + #[doc = "Any work item references associated with this pull request."] + #[serde( + rename = "workItemRefs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_refs: Vec<ResourceRef>, } impl GitPullRequest { - pub fn new( - created_by: IdentityRef, - creation_date: time::OffsetDateTime, - is_draft: bool, - pull_request_id: i32, - repository: GitRepository, - source_ref_name: String, - status: git_pull_request::Status, - target_ref_name: String, - url: String, - ) -> Self { - Self { - links: None, - artifact_id: None, - auto_complete_set_by: None, - closed_by: None, - closed_date: None, - code_review_id: None, - commits: Vec::new(), - completion_options: None, - completion_queue_time: None, - created_by, - creation_date, - description: None, - fork_source: None, - has_multiple_merge_bases: None, - is_draft, - labels: Vec::new(), - last_merge_commit: None, - last_merge_source_commit: None, - last_merge_target_commit: None, - merge_failure_message: None, - merge_failure_type: None, - merge_id: None, - merge_options: None, - merge_status: None, - pull_request_id, - remote_url: None, - repository, - reviewers: Vec::new(), - source_ref_name, - status, - supports_iterations: None, - target_ref_name, - title: None, - url, - work_item_refs: Vec::new(), - } - } + pub fn new( + created_by: IdentityRef, + creation_date: time::OffsetDateTime, + is_draft: bool, + pull_request_id: i32, + repository: GitRepository, + source_ref_name: String, + status: git_pull_request::Status, + target_ref_name: String, + url: String, + ) -> Self { + Self { + links: None, + artifact_id: None, + auto_complete_set_by: None, + closed_by: None, + closed_date: None, + code_review_id: None, + commits: Vec::new(), + completion_options: None, + completion_queue_time: None, + created_by, + creation_date, + description: None, + fork_source: None, + has_multiple_merge_bases: None, + is_draft, + labels: Vec::new(), + last_merge_commit: None, + last_merge_source_commit: None, + last_merge_target_commit: None, + merge_failure_message: None, + merge_failure_type: None, + merge_id: None, + merge_options: None, + merge_status: None, + pull_request_id, + remote_url: None, + repository, + reviewers: Vec::new(), + source_ref_name, + status, + supports_iterations: None, + target_ref_name, + title: None, + url, + work_item_refs: Vec::new(), + } + } } pub mod git_pull_request { - use super::*; - #[doc = "The type of failure (if any) of the pull request merge."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum MergeFailureType { - #[serde(rename = "none")] - None, - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "caseSensitive")] - CaseSensitive, - #[serde(rename = "objectTooLarge")] - ObjectTooLarge, - } - #[doc = "The current status of the pull request merge."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum MergeStatus { - #[serde(rename = "notSet")] - NotSet, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "conflicts")] - Conflicts, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "rejectedByPolicy")] - RejectedByPolicy, - #[serde(rename = "failure")] - Failure, - } - #[doc = "The status of the pull request."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "notSet")] - NotSet, - #[serde(rename = "active")] - Active, - #[serde(rename = "abandoned")] - Abandoned, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "The type of failure (if any) of the pull request merge."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum MergeFailureType { + #[serde(rename = "none")] + None, + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "caseSensitive")] + CaseSensitive, + #[serde(rename = "objectTooLarge")] + ObjectTooLarge, + } + #[doc = "The current status of the pull request merge."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum MergeStatus { + #[serde(rename = "notSet")] + NotSet, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "conflicts")] + Conflicts, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "rejectedByPolicy")] + RejectedByPolicy, + #[serde(rename = "failure")] + Failure, + } + #[doc = "The status of the pull request."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "notSet")] + NotSet, + #[serde(rename = "active")] + Active, + #[serde(rename = "abandoned")] + Abandoned, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "all")] + All, + } } #[doc = "Change made in a pull request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GitPullRequestChange { - #[serde(flatten)] - pub git_change: GitChange, - #[doc = "ID used to track files through multiple changes."] - #[serde( - rename = "changeTrackingId", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_tracking_id: Option<i32>, + #[serde(flatten)] + pub git_change: GitChange, + #[doc = "ID used to track files through multiple changes."] + #[serde( + rename = "changeTrackingId", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_tracking_id: Option<i32>, } impl GitPullRequestChange { - pub fn new(git_change: GitChange) -> Self { - Self { - git_change, - change_tracking_id: None, - } + pub fn new(git_change: GitChange) -> Self { + Self { + git_change, + change_tracking_id: None, } + } } #[doc = "Represents a comment thread of a pull request. A thread contains meta data about the file it was left on (if any) along with one or more comments (an initial comment and the subsequent replies)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestCommentThread { - #[serde(flatten)] - pub comment_thread: CommentThread, - #[doc = "Comment thread context contains details about what diffs were being viewed at the time of thread creation and whether or not the thread has been tracked from that original diff."] - #[serde( - rename = "pullRequestThreadContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_thread_context: Option<GitPullRequestCommentThreadContext>, + #[serde(flatten)] + pub comment_thread: CommentThread, + #[doc = "Comment thread context contains details about what diffs were being viewed at the time of thread creation and whether or not the thread has been tracked from that original diff."] + #[serde( + rename = "pullRequestThreadContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_thread_context: Option<GitPullRequestCommentThreadContext>, } impl GitPullRequestCommentThread { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Comment thread context contains details about what diffs were being viewed at the time of thread creation and whether or not the thread has been tracked from that original diff."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestCommentThreadContext { - #[doc = "Used to track a comment across iterations. This value can be found by looking at the iteration's changes list. Must be set for pull requests with iteration support. Otherwise, it's not required for 'legacy' pull requests."] - #[serde( - rename = "changeTrackingId", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_tracking_id: Option<i32>, - #[doc = "Comment iteration context is used to identify which diff was being viewed when the thread was created."] - #[serde( - rename = "iterationContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_context: Option<CommentIterationContext>, - #[doc = "Comment tracking criteria is used to identify which iteration context the thread has been tracked to (if any) along with some detail about the original position and filename."] - #[serde( - rename = "trackingCriteria", - default, - skip_serializing_if = "Option::is_none" - )] - pub tracking_criteria: Option<CommentTrackingCriteria>, + #[doc = "Used to track a comment across iterations. This value can be found by looking at the iteration's changes list. Must be set for pull requests with iteration support. Otherwise, it's not required for 'legacy' pull requests."] + #[serde( + rename = "changeTrackingId", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_tracking_id: Option<i32>, + #[doc = "Comment iteration context is used to identify which diff was being viewed when the thread was created."] + #[serde( + rename = "iterationContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_context: Option<CommentIterationContext>, + #[doc = "Comment tracking criteria is used to identify which iteration context the thread has been tracked to (if any) along with some detail about the original position and filename."] + #[serde( + rename = "trackingCriteria", + default, + skip_serializing_if = "Option::is_none" + )] + pub tracking_criteria: Option<CommentTrackingCriteria>, } impl GitPullRequestCommentThreadContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestCommentThreadList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitPullRequestCommentThread>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitPullRequestCommentThread>, } impl GitPullRequestCommentThreadList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Preferences about how the pull request should be completed."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestCompletionOptions { - #[doc = "List of any policy configuration Id's which auto-complete should not wait for. Only applies to optional policies (isBlocking == false). Auto-complete always waits for required policies (isBlocking == true)."] - #[serde( - rename = "autoCompleteIgnoreConfigIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub auto_complete_ignore_config_ids: Vec<i32>, - #[doc = "If true, policies will be explicitly bypassed while the pull request is completed."] - #[serde( - rename = "bypassPolicy", - default, - skip_serializing_if = "Option::is_none" - )] - pub bypass_policy: Option<bool>, - #[doc = "If policies are bypassed, this reason is stored as to why bypass was used."] - #[serde( - rename = "bypassReason", - default, - skip_serializing_if = "Option::is_none" - )] - pub bypass_reason: Option<String>, - #[doc = "If true, the source branch of the pull request will be deleted after completion."] - #[serde( - rename = "deleteSourceBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub delete_source_branch: Option<bool>, - #[doc = "If set, this will be used as the commit message of the merge commit."] - #[serde( - rename = "mergeCommitMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_commit_message: Option<String>, - #[doc = "Specify the strategy used to merge the pull request during completion. If MergeStrategy is not set to any value, a no-FF merge will be created if SquashMerge == false. If MergeStrategy is not set to any value, the pull request commits will be squashed if SquashMerge == true. The SquashMerge property is deprecated. It is recommended that you explicitly set MergeStrategy in all cases. If an explicit value is provided for MergeStrategy, the SquashMerge property will be ignored."] - #[serde( - rename = "mergeStrategy", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_strategy: Option<git_pull_request_completion_options::MergeStrategy>, - #[doc = "SquashMerge is deprecated. You should explicitly set the value of MergeStrategy. If MergeStrategy is set to any value, the SquashMerge value will be ignored. If MergeStrategy is not set, the merge strategy will be no-fast-forward if this flag is false, or squash if true."] - #[serde( - rename = "squashMerge", - default, - skip_serializing_if = "Option::is_none" - )] - pub squash_merge: Option<bool>, - #[doc = "If true, we will attempt to transition any work items linked to the pull request into the next logical state (i.e. Active -> Resolved)"] - #[serde( - rename = "transitionWorkItems", - default, - skip_serializing_if = "Option::is_none" - )] - pub transition_work_items: Option<bool>, - #[doc = "If true, the current completion attempt was triggered via auto-complete. Used internally."] - #[serde( - rename = "triggeredByAutoComplete", - default, - skip_serializing_if = "Option::is_none" - )] - pub triggered_by_auto_complete: Option<bool>, + #[doc = "List of any policy configuration Id's which auto-complete should not wait for. Only applies to optional policies (isBlocking == false). Auto-complete always waits for required policies (isBlocking == true)."] + #[serde( + rename = "autoCompleteIgnoreConfigIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub auto_complete_ignore_config_ids: Vec<i32>, + #[doc = "If true, policies will be explicitly bypassed while the pull request is completed."] + #[serde( + rename = "bypassPolicy", + default, + skip_serializing_if = "Option::is_none" + )] + pub bypass_policy: Option<bool>, + #[doc = "If policies are bypassed, this reason is stored as to why bypass was used."] + #[serde( + rename = "bypassReason", + default, + skip_serializing_if = "Option::is_none" + )] + pub bypass_reason: Option<String>, + #[doc = "If true, the source branch of the pull request will be deleted after completion."] + #[serde( + rename = "deleteSourceBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub delete_source_branch: Option<bool>, + #[doc = "If set, this will be used as the commit message of the merge commit."] + #[serde( + rename = "mergeCommitMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_commit_message: Option<String>, + #[doc = "Specify the strategy used to merge the pull request during completion. If MergeStrategy is not set to any value, a no-FF merge will be created if SquashMerge == false. If MergeStrategy is not set to any value, the pull request commits will be squashed if SquashMerge == true. The SquashMerge property is deprecated. It is recommended that you explicitly set MergeStrategy in all cases. If an explicit value is provided for MergeStrategy, the SquashMerge property will be ignored."] + #[serde( + rename = "mergeStrategy", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_strategy: Option<git_pull_request_completion_options::MergeStrategy>, + #[doc = "SquashMerge is deprecated. You should explicitly set the value of MergeStrategy. If MergeStrategy is set to any value, the SquashMerge value will be ignored. If MergeStrategy is not set, the merge strategy will be no-fast-forward if this flag is false, or squash if true."] + #[serde( + rename = "squashMerge", + default, + skip_serializing_if = "Option::is_none" + )] + pub squash_merge: Option<bool>, + #[doc = "If true, we will attempt to transition any work items linked to the pull request into the next logical state (i.e. Active -> Resolved)"] + #[serde( + rename = "transitionWorkItems", + default, + skip_serializing_if = "Option::is_none" + )] + pub transition_work_items: Option<bool>, + #[doc = "If true, the current completion attempt was triggered via auto-complete. Used internally."] + #[serde( + rename = "triggeredByAutoComplete", + default, + skip_serializing_if = "Option::is_none" + )] + pub triggered_by_auto_complete: Option<bool>, } impl GitPullRequestCompletionOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_pull_request_completion_options { - use super::*; - #[doc = "Specify the strategy used to merge the pull request during completion. If MergeStrategy is not set to any value, a no-FF merge will be created if SquashMerge == false. If MergeStrategy is not set to any value, the pull request commits will be squashed if SquashMerge == true. The SquashMerge property is deprecated. It is recommended that you explicitly set MergeStrategy in all cases. If an explicit value is provided for MergeStrategy, the SquashMerge property will be ignored."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum MergeStrategy { - #[serde(rename = "noFastForward")] - NoFastForward, - #[serde(rename = "squash")] - Squash, - #[serde(rename = "rebase")] - Rebase, - #[serde(rename = "rebaseMerge")] - RebaseMerge, - } + use super::*; + #[doc = "Specify the strategy used to merge the pull request during completion. If MergeStrategy is not set to any value, a no-FF merge will be created if SquashMerge == false. If MergeStrategy is not set to any value, the pull request commits will be squashed if SquashMerge == true. The SquashMerge property is deprecated. It is recommended that you explicitly set MergeStrategy in all cases. If an explicit value is provided for MergeStrategy, the SquashMerge property will be ignored."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum MergeStrategy { + #[serde(rename = "noFastForward")] + NoFastForward, + #[serde(rename = "squash")] + Squash, + #[serde(rename = "rebase")] + Rebase, + #[serde(rename = "rebaseMerge")] + RebaseMerge, + } } #[doc = "Pull Request create options"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GitPullRequestCreateOptions { - #[doc = "The description of the pull request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Draft / WIP pull request."] - #[serde(rename = "isDraft", default, skip_serializing_if = "Option::is_none")] - pub is_draft: Option<bool>, - #[doc = "The labels associated with the pull request."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub labels: Vec<WebApiCreateTagRequestData>, - #[doc = "The name of the source branch of the pull request."] - #[serde(rename = "sourceRefName")] - pub source_ref_name: String, - #[doc = "The name of the target branch of the pull request."] - #[serde(rename = "targetRefName")] - pub target_ref_name: String, - #[doc = "The title of the pull request."] - pub title: String, - #[doc = "The options which are used when a pull request merge is created."] - #[serde( - rename = "mergeOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_options: Option<GitPullRequestMergeOptions>, - #[doc = "Preferences about how the pull request should be completed."] - #[serde( - rename = "completionOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub completion_options: Option<GitPullRequestCompletionOptions>, - #[doc = "Any work item references associated with this pull request."] - #[serde( - rename = "workItemRefs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_refs: Vec<ResourceRef>, - #[doc = "A list of reviewers on the pull request."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub reviewers: Vec<IdentityId>, + #[doc = "The description of the pull request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Draft / WIP pull request."] + #[serde(rename = "isDraft", default, skip_serializing_if = "Option::is_none")] + pub is_draft: Option<bool>, + #[doc = "The labels associated with the pull request."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub labels: Vec<WebApiCreateTagRequestData>, + #[doc = "The name of the source branch of the pull request."] + #[serde(rename = "sourceRefName")] + pub source_ref_name: String, + #[doc = "The name of the target branch of the pull request."] + #[serde(rename = "targetRefName")] + pub target_ref_name: String, + #[doc = "The title of the pull request."] + pub title: String, + #[doc = "The options which are used when a pull request merge is created."] + #[serde( + rename = "mergeOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_options: Option<GitPullRequestMergeOptions>, + #[doc = "Preferences about how the pull request should be completed."] + #[serde( + rename = "completionOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub completion_options: Option<GitPullRequestCompletionOptions>, + #[doc = "Any work item references associated with this pull request."] + #[serde( + rename = "workItemRefs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_refs: Vec<ResourceRef>, + #[doc = "A list of reviewers on the pull request."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub reviewers: Vec<IdentityId>, } impl GitPullRequestCreateOptions { - pub fn new(source_ref_name: String, target_ref_name: String, title: String) -> Self { - Self { - description: None, - is_draft: None, - labels: Vec::new(), - source_ref_name, - target_ref_name, - title, - merge_options: None, - completion_options: None, - work_item_refs: Vec::new(), - reviewers: Vec::new(), - } - } + pub fn new(source_ref_name: String, target_ref_name: String, title: String) -> Self { + Self { + description: None, + is_draft: None, + labels: Vec::new(), + source_ref_name, + target_ref_name, + title, + merge_options: None, + completion_options: None, + work_item_refs: Vec::new(), + reviewers: Vec::new(), + } + } } #[doc = "Provides properties that describe a Git pull request iteration. Iterations are created as a result of creating and pushing updates to a pull request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestIteration { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<IdentityRef>, - #[doc = "Changes included with the pull request iteration."] - #[serde( - rename = "changeList", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub change_list: Vec<GitPullRequestChange>, - #[doc = "The commits included with the pull request iteration."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub commits: Vec<GitCommitRef>, - #[doc = "Provides properties that describe a Git commit and associated metadata."] - #[serde( - rename = "commonRefCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub common_ref_commit: Option<GitCommitRef>, - #[doc = "The creation date of the pull request iteration."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Description of the pull request iteration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Indicates if the Commits property contains a truncated list of commits in this pull request iteration."] - #[serde( - rename = "hasMoreCommits", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_more_commits: Option<bool>, - #[doc = "ID of the pull request iteration. Iterations are created as a result of creating and pushing updates to a pull request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "If the iteration reason is Retarget, this is the refName of the new target"] - #[serde( - rename = "newTargetRefName", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_target_ref_name: Option<String>, - #[doc = "If the iteration reason is Retarget, this is the original target refName"] - #[serde( - rename = "oldTargetRefName", - default, - skip_serializing_if = "Option::is_none" - )] - pub old_target_ref_name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub push: Option<GitPushRef>, - #[doc = "The reason for which the pull request iteration was created."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<git_pull_request_iteration::Reason>, - #[doc = "Provides properties that describe a Git commit and associated metadata."] - #[serde( - rename = "sourceRefCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_ref_commit: Option<GitCommitRef>, - #[doc = "Provides properties that describe a Git commit and associated metadata."] - #[serde( - rename = "targetRefCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_ref_commit: Option<GitCommitRef>, - #[doc = "The updated date of the pull request iteration."] - #[serde( - rename = "updatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub updated_date: Option<time::OffsetDateTime>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<IdentityRef>, + #[doc = "Changes included with the pull request iteration."] + #[serde( + rename = "changeList", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub change_list: Vec<GitPullRequestChange>, + #[doc = "The commits included with the pull request iteration."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub commits: Vec<GitCommitRef>, + #[doc = "Provides properties that describe a Git commit and associated metadata."] + #[serde( + rename = "commonRefCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub common_ref_commit: Option<GitCommitRef>, + #[doc = "The creation date of the pull request iteration."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Description of the pull request iteration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Indicates if the Commits property contains a truncated list of commits in this pull request iteration."] + #[serde( + rename = "hasMoreCommits", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_more_commits: Option<bool>, + #[doc = "ID of the pull request iteration. Iterations are created as a result of creating and pushing updates to a pull request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "If the iteration reason is Retarget, this is the refName of the new target"] + #[serde( + rename = "newTargetRefName", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_target_ref_name: Option<String>, + #[doc = "If the iteration reason is Retarget, this is the original target refName"] + #[serde( + rename = "oldTargetRefName", + default, + skip_serializing_if = "Option::is_none" + )] + pub old_target_ref_name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub push: Option<GitPushRef>, + #[doc = "The reason for which the pull request iteration was created."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<git_pull_request_iteration::Reason>, + #[doc = "Provides properties that describe a Git commit and associated metadata."] + #[serde( + rename = "sourceRefCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_ref_commit: Option<GitCommitRef>, + #[doc = "Provides properties that describe a Git commit and associated metadata."] + #[serde( + rename = "targetRefCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_ref_commit: Option<GitCommitRef>, + #[doc = "The updated date of the pull request iteration."] + #[serde( + rename = "updatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub updated_date: Option<time::OffsetDateTime>, } impl GitPullRequestIteration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_pull_request_iteration { - use super::*; - #[doc = "The reason for which the pull request iteration was created."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Reason { - #[serde(rename = "push")] - Push, - #[serde(rename = "forcePush")] - ForcePush, - #[serde(rename = "create")] - Create, - #[serde(rename = "rebase")] - Rebase, - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "retarget")] - Retarget, - #[serde(rename = "resolveConflicts")] - ResolveConflicts, - } + use super::*; + #[doc = "The reason for which the pull request iteration was created."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Reason { + #[serde(rename = "push")] + Push, + #[serde(rename = "forcePush")] + ForcePush, + #[serde(rename = "create")] + Create, + #[serde(rename = "rebase")] + Rebase, + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "retarget")] + Retarget, + } } #[doc = "Collection of changes made in a pull request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestIterationChanges { - #[doc = "Changes made in the iteration."] - #[serde( - rename = "changeEntries", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub change_entries: Vec<GitPullRequestChange>, - #[doc = "Value to specify as skip to get the next page of changes. This will be zero if there are no more changes."] - #[serde(rename = "nextSkip", default, skip_serializing_if = "Option::is_none")] - pub next_skip: Option<i32>, - #[doc = "Value to specify as top to get the next page of changes. This will be zero if there are no more changes."] - #[serde(rename = "nextTop", default, skip_serializing_if = "Option::is_none")] - pub next_top: Option<i32>, + #[doc = "Changes made in the iteration."] + #[serde( + rename = "changeEntries", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub change_entries: Vec<GitPullRequestChange>, + #[doc = "Value to specify as skip to get the next page of changes. This will be zero if there are no more changes."] + #[serde(rename = "nextSkip", default, skip_serializing_if = "Option::is_none")] + pub next_skip: Option<i32>, + #[doc = "Value to specify as top to get the next page of changes. This will be zero if there are no more changes."] + #[serde(rename = "nextTop", default, skip_serializing_if = "Option::is_none")] + pub next_top: Option<i32>, } impl GitPullRequestIterationChanges { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestIterationList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitPullRequestIteration>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitPullRequestIteration>, } impl GitPullRequestIterationList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitPullRequest>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitPullRequest>, } impl GitPullRequestList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The options which are used when a pull request merge is created."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestMergeOptions { - #[doc = "If true, conflict resolutions applied during the merge will be put in separate commits to preserve authorship info for git blame, etc."] - #[serde( - rename = "conflictAuthorshipCommits", - default, - skip_serializing_if = "Option::is_none" - )] - pub conflict_authorship_commits: Option<bool>, - #[serde( - rename = "detectRenameFalsePositives", - default, - skip_serializing_if = "Option::is_none" - )] - pub detect_rename_false_positives: Option<bool>, - #[doc = "If true, rename detection will not be performed during the merge."] - #[serde( - rename = "disableRenames", - default, - skip_serializing_if = "Option::is_none" - )] - pub disable_renames: Option<bool>, + #[doc = "If true, conflict resolutions applied during the merge will be put in separate commits to preserve authorship info for git blame, etc."] + #[serde( + rename = "conflictAuthorshipCommits", + default, + skip_serializing_if = "Option::is_none" + )] + pub conflict_authorship_commits: Option<bool>, + #[serde( + rename = "detectRenameFalsePositives", + default, + skip_serializing_if = "Option::is_none" + )] + pub detect_rename_false_positives: Option<bool>, + #[doc = "If true, rename detection will not be performed during the merge."] + #[serde( + rename = "disableRenames", + default, + skip_serializing_if = "Option::is_none" + )] + pub disable_renames: Option<bool>, } impl GitPullRequestMergeOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A set of pull request queries and their results."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestQuery { - #[doc = "The queries to perform."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub queries: Vec<GitPullRequestQueryInput>, - #[doc = "The results of the queries. This matches the QueryInputs list so Results\\[n\\] are the results of QueryInputs\\[n\\]. Each entry in the list is a dictionary of commit->pull requests."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<serde_json::Value>, + #[doc = "The queries to perform."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub queries: Vec<GitPullRequestQueryInput>, + #[doc = "The results of the queries. This matches the QueryInputs list so Results\\[n\\] are the results of QueryInputs\\[n\\]. Each entry in the list is a dictionary of commit->pull requests."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<serde_json::Value>, } impl GitPullRequestQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Pull request query input parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestQueryInput { - #[doc = "The list of commit IDs to search for."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub items: Vec<String>, - #[doc = "The type of query to perform."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<git_pull_request_query_input::Type>, + #[doc = "The list of commit IDs to search for."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub items: Vec<String>, + #[doc = "The type of query to perform."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<git_pull_request_query_input::Type>, } impl GitPullRequestQueryInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_pull_request_query_input { - use super::*; - #[doc = "The type of query to perform."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "notSet")] - NotSet, - #[serde(rename = "lastMergeCommit")] - LastMergeCommit, - #[serde(rename = "commit")] - Commit, - } + use super::*; + #[doc = "The type of query to perform."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "notSet")] + NotSet, + #[serde(rename = "lastMergeCommit")] + LastMergeCommit, + #[serde(rename = "commit")] + Commit, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestReviewFileContentInfo { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "The file change path."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Content hash of on-disk representation of file content. Its calculated by the client by using SHA1 hash function. Ensure that uploaded file has same encoding as in source control."] - #[serde(rename = "shA1Hash", default, skip_serializing_if = "Option::is_none")] - pub sh_a1_hash: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "The file change path."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Content hash of on-disk representation of file content. Its calculated by the client by using SHA1 hash function. Ensure that uploaded file has same encoding as in source control."] + #[serde(rename = "shA1Hash", default, skip_serializing_if = "Option::is_none")] + pub sh_a1_hash: Option<String>, } impl GitPullRequestReviewFileContentInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Pull requests can be searched for matching this criteria."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestSearchCriteria { - #[doc = "If set, search for pull requests that were created by this identity."] - #[serde(rename = "creatorId", default, skip_serializing_if = "Option::is_none")] - pub creator_id: Option<String>, - #[doc = "Whether to include the _links field on the shallow references"] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[doc = "If specified, filters pull requests that created/closed before this date based on the queryTimeRangeType specified."] - #[serde( - rename = "maxTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub max_time: Option<time::OffsetDateTime>, - #[doc = "If specified, filters pull requests that created/closed after this date based on the queryTimeRangeType specified."] - #[serde( - rename = "minTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub min_time: Option<time::OffsetDateTime>, - #[doc = "The type of time range which should be used for minTime and maxTime. Defaults to Created if unset."] - #[serde( - rename = "queryTimeRangeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub query_time_range_type: Option<git_pull_request_search_criteria::QueryTimeRangeType>, - #[doc = "If set, search for pull requests whose target branch is in this repository."] - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, - #[doc = "If set, search for pull requests that have this identity as a reviewer."] - #[serde( - rename = "reviewerId", - default, - skip_serializing_if = "Option::is_none" - )] - pub reviewer_id: Option<String>, - #[doc = "If set, search for pull requests from this branch."] - #[serde( - rename = "sourceRefName", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_ref_name: Option<String>, - #[doc = "If set, search for pull requests whose source branch is in this repository."] - #[serde( - rename = "sourceRepositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_repository_id: Option<String>, - #[doc = "If set, search for pull requests that are in this state. Defaults to Active if unset."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<git_pull_request_search_criteria::Status>, - #[doc = "If set, search for pull requests into this branch."] - #[serde( - rename = "targetRefName", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_ref_name: Option<String>, + #[doc = "If set, search for pull requests that were created by this identity."] + #[serde(rename = "creatorId", default, skip_serializing_if = "Option::is_none")] + pub creator_id: Option<String>, + #[doc = "Whether to include the _links field on the shallow references"] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[doc = "If set, search for pull requests whose target branch is in this repository."] + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, + #[doc = "If set, search for pull requests that have this identity as a reviewer."] + #[serde( + rename = "reviewerId", + default, + skip_serializing_if = "Option::is_none" + )] + pub reviewer_id: Option<String>, + #[doc = "If set, search for pull requests from this branch."] + #[serde( + rename = "sourceRefName", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_ref_name: Option<String>, + #[doc = "If set, search for pull requests whose source branch is in this repository."] + #[serde( + rename = "sourceRepositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_repository_id: Option<String>, + #[doc = "If set, search for pull requests that are in this state. Defaults to Active if unset."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<git_pull_request_search_criteria::Status>, + #[doc = "If set, search for pull requests into this branch."] + #[serde( + rename = "targetRefName", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_ref_name: Option<String>, } impl GitPullRequestSearchCriteria { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_pull_request_search_criteria { - use super::*; - #[doc = "The type of time range which should be used for minTime and maxTime. Defaults to Created if unset."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum QueryTimeRangeType { - #[serde(rename = "created")] - Created, - #[serde(rename = "closed")] - Closed, - } - #[doc = "If set, search for pull requests that are in this state. Defaults to Active if unset."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "notSet")] - NotSet, - #[serde(rename = "active")] - Active, - #[serde(rename = "abandoned")] - Abandoned, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "If set, search for pull requests that are in this state. Defaults to Active if unset."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "notSet")] + NotSet, + #[serde(rename = "active")] + Active, + #[serde(rename = "abandoned")] + Abandoned, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "all")] + All, + } } #[doc = "This class contains the metadata of a service/extension posting pull request status. Status can be associated with a pull request or an iteration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestStatus { - #[serde(flatten)] - pub git_status: GitStatus, - #[doc = "ID of the iteration to associate status with. Minimum value is 1."] - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, + #[serde(flatten)] + pub git_status: GitStatus, + #[doc = "ID of the iteration to associate status with. Minimum value is 1."] + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, } impl GitPullRequestStatus { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestStatusList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitPullRequestStatus>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitPullRequestStatus>, } impl GitPullRequestStatusList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Pull Request update options"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPullRequestUpdateOptions { - #[doc = "The description of the pull request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The title of the pull request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[doc = "A list of reviewers on the pull request."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub reviewers: Vec<IdentityId>, - #[doc = "The options which are used when a pull request merge is created."] - #[serde( - rename = "mergeStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub merge_status: Option<GitPullRequestMergeOptions>, - #[doc = "Pull request status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<PullRequestStatus>, - #[doc = ""] - #[serde( - rename = "autoCompleteSetBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub auto_complete_set_by: Option<IdentityRef>, + #[doc = "The description of the pull request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The title of the pull request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[doc = "A list of reviewers on the pull request."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub reviewers: Vec<IdentityId>, + #[doc = "The options which are used when a pull request merge is created."] + #[serde( + rename = "mergeStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub merge_status: Option<GitPullRequestMergeOptions>, + #[doc = "Pull request status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<PullRequestStatus>, + #[doc = ""] + #[serde( + rename = "autoCompleteSetBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub auto_complete_set_by: Option<IdentityRef>, } impl GitPullRequestUpdateOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPush { - #[serde(flatten)] - pub git_push_ref: GitPushRef, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub commits: Vec<GitCommitRef>, - #[serde( - rename = "refUpdates", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ref_updates: Vec<GitRefUpdate>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<GitRepository>, + #[serde(flatten)] + pub git_push_ref: GitPushRef, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub commits: Vec<GitCommitRef>, + #[serde( + rename = "refUpdates", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ref_updates: Vec<GitRefUpdate>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<GitRepository>, } impl GitPush { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPushEventData { - #[serde(rename = "afterId", default, skip_serializing_if = "Option::is_none")] - pub after_id: Option<String>, - #[serde(rename = "beforeId", default, skip_serializing_if = "Option::is_none")] - pub before_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub branch: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub commits: Vec<GitCommit>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<GitRepository>, + #[serde(rename = "afterId", default, skip_serializing_if = "Option::is_none")] + pub after_id: Option<String>, + #[serde(rename = "beforeId", default, skip_serializing_if = "Option::is_none")] + pub before_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub branch: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub commits: Vec<GitCommit>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<GitRepository>, } impl GitPushEventData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPushList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitPush>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitPush>, } impl GitPushList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPushRef { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde(rename = "pushedBy", default, skip_serializing_if = "Option::is_none")] - pub pushed_by: Option<IdentityRef>, - #[serde(rename = "pushId", default, skip_serializing_if = "Option::is_none")] - pub push_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(rename = "pushedBy", default, skip_serializing_if = "Option::is_none")] + pub pushed_by: Option<IdentityRef>, + #[serde(rename = "pushId", default, skip_serializing_if = "Option::is_none")] + pub push_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitPushRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitPushSearchCriteria { - #[serde( - rename = "fromDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub from_date: Option<time::OffsetDateTime>, - #[doc = "Whether to include the _links field on the shallow references"] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[serde( - rename = "includeRefUpdates", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_ref_updates: Option<bool>, - #[serde(rename = "pusherId", default, skip_serializing_if = "Option::is_none")] - pub pusher_id: Option<String>, - #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] - pub ref_name: Option<String>, - #[serde( - rename = "toDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub to_date: Option<time::OffsetDateTime>, + #[serde( + rename = "fromDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub from_date: Option<time::OffsetDateTime>, + #[doc = "Whether to include the _links field on the shallow references"] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[serde( + rename = "includeRefUpdates", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_ref_updates: Option<bool>, + #[serde(rename = "pusherId", default, skip_serializing_if = "Option::is_none")] + pub pusher_id: Option<String>, + #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] + pub ref_name: Option<String>, + #[serde( + rename = "toDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub to_date: Option<time::OffsetDateTime>, } impl GitPushSearchCriteria { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitQueryBranchStatsCriteria { - #[doc = ""] - #[serde( - rename = "baseCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub base_commit: Option<GitVersionDescriptor>, - #[serde( - rename = "targetCommits", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub target_commits: Vec<GitVersionDescriptor>, + #[doc = ""] + #[serde( + rename = "baseCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub base_commit: Option<GitVersionDescriptor>, + #[serde( + rename = "targetCommits", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub target_commits: Vec<GitVersionDescriptor>, } impl GitQueryBranchStatsCriteria { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitQueryCommitsCriteria { - #[doc = "Number of entries to skip"] - #[serde(rename = "$skip", default, skip_serializing_if = "Option::is_none")] - pub skip: Option<i32>, - #[doc = "Maximum number of entries to retrieve"] - #[serde(rename = "$top", default, skip_serializing_if = "Option::is_none")] - pub top: Option<i32>, - #[doc = "Alias or display name of the author"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<String>, - #[doc = ""] - #[serde( - rename = "compareVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub compare_version: Option<GitVersionDescriptor>, - #[doc = "Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path."] - #[serde( - rename = "excludeDeletes", - default, - skip_serializing_if = "Option::is_none" - )] - pub exclude_deletes: Option<bool>, - #[doc = "If provided, a lower bound for filtering commits alphabetically"] - #[serde( - rename = "fromCommitId", - default, - skip_serializing_if = "Option::is_none" - )] - pub from_commit_id: Option<String>, - #[doc = "If provided, only include history entries created after this date (string)"] - #[serde(rename = "fromDate", default, skip_serializing_if = "Option::is_none")] - pub from_date: Option<String>, - #[doc = "What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified."] - #[serde( - rename = "historyMode", - default, - skip_serializing_if = "Option::is_none" - )] - pub history_mode: Option<git_query_commits_criteria::HistoryMode>, - #[doc = "If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ids: Vec<String>, - #[doc = "Whether to include the _links field on the shallow references"] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[doc = "Whether to include the push information"] - #[serde( - rename = "includePushData", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_push_data: Option<bool>, - #[doc = "Whether to include the image Url for committers and authors"] - #[serde( - rename = "includeUserImageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_user_image_url: Option<bool>, - #[doc = "Whether to include linked work items"] - #[serde( - rename = "includeWorkItems", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_work_items: Option<bool>, - #[doc = "Path of item to search under"] - #[serde(rename = "itemPath", default, skip_serializing_if = "Option::is_none")] - pub item_path: Option<String>, - #[doc = ""] - #[serde( - rename = "itemVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub item_version: Option<GitVersionDescriptor>, - #[doc = "If enabled, this option will ignore the itemVersion and compareVersion parameters"] - #[serde( - rename = "showOldestCommitsFirst", - default, - skip_serializing_if = "Option::is_none" - )] - pub show_oldest_commits_first: Option<bool>, - #[doc = "If provided, an upper bound for filtering commits alphabetically"] - #[serde( - rename = "toCommitId", - default, - skip_serializing_if = "Option::is_none" - )] - pub to_commit_id: Option<String>, - #[doc = "If provided, only include history entries created before this date (string)"] - #[serde(rename = "toDate", default, skip_serializing_if = "Option::is_none")] - pub to_date: Option<String>, - #[doc = "Alias or display name of the committer"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub user: Option<String>, + #[doc = "Number of entries to skip"] + #[serde(rename = "$skip", default, skip_serializing_if = "Option::is_none")] + pub skip: Option<i32>, + #[doc = "Maximum number of entries to retrieve"] + #[serde(rename = "$top", default, skip_serializing_if = "Option::is_none")] + pub top: Option<i32>, + #[doc = "Alias or display name of the author"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<String>, + #[doc = ""] + #[serde( + rename = "compareVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub compare_version: Option<GitVersionDescriptor>, + #[doc = "Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path."] + #[serde( + rename = "excludeDeletes", + default, + skip_serializing_if = "Option::is_none" + )] + pub exclude_deletes: Option<bool>, + #[doc = "If provided, a lower bound for filtering commits alphabetically"] + #[serde( + rename = "fromCommitId", + default, + skip_serializing_if = "Option::is_none" + )] + pub from_commit_id: Option<String>, + #[doc = "If provided, only include history entries created after this date (string)"] + #[serde(rename = "fromDate", default, skip_serializing_if = "Option::is_none")] + pub from_date: Option<String>, + #[doc = "What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified."] + #[serde( + rename = "historyMode", + default, + skip_serializing_if = "Option::is_none" + )] + pub history_mode: Option<git_query_commits_criteria::HistoryMode>, + #[doc = "If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ids: Vec<String>, + #[doc = "Whether to include the _links field on the shallow references"] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[doc = "Whether to include the push information"] + #[serde( + rename = "includePushData", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_push_data: Option<bool>, + #[doc = "Whether to include the image Url for committers and authors"] + #[serde( + rename = "includeUserImageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_user_image_url: Option<bool>, + #[doc = "Whether to include linked work items"] + #[serde( + rename = "includeWorkItems", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_work_items: Option<bool>, + #[doc = "Path of item to search under"] + #[serde(rename = "itemPath", default, skip_serializing_if = "Option::is_none")] + pub item_path: Option<String>, + #[doc = ""] + #[serde( + rename = "itemVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub item_version: Option<GitVersionDescriptor>, + #[doc = "If enabled, this option will ignore the itemVersion and compareVersion parameters"] + #[serde( + rename = "showOldestCommitsFirst", + default, + skip_serializing_if = "Option::is_none" + )] + pub show_oldest_commits_first: Option<bool>, + #[doc = "If provided, an upper bound for filtering commits alphabetically"] + #[serde( + rename = "toCommitId", + default, + skip_serializing_if = "Option::is_none" + )] + pub to_commit_id: Option<String>, + #[doc = "If provided, only include history entries created before this date (string)"] + #[serde(rename = "toDate", default, skip_serializing_if = "Option::is_none")] + pub to_date: Option<String>, + #[doc = "Alias or display name of the committer"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub user: Option<String>, } impl GitQueryCommitsCriteria { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_query_commits_criteria { - use super::*; - #[doc = "What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum HistoryMode { - #[serde(rename = "simplifiedHistory")] - SimplifiedHistory, - #[serde(rename = "firstParent")] - FirstParent, - #[serde(rename = "fullHistory")] - FullHistory, - #[serde(rename = "fullHistorySimplifyMerges")] - FullHistorySimplifyMerges, - } + use super::*; + #[doc = "What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum HistoryMode { + #[serde(rename = "simplifiedHistory")] + SimplifiedHistory, + #[serde(rename = "firstParent")] + FirstParent, + #[serde(rename = "fullHistory")] + FullHistory, + #[serde(rename = "fullHistorySimplifyMerges")] + FullHistorySimplifyMerges, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitQueryRefsCriteria { - #[doc = "List of commit Ids to be searched"] - #[serde( - rename = "commitIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub commit_ids: Vec<String>, - #[doc = "List of complete or partial names for refs to be searched"] - #[serde( - rename = "refNames", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ref_names: Vec<String>, - #[doc = "Type of search on refNames, if provided"] - #[serde( - rename = "searchType", - default, - skip_serializing_if = "Option::is_none" - )] - pub search_type: Option<git_query_refs_criteria::SearchType>, + #[doc = "List of commit Ids to be searched"] + #[serde( + rename = "commitIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub commit_ids: Vec<String>, + #[doc = "List of complete or partial names for refs to be searched"] + #[serde( + rename = "refNames", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ref_names: Vec<String>, + #[doc = "Type of search on refNames, if provided"] + #[serde( + rename = "searchType", + default, + skip_serializing_if = "Option::is_none" + )] + pub search_type: Option<git_query_refs_criteria::SearchType>, } impl GitQueryRefsCriteria { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_query_refs_criteria { - use super::*; - #[doc = "Type of search on refNames, if provided"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SearchType { - #[serde(rename = "exact")] - Exact, - #[serde(rename = "startsWith")] - StartsWith, - #[serde(rename = "contains")] - Contains, - } + use super::*; + #[doc = "Type of search on refNames, if provided"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SearchType { + #[serde(rename = "exact")] + Exact, + #[serde(rename = "startsWith")] + StartsWith, + #[serde(rename = "contains")] + Contains, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRecycleBinRepositoryDetails { - #[doc = "Setting to false will undo earlier deletion and restore the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deleted: Option<bool>, + #[doc = "Setting to false will undo earlier deletion and restore the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deleted: Option<bool>, } impl GitRecycleBinRepositoryDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GitRef { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub creator: Option<IdentityRef>, - #[serde(rename = "isLocked", default, skip_serializing_if = "Option::is_none")] - pub is_locked: Option<bool>, - #[doc = ""] - #[serde( - rename = "isLockedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_locked_by: Option<IdentityRef>, - pub name: String, - #[serde(rename = "objectId")] - pub object_id: String, - #[serde( - rename = "peeledObjectId", - default, - skip_serializing_if = "Option::is_none" - )] - pub peeled_object_id: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub statuses: Vec<GitStatus>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub creator: Option<IdentityRef>, + #[serde(rename = "isLocked", default, skip_serializing_if = "Option::is_none")] + pub is_locked: Option<bool>, + #[doc = ""] + #[serde( + rename = "isLockedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_locked_by: Option<IdentityRef>, + pub name: String, + #[serde(rename = "objectId")] + pub object_id: String, + #[serde( + rename = "peeledObjectId", + default, + skip_serializing_if = "Option::is_none" + )] + pub peeled_object_id: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub statuses: Vec<GitStatus>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitRef { - pub fn new(name: String, object_id: String) -> Self { - Self { - links: None, - creator: None, - is_locked: None, - is_locked_by: None, - name, - object_id, - peeled_object_id: None, - statuses: Vec::new(), - url: None, - } - } + pub fn new(name: String, object_id: String) -> Self { + Self { + links: None, + creator: None, + is_locked: None, + is_locked_by: None, + name, + object_id, + peeled_object_id: None, + statuses: Vec::new(), + url: None, + } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRefFavorite { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde( - rename = "identityId", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<git_ref_favorite::Type>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde( + rename = "identityId", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<git_ref_favorite::Type>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitRefFavorite { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_ref_favorite { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "invalid")] - Invalid, - #[serde(rename = "folder")] - Folder, - #[serde(rename = "ref")] - Ref, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "invalid")] + Invalid, + #[serde(rename = "folder")] + Folder, + #[serde(rename = "ref")] + Ref, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRefFavoriteList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitRefFavorite>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitRefFavorite>, } impl GitRefFavoriteList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRefList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitRef>, } impl GitRefList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRefUpdate { - #[serde(rename = "isLocked", default, skip_serializing_if = "Option::is_none")] - pub is_locked: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "newObjectId", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_object_id: Option<String>, - #[serde( - rename = "oldObjectId", - default, - skip_serializing_if = "Option::is_none" - )] - pub old_object_id: Option<String>, - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, + #[serde(rename = "isLocked", default, skip_serializing_if = "Option::is_none")] + pub is_locked: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "newObjectId", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_object_id: Option<String>, + #[serde( + rename = "oldObjectId", + default, + skip_serializing_if = "Option::is_none" + )] + pub old_object_id: Option<String>, + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, } impl GitRefUpdate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRefUpdateResult { - #[doc = "Custom message for the result object For instance, Reason for failing."] - #[serde( - rename = "customMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub custom_message: Option<String>, - #[doc = "Whether the ref is locked or not"] - #[serde(rename = "isLocked", default, skip_serializing_if = "Option::is_none")] - pub is_locked: Option<bool>, - #[doc = "Ref name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "New object ID"] - #[serde( - rename = "newObjectId", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_object_id: Option<String>, - #[doc = "Old object ID"] - #[serde( - rename = "oldObjectId", - default, - skip_serializing_if = "Option::is_none" - )] - pub old_object_id: Option<String>, - #[doc = "Name of the plugin that rejected the updated."] - #[serde( - rename = "rejectedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub rejected_by: Option<String>, - #[doc = "Repository ID"] - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, - #[doc = "True if the ref update succeeded, false otherwise"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub success: Option<bool>, - #[doc = "Status of the update from the TFS server."] - #[serde( - rename = "updateStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub update_status: Option<git_ref_update_result::UpdateStatus>, + #[doc = "Custom message for the result object For instance, Reason for failing."] + #[serde( + rename = "customMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub custom_message: Option<String>, + #[doc = "Whether the ref is locked or not"] + #[serde(rename = "isLocked", default, skip_serializing_if = "Option::is_none")] + pub is_locked: Option<bool>, + #[doc = "Ref name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "New object ID"] + #[serde( + rename = "newObjectId", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_object_id: Option<String>, + #[doc = "Old object ID"] + #[serde( + rename = "oldObjectId", + default, + skip_serializing_if = "Option::is_none" + )] + pub old_object_id: Option<String>, + #[doc = "Name of the plugin that rejected the updated."] + #[serde( + rename = "rejectedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub rejected_by: Option<String>, + #[doc = "Repository ID"] + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, + #[doc = "True if the ref update succeeded, false otherwise"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub success: Option<bool>, + #[doc = "Status of the update from the TFS server."] + #[serde( + rename = "updateStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub update_status: Option<git_ref_update_result::UpdateStatus>, } impl GitRefUpdateResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_ref_update_result { - use super::*; - #[doc = "Status of the update from the TFS server."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum UpdateStatus { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "forcePushRequired")] - ForcePushRequired, - #[serde(rename = "staleOldObjectId")] - StaleOldObjectId, - #[serde(rename = "invalidRefName")] - InvalidRefName, - #[serde(rename = "unprocessed")] - Unprocessed, - #[serde(rename = "unresolvableToCommit")] - UnresolvableToCommit, - #[serde(rename = "writePermissionRequired")] - WritePermissionRequired, - #[serde(rename = "manageNotePermissionRequired")] - ManageNotePermissionRequired, - #[serde(rename = "createBranchPermissionRequired")] - CreateBranchPermissionRequired, - #[serde(rename = "createTagPermissionRequired")] - CreateTagPermissionRequired, - #[serde(rename = "rejectedByPlugin")] - RejectedByPlugin, - #[serde(rename = "locked")] - Locked, - #[serde(rename = "refNameConflict")] - RefNameConflict, - #[serde(rename = "rejectedByPolicy")] - RejectedByPolicy, - #[serde(rename = "succeededNonExistentRef")] - SucceededNonExistentRef, - #[serde(rename = "succeededCorruptRef")] - SucceededCorruptRef, - } + use super::*; + #[doc = "Status of the update from the TFS server."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum UpdateStatus { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "forcePushRequired")] + ForcePushRequired, + #[serde(rename = "staleOldObjectId")] + StaleOldObjectId, + #[serde(rename = "invalidRefName")] + InvalidRefName, + #[serde(rename = "unprocessed")] + Unprocessed, + #[serde(rename = "unresolvableToCommit")] + UnresolvableToCommit, + #[serde(rename = "writePermissionRequired")] + WritePermissionRequired, + #[serde(rename = "manageNotePermissionRequired")] + ManageNotePermissionRequired, + #[serde(rename = "createBranchPermissionRequired")] + CreateBranchPermissionRequired, + #[serde(rename = "createTagPermissionRequired")] + CreateTagPermissionRequired, + #[serde(rename = "rejectedByPlugin")] + RejectedByPlugin, + #[serde(rename = "locked")] + Locked, + #[serde(rename = "refNameConflict")] + RefNameConflict, + #[serde(rename = "rejectedByPolicy")] + RejectedByPolicy, + #[serde(rename = "succeededNonExistentRef")] + SucceededNonExistentRef, + #[serde(rename = "succeededCorruptRef")] + SucceededCorruptRef, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRefUpdateResultList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitRefUpdateResult>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitRefUpdateResult>, } impl GitRefUpdateResultList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GitRepository { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde( - rename = "defaultBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_branch: Option<String>, - pub id: String, - #[doc = "True if the repository is disabled. False otherwise."] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "True if the repository was created as a fork."] - #[serde(rename = "isFork", default, skip_serializing_if = "Option::is_none")] - pub is_fork: Option<bool>, - #[doc = "True if the repository is in maintenance. False otherwise."] - #[serde( - rename = "isInMaintenance", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_in_maintenance: Option<bool>, - pub name: String, - #[doc = ""] - #[serde( - rename = "parentRepository", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_repository: Option<GitRepositoryRef>, - #[doc = "Represents a shallow reference to a TeamProject."] - pub project: TeamProjectReference, - #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] - pub remote_url: Option<String>, - #[doc = "Compressed size (bytes) of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[serde(rename = "sshUrl", default, skip_serializing_if = "Option::is_none")] - pub ssh_url: Option<String>, - pub url: String, - #[serde( - rename = "validRemoteUrls", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub valid_remote_urls: Vec<String>, - #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] - pub web_url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde( + rename = "defaultBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_branch: Option<String>, + pub id: String, + #[doc = "True if the repository is disabled. False otherwise."] + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[doc = "True if the repository was created as a fork."] + #[serde(rename = "isFork", default, skip_serializing_if = "Option::is_none")] + pub is_fork: Option<bool>, + pub name: String, + #[doc = ""] + #[serde( + rename = "parentRepository", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_repository: Option<GitRepositoryRef>, + #[doc = "Represents a shallow reference to a TeamProject."] + pub project: TeamProjectReference, + #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] + pub remote_url: Option<String>, + #[doc = "Compressed size (bytes) of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[serde(rename = "sshUrl", default, skip_serializing_if = "Option::is_none")] + pub ssh_url: Option<String>, + pub url: String, + #[serde( + rename = "validRemoteUrls", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub valid_remote_urls: Vec<String>, + #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] + pub web_url: Option<String>, } impl GitRepository { - pub fn new(id: String, name: String, project: TeamProjectReference, url: String) -> Self { - Self { - links: None, - default_branch: None, - id, - is_disabled: None, - is_fork: None, - is_in_maintenance: None, - name, - parent_repository: None, - project, - remote_url: None, - size: None, - ssh_url: None, - url, - valid_remote_urls: Vec::new(), - web_url: None, - } - } + pub fn new(id: String, name: String, project: TeamProjectReference, url: String) -> Self { + Self { + links: None, + default_branch: None, + id, + is_disabled: None, + is_fork: None, + name, + parent_repository: None, + project, + remote_url: None, + size: None, + ssh_url: None, + url, + valid_remote_urls: Vec::new(), + web_url: None, + } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRepositoryCreateOptions { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde( - rename = "parentRepository", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_repository: Option<GitRepositoryRef>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde( + rename = "parentRepository", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_repository: Option<GitRepositoryRef>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, } impl GitRepositoryCreateOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRepositoryList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitRepository>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitRepository>, } impl GitRepositoryList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRepositoryRef { - #[doc = "Reference object for a TeamProjectCollection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub collection: Option<TeamProjectCollectionReference>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "True if the repository was created as a fork"] - #[serde(rename = "isFork", default, skip_serializing_if = "Option::is_none")] - pub is_fork: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] - pub remote_url: Option<String>, - #[serde(rename = "sshUrl", default, skip_serializing_if = "Option::is_none")] - pub ssh_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Reference object for a TeamProjectCollection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub collection: Option<TeamProjectCollectionReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "True if the repository was created as a fork"] + #[serde(rename = "isFork", default, skip_serializing_if = "Option::is_none")] + pub is_fork: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] + pub remote_url: Option<String>, + #[serde(rename = "sshUrl", default, skip_serializing_if = "Option::is_none")] + pub ssh_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitRepositoryRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRepositoryRefList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitRepositoryRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitRepositoryRef>, } impl GitRepositoryRefList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRepositoryStats { - #[serde( - rename = "activePullRequestsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub active_pull_requests_count: Option<i32>, - #[serde( - rename = "branchesCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub branches_count: Option<i32>, - #[serde( - rename = "commitsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub commits_count: Option<i32>, - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, + #[serde( + rename = "activePullRequestsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub active_pull_requests_count: Option<i32>, + #[serde( + rename = "branchesCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub branches_count: Option<i32>, + #[serde( + rename = "commitsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub commits_count: Option<i32>, + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, } impl GitRepositoryStats { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitResolution { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<IdentityRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<IdentityRef>, } impl GitResolution { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitResolutionMergeContent { - #[serde(flatten)] - pub git_resolution: GitResolution, - #[serde(rename = "mergeType", default, skip_serializing_if = "Option::is_none")] - pub merge_type: Option<git_resolution_merge_content::MergeType>, - #[doc = ""] - #[serde( - rename = "userMergedBlob", - default, - skip_serializing_if = "Option::is_none" - )] - pub user_merged_blob: Option<GitBlobRef>, - #[serde( - rename = "userMergedContent", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub user_merged_content: Vec<String>, + #[serde(flatten)] + pub git_resolution: GitResolution, + #[serde(rename = "mergeType", default, skip_serializing_if = "Option::is_none")] + pub merge_type: Option<git_resolution_merge_content::MergeType>, + #[doc = ""] + #[serde( + rename = "userMergedBlob", + default, + skip_serializing_if = "Option::is_none" + )] + pub user_merged_blob: Option<GitBlobRef>, + #[serde( + rename = "userMergedContent", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub user_merged_content: Vec<String>, } impl GitResolutionMergeContent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_resolution_merge_content { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum MergeType { - #[serde(rename = "undecided")] - Undecided, - #[serde(rename = "takeSourceContent")] - TakeSourceContent, - #[serde(rename = "takeTargetContent")] - TakeTargetContent, - #[serde(rename = "autoMerged")] - AutoMerged, - #[serde(rename = "userMerged")] - UserMerged, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum MergeType { + #[serde(rename = "undecided")] + Undecided, + #[serde(rename = "takeSourceContent")] + TakeSourceContent, + #[serde(rename = "takeTargetContent")] + TakeTargetContent, + #[serde(rename = "autoMerged")] + AutoMerged, + #[serde(rename = "userMerged")] + UserMerged, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitResolutionPathConflict { - #[serde(flatten)] - pub git_resolution: GitResolution, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub action: Option<git_resolution_path_conflict::Action>, - #[serde( - rename = "renamePath", - default, - skip_serializing_if = "Option::is_none" - )] - pub rename_path: Option<String>, + #[serde(flatten)] + pub git_resolution: GitResolution, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub action: Option<git_resolution_path_conflict::Action>, + #[serde( + rename = "renamePath", + default, + skip_serializing_if = "Option::is_none" + )] + pub rename_path: Option<String>, } impl GitResolutionPathConflict { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_resolution_path_conflict { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Action { - #[serde(rename = "undecided")] - Undecided, - #[serde(rename = "keepSourceRenameTarget")] - KeepSourceRenameTarget, - #[serde(rename = "keepSourceDeleteTarget")] - KeepSourceDeleteTarget, - #[serde(rename = "keepTargetRenameSource")] - KeepTargetRenameSource, - #[serde(rename = "keepTargetDeleteSource")] - KeepTargetDeleteSource, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Action { + #[serde(rename = "undecided")] + Undecided, + #[serde(rename = "keepSourceRenameTarget")] + KeepSourceRenameTarget, + #[serde(rename = "keepSourceDeleteTarget")] + KeepSourceDeleteTarget, + #[serde(rename = "keepTargetRenameSource")] + KeepTargetRenameSource, + #[serde(rename = "keepTargetDeleteSource")] + KeepTargetDeleteSource, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitResolutionPickOneAction { - #[serde(flatten)] - pub git_resolution: GitResolution, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub action: Option<git_resolution_pick_one_action::Action>, + #[serde(flatten)] + pub git_resolution: GitResolution, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub action: Option<git_resolution_pick_one_action::Action>, } impl GitResolutionPickOneAction { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_resolution_pick_one_action { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Action { - #[serde(rename = "undecided")] - Undecided, - #[serde(rename = "pickSourceAction")] - PickSourceAction, - #[serde(rename = "pickTargetAction")] - PickTargetAction, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Action { + #[serde(rename = "undecided")] + Undecided, + #[serde(rename = "pickSourceAction")] + PickSourceAction, + #[serde(rename = "pickTargetAction")] + PickTargetAction, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitResolutionRename1to2 { - #[serde(flatten)] - pub git_resolution_merge_content: GitResolutionMergeContent, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub action: Option<git_resolution_rename1to2::Action>, + #[serde(flatten)] + pub git_resolution_merge_content: GitResolutionMergeContent, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub action: Option<git_resolution_rename1to2::Action>, } impl GitResolutionRename1to2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_resolution_rename1to2 { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Action { - #[serde(rename = "undecided")] - Undecided, - #[serde(rename = "keepSourcePath")] - KeepSourcePath, - #[serde(rename = "keepTargetPath")] - KeepTargetPath, - #[serde(rename = "keepBothFiles")] - KeepBothFiles, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Action { + #[serde(rename = "undecided")] + Undecided, + #[serde(rename = "keepSourcePath")] + KeepSourcePath, + #[serde(rename = "keepTargetPath")] + KeepTargetPath, + #[serde(rename = "keepBothFiles")] + KeepBothFiles, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRevert { - #[serde(flatten)] - pub git_async_ref_operation: GitAsyncRefOperation, - #[serde(rename = "revertId", default, skip_serializing_if = "Option::is_none")] - pub revert_id: Option<i32>, + #[serde(flatten)] + pub git_async_ref_operation: GitAsyncRefOperation, + #[serde(rename = "revertId", default, skip_serializing_if = "Option::is_none")] + pub revert_id: Option<i32>, } impl GitRevert { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This class contains the metadata of a service/extension posting a status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitStatus { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Status context that uniquely identifies the status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub context: Option<GitStatusContext>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Creation date and time of the status."] - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[doc = "Status description. Typically describes current state of the status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Status identifier."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "State of the status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<git_status::State>, - #[doc = "URL with status details."] - #[serde(rename = "targetUrl", default, skip_serializing_if = "Option::is_none")] - pub target_url: Option<String>, - #[doc = "Last update date and time of the status."] - #[serde( - rename = "updatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub updated_date: Option<time::OffsetDateTime>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Status context that uniquely identifies the status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub context: Option<GitStatusContext>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "Creation date and time of the status."] + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[doc = "Status description. Typically describes current state of the status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Status identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "State of the status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<git_status::State>, + #[doc = "URL with status details."] + #[serde(rename = "targetUrl", default, skip_serializing_if = "Option::is_none")] + pub target_url: Option<String>, + #[doc = "Last update date and time of the status."] + #[serde( + rename = "updatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub updated_date: Option<time::OffsetDateTime>, } impl GitStatus { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_status { - use super::*; - #[doc = "State of the status."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "notSet")] - NotSet, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "error")] - Error, - #[serde(rename = "notApplicable")] - NotApplicable, - } + use super::*; + #[doc = "State of the status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "notSet")] + NotSet, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "error")] + Error, + #[serde(rename = "notApplicable")] + NotApplicable, + } } #[doc = "Status context that uniquely identifies the status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitStatusContext { - #[doc = "Genre of the status. Typically name of the service/tool generating the status, can be empty."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub genre: Option<String>, - #[doc = "Name identifier of the status, cannot be null or empty."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Genre of the status. Typically name of the service/tool generating the status, can be empty."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub genre: Option<String>, + #[doc = "Name identifier of the status, cannot be null or empty."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl GitStatusContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitStatusList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitStatus>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitStatus>, } impl GitStatusList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An object describing the git suggestion. Git suggestions are currently limited to suggested pull requests."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitSuggestion { - #[doc = "Specific properties describing the suggestion."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "The type of suggestion (e.g. pull request)."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Specific properties describing the suggestion."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "The type of suggestion (e.g. pull request)."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl GitSuggestion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitSuggestionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GitSuggestion>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GitSuggestion>, } impl GitSuggestionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitTargetVersionDescriptor { - #[serde(flatten)] - pub git_version_descriptor: GitVersionDescriptor, - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - #[serde( - rename = "targetVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_version: Option<String>, - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - #[serde( - rename = "targetVersionOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_version_options: Option<git_target_version_descriptor::TargetVersionOptions>, - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - #[serde( - rename = "targetVersionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_version_type: Option<git_target_version_descriptor::TargetVersionType>, + #[serde(flatten)] + pub git_version_descriptor: GitVersionDescriptor, + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + #[serde( + rename = "targetVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_version: Option<String>, + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + #[serde( + rename = "targetVersionOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_version_options: Option<git_target_version_descriptor::TargetVersionOptions>, + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + #[serde( + rename = "targetVersionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_version_type: Option<git_target_version_descriptor::TargetVersionType>, } impl GitTargetVersionDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_target_version_descriptor { - use super::*; - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TargetVersionOptions { - #[serde(rename = "none")] - None, - #[serde(rename = "previousChange")] - PreviousChange, - #[serde(rename = "firstParent")] - FirstParent, - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TargetVersionType { - #[serde(rename = "branch")] - Branch, - #[serde(rename = "tag")] - Tag, - #[serde(rename = "commit")] - Commit, - } + use super::*; + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum TargetVersionOptions { + #[serde(rename = "none")] + None, + #[serde(rename = "previousChange")] + PreviousChange, + #[serde(rename = "firstParent")] + FirstParent, + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum TargetVersionType { + #[serde(rename = "branch")] + Branch, + #[serde(rename = "tag")] + Tag, + #[serde(rename = "commit")] + Commit, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitTemplate { - #[doc = "Name of the Template"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Type of the Template"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Name of the Template"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Type of the Template"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl GitTemplate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitTreeDiff { - #[doc = "ObjectId of the base tree of this diff."] - #[serde( - rename = "baseTreeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub base_tree_id: Option<String>, - #[doc = "List of tree entries that differ between the base and target tree. Renames and object type changes are returned as a delete for the old object and add for the new object. If a continuation token is returned in the response header, some tree entries are yet to be processed and may yield more diff entries. If the continuation token is not returned all the diff entries have been included in this response."] - #[serde( - rename = "diffEntries", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub diff_entries: Vec<GitTreeDiffEntry>, - #[doc = "ObjectId of the target tree of this diff."] - #[serde( - rename = "targetTreeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_tree_id: Option<String>, - #[doc = "REST Url to this resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "ObjectId of the base tree of this diff."] + #[serde( + rename = "baseTreeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub base_tree_id: Option<String>, + #[doc = "List of tree entries that differ between the base and target tree. Renames and object type changes are returned as a delete for the old object and add for the new object. If a continuation token is returned in the response header, some tree entries are yet to be processed and may yield more diff entries. If the continuation token is not returned all the diff entries have been included in this response."] + #[serde( + rename = "diffEntries", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub diff_entries: Vec<GitTreeDiffEntry>, + #[doc = "ObjectId of the target tree of this diff."] + #[serde( + rename = "targetTreeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_tree_id: Option<String>, + #[doc = "REST Url to this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitTreeDiff { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitTreeDiffEntry { - #[doc = "SHA1 hash of the object in the base tree, if it exists. Will be null in case of adds."] - #[serde( - rename = "baseObjectId", - default, - skip_serializing_if = "Option::is_none" - )] - pub base_object_id: Option<String>, - #[doc = "Type of change that affected this entry."] - #[serde( - rename = "changeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_type: Option<git_tree_diff_entry::ChangeType>, - #[doc = "Object type of the tree entry. Blob, Tree or Commit(\"submodule\")"] - #[serde( - rename = "objectType", - default, - skip_serializing_if = "Option::is_none" - )] - pub object_type: Option<git_tree_diff_entry::ObjectType>, - #[doc = "Relative path in base and target trees."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "SHA1 hash of the object in the target tree, if it exists. Will be null in case of deletes."] - #[serde( - rename = "targetObjectId", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_object_id: Option<String>, + #[doc = "SHA1 hash of the object in the base tree, if it exists. Will be null in case of adds."] + #[serde( + rename = "baseObjectId", + default, + skip_serializing_if = "Option::is_none" + )] + pub base_object_id: Option<String>, + #[doc = "Type of change that affected this entry."] + #[serde( + rename = "changeType", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_type: Option<git_tree_diff_entry::ChangeType>, + #[doc = "Object type of the tree entry. Blob, Tree or Commit(\"submodule\")"] + #[serde( + rename = "objectType", + default, + skip_serializing_if = "Option::is_none" + )] + pub object_type: Option<git_tree_diff_entry::ObjectType>, + #[doc = "Relative path in base and target trees."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "SHA1 hash of the object in the target tree, if it exists. Will be null in case of deletes."] + #[serde( + rename = "targetObjectId", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_object_id: Option<String>, } impl GitTreeDiffEntry { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_tree_diff_entry { - use super::*; - #[doc = "Type of change that affected this entry."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ChangeType { - #[serde(rename = "none")] - None, - #[serde(rename = "add")] - Add, - #[serde(rename = "edit")] - Edit, - #[serde(rename = "encoding")] - Encoding, - #[serde(rename = "rename")] - Rename, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "undelete")] - Undelete, - #[serde(rename = "branch")] - Branch, - #[serde(rename = "merge")] - Merge, - #[serde(rename = "lock")] - Lock, - #[serde(rename = "rollback")] - Rollback, - #[serde(rename = "sourceRename")] - SourceRename, - #[serde(rename = "targetRename")] - TargetRename, - #[serde(rename = "property")] - Property, - #[serde(rename = "all")] - All, - } - #[doc = "Object type of the tree entry. Blob, Tree or Commit(\"submodule\")"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ObjectType { - #[serde(rename = "bad")] - Bad, - #[serde(rename = "commit")] - Commit, - #[serde(rename = "tree")] - Tree, - #[serde(rename = "blob")] - Blob, - #[serde(rename = "tag")] - Tag, - #[serde(rename = "ext2")] - Ext2, - #[serde(rename = "ofsDelta")] - OfsDelta, - #[serde(rename = "refDelta")] - RefDelta, - } + use super::*; + #[doc = "Type of change that affected this entry."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ChangeType { + #[serde(rename = "none")] + None, + #[serde(rename = "add")] + Add, + #[serde(rename = "edit")] + Edit, + #[serde(rename = "encoding")] + Encoding, + #[serde(rename = "rename")] + Rename, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "undelete")] + Undelete, + #[serde(rename = "branch")] + Branch, + #[serde(rename = "merge")] + Merge, + #[serde(rename = "lock")] + Lock, + #[serde(rename = "rollback")] + Rollback, + #[serde(rename = "sourceRename")] + SourceRename, + #[serde(rename = "targetRename")] + TargetRename, + #[serde(rename = "property")] + Property, + #[serde(rename = "all")] + All, + } + #[doc = "Object type of the tree entry. Blob, Tree or Commit(\"submodule\")"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ObjectType { + #[serde(rename = "bad")] + Bad, + #[serde(rename = "commit")] + Commit, + #[serde(rename = "tree")] + Tree, + #[serde(rename = "blob")] + Blob, + #[serde(rename = "tag")] + Tag, + #[serde(rename = "ext2")] + Ext2, + #[serde(rename = "ofsDelta")] + OfsDelta, + #[serde(rename = "refDelta")] + RefDelta, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitTreeDiffResponse { - #[doc = "The HTTP client methods find the continuation token header in the response and populate this field."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub continuation_token: Vec<String>, - #[doc = ""] - #[serde(rename = "treeDiff", default, skip_serializing_if = "Option::is_none")] - pub tree_diff: Option<GitTreeDiff>, + #[doc = "The HTTP client methods find the continuation token header in the response and populate this field."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub continuation_token: Vec<String>, + #[doc = ""] + #[serde(rename = "treeDiff", default, skip_serializing_if = "Option::is_none")] + pub tree_diff: Option<GitTreeDiff>, } impl GitTreeDiffResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitTreeEntryRef { - #[doc = "Blob or tree"] - #[serde( - rename = "gitObjectType", - default, - skip_serializing_if = "Option::is_none" - )] - pub git_object_type: Option<git_tree_entry_ref::GitObjectType>, - #[doc = "Mode represented as octal string"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option<String>, - #[doc = "SHA1 hash of git object"] - #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] - pub object_id: Option<String>, - #[doc = "Path relative to parent tree object"] - #[serde( - rename = "relativePath", - default, - skip_serializing_if = "Option::is_none" - )] - pub relative_path: Option<String>, - #[doc = "Size of content"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[doc = "url to retrieve tree or blob"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Blob or tree"] + #[serde( + rename = "gitObjectType", + default, + skip_serializing_if = "Option::is_none" + )] + pub git_object_type: Option<git_tree_entry_ref::GitObjectType>, + #[doc = "Mode represented as octal string"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mode: Option<String>, + #[doc = "SHA1 hash of git object"] + #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] + pub object_id: Option<String>, + #[doc = "Path relative to parent tree object"] + #[serde( + rename = "relativePath", + default, + skip_serializing_if = "Option::is_none" + )] + pub relative_path: Option<String>, + #[doc = "Size of content"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[doc = "url to retrieve tree or blob"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitTreeEntryRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_tree_entry_ref { - use super::*; - #[doc = "Blob or tree"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum GitObjectType { - #[serde(rename = "bad")] - Bad, - #[serde(rename = "commit")] - Commit, - #[serde(rename = "tree")] - Tree, - #[serde(rename = "blob")] - Blob, - #[serde(rename = "tag")] - Tag, - #[serde(rename = "ext2")] - Ext2, - #[serde(rename = "ofsDelta")] - OfsDelta, - #[serde(rename = "refDelta")] - RefDelta, - } + use super::*; + #[doc = "Blob or tree"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum GitObjectType { + #[serde(rename = "bad")] + Bad, + #[serde(rename = "commit")] + Commit, + #[serde(rename = "tree")] + Tree, + #[serde(rename = "blob")] + Blob, + #[serde(rename = "tag")] + Tag, + #[serde(rename = "ext2")] + Ext2, + #[serde(rename = "ofsDelta")] + OfsDelta, + #[serde(rename = "refDelta")] + RefDelta, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitTreeRef { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "SHA1 hash of git object"] - #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] - pub object_id: Option<String>, - #[doc = "Sum of sizes of all children"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[doc = "Blobs and trees under this tree"] - #[serde( - rename = "treeEntries", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tree_entries: Vec<GitTreeEntryRef>, - #[doc = "Url to tree"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "SHA1 hash of git object"] + #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] + pub object_id: Option<String>, + #[doc = "Sum of sizes of all children"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[doc = "Blobs and trees under this tree"] + #[serde( + rename = "treeEntries", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tree_entries: Vec<GitTreeEntryRef>, + #[doc = "Url to tree"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitTreeRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "User info and date for Git operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitUserDate { - #[doc = "Date of the Git operation."] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date: Option<time::OffsetDateTime>, - #[doc = "Email address of the user performing the Git operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub email: Option<String>, - #[doc = "Url for the user's avatar."] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Name of the user performing the Git operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Date of the Git operation."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date: Option<time::OffsetDateTime>, + #[doc = "Email address of the user performing the Git operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email: Option<String>, + #[doc = "Url for the user's avatar."] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Name of the user performing the Git operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl GitUserDate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitVersionDescriptor { - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - #[serde( - rename = "versionOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_options: Option<git_version_descriptor::VersionOptions>, - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - #[serde( - rename = "versionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_type: Option<git_version_descriptor::VersionType>, + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + #[serde( + rename = "versionOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_options: Option<git_version_descriptor::VersionOptions>, + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + #[serde( + rename = "versionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_type: Option<git_version_descriptor::VersionType>, } impl GitVersionDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_version_descriptor { - use super::*; - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionOptions { - #[serde(rename = "none")] - None, - #[serde(rename = "previousChange")] - PreviousChange, - #[serde(rename = "firstParent")] - FirstParent, - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionType { - #[serde(rename = "branch")] - Branch, - #[serde(rename = "tag")] - Tag, - #[serde(rename = "commit")] - Commit, - } + use super::*; + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionOptions { + #[serde(rename = "none")] + None, + #[serde(rename = "previousChange")] + PreviousChange, + #[serde(rename = "firstParent")] + FirstParent, + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionType { + #[serde(rename = "branch")] + Branch, + #[serde(rename = "tag")] + Tag, + #[serde(rename = "commit")] + Commit, + } } #[doc = "Globally unique key for a repository."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GlobalGitRepositoryKey { - #[doc = "Team Project Collection ID of the collection for the repository."] - #[serde( - rename = "collectionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub collection_id: Option<String>, - #[doc = "Team Project ID of the project for the repository."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "ID of the repository."] - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, + #[doc = "Team Project Collection ID of the collection for the repository."] + #[serde( + rename = "collectionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub collection_id: Option<String>, + #[doc = "Team Project ID of the project for the repository."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "ID of the repository."] + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, } impl GlobalGitRepositoryKey { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HistoryEntry { - #[doc = ""] - #[serde( - rename = "changeList", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_list: Option<ChangeList>, - #[doc = "The change made to the item from this change list (only relevant for File history, not folders)"] - #[serde( - rename = "itemChangeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub item_change_type: Option<history_entry::ItemChangeType>, - #[doc = "The path of the item at this point in history (only relevant for File history, not folders)"] - #[serde( - rename = "serverItem", - default, - skip_serializing_if = "Option::is_none" - )] - pub server_item: Option<String>, + #[doc = ""] + #[serde( + rename = "changeList", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_list: Option<ChangeList>, + #[doc = "The change made to the item from this change list (only relevant for File history, not folders)"] + #[serde( + rename = "itemChangeType", + default, + skip_serializing_if = "Option::is_none" + )] + pub item_change_type: Option<history_entry::ItemChangeType>, + #[doc = "The path of the item at this point in history (only relevant for File history, not folders)"] + #[serde( + rename = "serverItem", + default, + skip_serializing_if = "Option::is_none" + )] + pub server_item: Option<String>, } impl HistoryEntry { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod history_entry { - use super::*; - #[doc = "The change made to the item from this change list (only relevant for File history, not folders)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ItemChangeType { - #[serde(rename = "none")] - None, - #[serde(rename = "add")] - Add, - #[serde(rename = "edit")] - Edit, - #[serde(rename = "encoding")] - Encoding, - #[serde(rename = "rename")] - Rename, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "undelete")] - Undelete, - #[serde(rename = "branch")] - Branch, - #[serde(rename = "merge")] - Merge, - #[serde(rename = "lock")] - Lock, - #[serde(rename = "rollback")] - Rollback, - #[serde(rename = "sourceRename")] - SourceRename, - #[serde(rename = "targetRename")] - TargetRename, - #[serde(rename = "property")] - Property, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "The change made to the item from this change list (only relevant for File history, not folders)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ItemChangeType { + #[serde(rename = "none")] + None, + #[serde(rename = "add")] + Add, + #[serde(rename = "edit")] + Edit, + #[serde(rename = "encoding")] + Encoding, + #[serde(rename = "rename")] + Rename, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "undelete")] + Undelete, + #[serde(rename = "branch")] + Branch, + #[serde(rename = "merge")] + Merge, + #[serde(rename = "lock")] + Lock, + #[serde(rename = "rollback")] + Rollback, + #[serde(rename = "sourceRename")] + SourceRename, + #[serde(rename = "targetRename")] + TargetRename, + #[serde(rename = "property")] + Property, + #[serde(rename = "all")] + All, + } } #[doc = "Identity id"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityId { - #[doc = "The user identity"] - pub id: String, + #[doc = "The user identity"] + pub id: String, } impl IdentityId { - pub fn new(id: String) -> Self { - Self { id } - } + pub fn new(id: String) -> Self { + Self { id } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde( - rename = "uniqueName", - default, - skip_serializing_if = "Option::is_none" - )] - pub unique_name: Option<String>, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde( + rename = "uniqueName", + default, + skip_serializing_if = "Option::is_none" + )] + pub unique_name: Option<String>, } impl IdentityRef { - pub fn new(id: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name: None, - } - } + pub fn new(id: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name: None, + } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityRefList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<IdentityRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<IdentityRef>, } impl IdentityRefList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Identity information including a vote on a pull request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRefWithVote { - #[serde(flatten)] - pub identity_ref: IdentityRef, - #[doc = "Indicates if this reviewer has declined to review this pull request."] - #[serde( - rename = "hasDeclined", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_declined: Option<bool>, - #[doc = "Indicates if this reviewer is flagged for attention on this pull request."] - #[serde(rename = "isFlagged", default, skip_serializing_if = "Option::is_none")] - pub is_flagged: Option<bool>, - #[doc = "Indicates if this is a required reviewer for this pull request. <br /> Branches can have policies that require particular reviewers are required for pull requests."] - #[serde( - rename = "isRequired", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_required: Option<bool>, - #[doc = "URL to retrieve information about this identity"] - #[serde( - rename = "reviewerUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub reviewer_url: Option<String>, - #[doc = "Vote on a pull request:<br /> 10 - approved 5 - approved with suggestions 0 - no vote -5 - waiting for author -10 - rejected"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub vote: Option<i64>, - #[doc = "Groups or teams that this reviewer contributed to. <br /> Groups and teams can be reviewers on pull requests but can not vote directly. When a member of the group or team votes, that vote is rolled up into the group or team vote. VotedFor is a list of such votes."] - #[serde( - rename = "votedFor", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub voted_for: Vec<IdentityRefWithVote>, + #[serde(flatten)] + pub identity_ref: IdentityRef, + #[doc = "Indicates if this reviewer has declined to review this pull request."] + #[serde( + rename = "hasDeclined", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_declined: Option<bool>, + #[doc = "Indicates if this reviewer is flagged for attention on this pull request."] + #[serde(rename = "isFlagged", default, skip_serializing_if = "Option::is_none")] + pub is_flagged: Option<bool>, + #[doc = "Indicates if this is a required reviewer for this pull request. <br /> Branches can have policies that require particular reviewers are required for pull requests."] + #[serde( + rename = "isRequired", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_required: Option<bool>, + #[doc = "URL to retrieve information about this identity"] + #[serde( + rename = "reviewerUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub reviewer_url: Option<String>, + #[doc = "Vote on a pull request:<br /> 10 - approved 5 - approved with suggestions 0 - no vote -5 - waiting for author -10 - rejected"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vote: Option<i64>, + #[doc = "Groups or teams that that this reviewer contributed to. <br /> Groups and teams can be reviewers on pull requests but can not vote directly. When a member of the group or team votes, that vote is rolled up into the group or team vote. VotedFor is a list of such votes."] + #[serde( + rename = "votedFor", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub voted_for: Vec<IdentityRefWithVote>, } impl IdentityRefWithVote { - pub fn new(identity_ref: IdentityRef) -> Self { - Self { - identity_ref, - has_declined: None, - is_flagged: None, - is_required: None, - reviewer_url: None, - vote: None, - voted_for: Vec::new(), - } - } + pub fn new(identity_ref: IdentityRef) -> Self { + Self { + identity_ref, + has_declined: None, + is_flagged: None, + is_required: None, + reviewer_url: None, + vote: None, + voted_for: Vec::new(), + } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityRefWithVoteList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<IdentityRefWithVote>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<IdentityRefWithVote>, } impl IdentityRefWithVoteList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ImportRepositoryValidation { - #[doc = "Parameter for creating a git import request when source is Git version control"] - #[serde(rename = "gitSource", default, skip_serializing_if = "Option::is_none")] - pub git_source: Option<GitImportGitSource>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option<String>, - #[doc = "Parameter for creating a git import request when source is tfvc version control"] - #[serde( - rename = "tfvcSource", - default, - skip_serializing_if = "Option::is_none" - )] - pub tfvc_source: Option<GitImportTfvcSource>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option<String>, + #[doc = "Parameter for creating a git import request when source is Git version control"] + #[serde(rename = "gitSource", default, skip_serializing_if = "Option::is_none")] + pub git_source: Option<GitImportGitSource>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub password: Option<String>, + #[doc = "Parameter for creating a git import request when source is tfvc version control"] + #[serde( + rename = "tfvcSource", + default, + skip_serializing_if = "Option::is_none" + )] + pub tfvc_source: Option<GitImportTfvcSource>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option<String>, } impl ImportRepositoryValidation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IncludedGitCommit { - #[serde(rename = "commitId", default, skip_serializing_if = "Option::is_none")] - pub commit_id: Option<String>, - #[serde( - rename = "commitTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub commit_time: Option<time::OffsetDateTime>, - #[serde( - rename = "parentCommitIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub parent_commit_ids: Vec<String>, - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, + #[serde(rename = "commitId", default, skip_serializing_if = "Option::is_none")] + pub commit_id: Option<String>, + #[serde( + rename = "commitTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub commit_time: Option<time::OffsetDateTime>, + #[serde( + rename = "parentCommitIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub parent_commit_ids: Vec<String>, + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, } impl IncludedGitCommit { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for IsDraft update on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IsDraftUpdatedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl IsDraftUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ItemContent { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub content: Option<String>, - #[serde( - rename = "contentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_type: Option<item_content::ContentType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content: Option<String>, + #[serde( + rename = "contentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_type: Option<item_content::ContentType>, } impl ItemContent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod item_content { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ContentType { - #[serde(rename = "rawText")] - RawText, - #[serde(rename = "base64Encoded")] - Base64Encoded, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ContentType { + #[serde(rename = "rawText")] + RawText, + #[serde(rename = "base64Encoded")] + Base64Encoded, + } } #[doc = "Optional details to include when returning an item model"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ItemDetailsOptions { - #[doc = "If true, include metadata about the file type"] - #[serde( - rename = "includeContentMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_content_metadata: Option<bool>, - #[doc = "Specifies whether to include children (OneLevel), all descendants (Full) or None for folder items"] - #[serde( - rename = "recursionLevel", - default, - skip_serializing_if = "Option::is_none" - )] - pub recursion_level: Option<item_details_options::RecursionLevel>, + #[doc = "If true, include metadata about the file type"] + #[serde( + rename = "includeContentMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_content_metadata: Option<bool>, + #[doc = "Specifies whether to include children (OneLevel), all descendants (Full) or None for folder items"] + #[serde( + rename = "recursionLevel", + default, + skip_serializing_if = "Option::is_none" + )] + pub recursion_level: Option<item_details_options::RecursionLevel>, } impl ItemDetailsOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod item_details_options { - use super::*; - #[doc = "Specifies whether to include children (OneLevel), all descendants (Full) or None for folder items"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum RecursionLevel { - #[serde(rename = "none")] - None, - #[serde(rename = "oneLevel")] - OneLevel, - #[serde(rename = "oneLevelPlusNestedEmptyFolders")] - OneLevelPlusNestedEmptyFolders, - #[serde(rename = "full")] - Full, - } + use super::*; + #[doc = "Specifies whether to include children (OneLevel), all descendants (Full) or None for folder items"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum RecursionLevel { + #[serde(rename = "none")] + None, + #[serde(rename = "oneLevel")] + OneLevel, + #[serde(rename = "oneLevelPlusNestedEmptyFolders")] + OneLevelPlusNestedEmptyFolders, + #[serde(rename = "full")] + Full, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ItemModel { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub content: Option<String>, - #[doc = ""] - #[serde( - rename = "contentMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_metadata: Option<FileContentMetadata>, - #[serde(rename = "isFolder", default, skip_serializing_if = "Option::is_none")] - pub is_folder: Option<bool>, - #[serde(rename = "isSymLink", default, skip_serializing_if = "Option::is_none")] - pub is_sym_link: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content: Option<String>, + #[doc = ""] + #[serde( + rename = "contentMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_metadata: Option<FileContentMetadata>, + #[serde(rename = "isFolder", default, skip_serializing_if = "Option::is_none")] + pub is_folder: Option<bool>, + #[serde(rename = "isSymLink", default, skip_serializing_if = "Option::is_none")] + pub is_sym_link: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ItemModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for JSON Patch Operations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchDocument {} impl JsonPatchDocument { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for a JSON Patch operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchOperation { - #[doc = "The path to copy from for the Move/Copy operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub from: Option<String>, - #[doc = "The patch operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub op: Option<json_patch_operation::Op>, - #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "The value for the operation. This is either a primitive or a JToken."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = "The path to copy from for the Move/Copy operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub from: Option<String>, + #[doc = "The patch operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub op: Option<json_patch_operation::Op>, + #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "The value for the operation. This is either a primitive or a JToken."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl JsonPatchOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod json_patch_operation { - use super::*; - #[doc = "The patch operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Op { - #[serde(rename = "add")] - Add, - #[serde(rename = "remove")] - Remove, - #[serde(rename = "replace")] - Replace, - #[serde(rename = "move")] - Move, - #[serde(rename = "copy")] - Copy, - #[serde(rename = "test")] - Test, - } + use super::*; + #[doc = "The patch operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Op { + #[serde(rename = "add")] + Add, + #[serde(rename = "remove")] + Remove, + #[serde(rename = "replace")] + Replace, + #[serde(rename = "move")] + Move, + #[serde(rename = "copy")] + Copy, + #[serde(rename = "test")] + Test, + } } #[doc = "Real time event (SignalR) for updated labels on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LabelsUpdatedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl LabelsUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent the line diff block"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LineDiffBlock { - #[doc = "Type of change that was made to the block."] - #[serde( - rename = "changeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_type: Option<line_diff_block::ChangeType>, - #[doc = "Line number where this block starts in modified file."] - #[serde( - rename = "modifiedLineNumberStart", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_line_number_start: Option<i32>, - #[doc = "Count of lines in this block in modified file."] - #[serde( - rename = "modifiedLinesCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_lines_count: Option<i32>, - #[doc = "Line number where this block starts in original file."] - #[serde( - rename = "originalLineNumberStart", - default, - skip_serializing_if = "Option::is_none" - )] - pub original_line_number_start: Option<i32>, - #[doc = "Count of lines in this block in original file."] - #[serde( - rename = "originalLinesCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub original_lines_count: Option<i32>, + #[doc = "Type of change that was made to the block."] + #[serde( + rename = "changeType", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_type: Option<line_diff_block::ChangeType>, + #[doc = "Line number where this block starts in modified file."] + #[serde( + rename = "modifiedLineNumberStart", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_line_number_start: Option<i32>, + #[doc = "Count of lines in this block in modified file."] + #[serde( + rename = "modifiedLinesCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_lines_count: Option<i32>, + #[doc = "Line number where this block starts in original file."] + #[serde( + rename = "originalLineNumberStart", + default, + skip_serializing_if = "Option::is_none" + )] + pub original_line_number_start: Option<i32>, + #[doc = "Count of lines in this block in original file."] + #[serde( + rename = "originalLinesCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub original_lines_count: Option<i32>, } impl LineDiffBlock { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod line_diff_block { - use super::*; - #[doc = "Type of change that was made to the block."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ChangeType { - #[serde(rename = "none")] - None, - #[serde(rename = "add")] - Add, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "edit")] - Edit, - } + use super::*; + #[doc = "Type of change that was made to the block."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ChangeType { + #[serde(rename = "none")] + None, + #[serde(rename = "add")] + Add, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "edit")] + Edit, + } } #[doc = "Link URL"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Link { - pub href: String, + pub href: String, } impl Link { - pub fn new(href: String) -> Self { - Self { href } - } + pub fn new(href: String) -> Self { + Self { href } + } } #[doc = "Real time event (SignalR) for a merge completed on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MergeCompletedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl MergeCompletedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The full policy configuration with settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyConfiguration { - #[serde(flatten)] - pub versioned_policy_configuration_ref: VersionedPolicyConfigurationRef, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "The date and time when the policy was created."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Indicates whether the policy is blocking."] - #[serde( - rename = "isBlocking", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_blocking: Option<bool>, - #[doc = "Indicates whether the policy has been (soft) deleted."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "Indicates whether the policy is enabled."] - #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_enabled: Option<bool>, - #[doc = "If set, this policy requires \"Manage Enterprise Policies\" permission to create, edit, or delete."] - #[serde( - rename = "isEnterpriseManaged", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_enterprise_managed: Option<bool>, - #[doc = "The policy configuration settings."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option<serde_json::Value>, + #[serde(flatten)] + pub versioned_policy_configuration_ref: VersionedPolicyConfigurationRef, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "The date and time when the policy was created."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Indicates whether the policy is blocking."] + #[serde( + rename = "isBlocking", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_blocking: Option<bool>, + #[doc = "Indicates whether the policy has been (soft) deleted."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "Indicates whether the policy is enabled."] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option<bool>, + #[doc = "If set, this policy requires \"Manage Enterprise Policies\" permission to create, edit, or delete."] + #[serde( + rename = "isEnterpriseManaged", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_enterprise_managed: Option<bool>, + #[doc = "The policy configuration settings."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub settings: Option<serde_json::Value>, } impl PolicyConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyConfigurationList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<PolicyConfiguration>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<PolicyConfiguration>, } impl PolicyConfigurationList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Policy configuration reference."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyConfigurationRef { - #[doc = "The policy configuration ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Policy type reference."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<PolicyTypeRef>, - #[doc = "The URL where the policy configuration can be retrieved."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The policy configuration ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Policy type reference."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<PolicyTypeRef>, + #[doc = "The URL where the policy configuration can be retrieved."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl PolicyConfigurationRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for a policy evaluation update on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyEvaluationUpdatedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl PolicyEvaluationUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Policy type reference."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyTypeRef { - #[doc = "Display name of the policy type."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "The policy type ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The URL where the policy type can be retrieved."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Display name of the policy type."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "The policy type ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The URL where the policy type can be retrieved."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl PolicyTypeRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PropertiesCollection { - #[doc = "The count of properties in the collection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<serde_json::Value>, - #[doc = "The set of keys in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub keys: Vec<String>, - #[doc = "The set of values in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<String>, + #[doc = "The count of properties in the collection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<serde_json::Value>, + #[doc = "The set of keys in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub keys: Vec<String>, + #[doc = "The set of values in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<String>, } impl PropertiesCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for pull request creation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PullRequestCreatedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl PullRequestCreatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Pull request status"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub enum PullRequestStatus { - #[serde(rename = "notSet")] - NotSet, - #[serde(rename = "active")] - Active, - #[serde(rename = "abandoned")] - Abandoned, - #[serde(rename = "completed")] - Completed, + #[serde(rename = "notSet")] + NotSet, + #[serde(rename = "active")] + Active, + #[serde(rename = "abandoned")] + Abandoned, + #[serde(rename = "completed")] + Completed, } #[doc = "Initial config contract sent to extensions creating tabs on the pull request page"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PullRequestTabExtensionConfig { - #[serde( - rename = "pullRequestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_id: Option<i32>, - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, + #[serde( + rename = "pullRequestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_id: Option<i32>, + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, } impl PullRequestTabExtensionConfig { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Base contract for a real time pull request event (SignalR)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RealTimePullRequestEvent { - #[doc = "The id of this event. Can be used to track send/receive state between client and server."] - #[serde(rename = "eventId", default, skip_serializing_if = "Option::is_none")] - pub event_id: Option<String>, - #[doc = "The id of the pull request this event was generated for."] - #[serde( - rename = "pullRequestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_id: Option<i32>, + #[doc = "The id of this event. Can be used to track send/receive state between client and server."] + #[serde(rename = "eventId", default, skip_serializing_if = "Option::is_none")] + pub event_id: Option<String>, + #[doc = "The id of the pull request this event was generated for."] + #[serde( + rename = "pullRequestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_id: Option<i32>, } impl RealTimePullRequestEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "Link URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub commits: Option<Link>, - #[doc = "Link URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub items: Option<Link>, - #[doc = "Link URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<Link>, - #[doc = "Link URL"] - #[serde( - rename = "pullRequests", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_requests: Option<Link>, - #[doc = "Link URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pushes: Option<Link>, - #[doc = "Link URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub refs: Option<Link>, - #[doc = "Link URL"] - #[serde(rename = "self", default, skip_serializing_if = "Option::is_none")] - pub self_: Option<Link>, - #[doc = "Link URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ssh: Option<Link>, - #[doc = "Link URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub web: Option<Link>, + #[doc = "Link URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub commits: Option<Link>, + #[doc = "Link URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub items: Option<Link>, + #[doc = "Link URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<Link>, + #[doc = "Link URL"] + #[serde( + rename = "pullRequests", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_requests: Option<Link>, + #[doc = "Link URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pushes: Option<Link>, + #[doc = "Link URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub refs: Option<Link>, + #[doc = "Link URL"] + #[serde(rename = "self", default, skip_serializing_if = "Option::is_none")] + pub self_: Option<Link>, + #[doc = "Link URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ssh: Option<Link>, + #[doc = "Link URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub web: Option<Link>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceRef { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ResourceRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceRefList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ResourceRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ResourceRef>, } impl ResourceRefList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for when the target branch of a pull request is changed"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetargetEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl RetargetEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for a reviewer vote update on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReviewerVoteUpdatedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl ReviewerVoteUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for an update to reviewers on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReviewersUpdatedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl ReviewersUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for reviewer votes being reset on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReviewersVotesResetEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl ReviewersVotesResetEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Context used while sharing a pull request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ShareNotificationContext { - #[doc = "Optional user note or message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "Identities of users who will receive a share notification."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub receivers: Vec<IdentityRef>, + #[doc = "Optional user note or message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "Identities of users who will receive a share notification."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub receivers: Vec<IdentityRef>, } impl ShareNotificationContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceToTargetRef { - #[doc = "The source ref to copy. For example, refs/heads/master."] - #[serde(rename = "sourceRef", default, skip_serializing_if = "Option::is_none")] - pub source_ref: Option<String>, - #[doc = "The target ref to update. For example, refs/heads/master."] - #[serde(rename = "targetRef", default, skip_serializing_if = "Option::is_none")] - pub target_ref: Option<String>, + #[doc = "The source ref to copy. For example, refs/heads/master."] + #[serde(rename = "sourceRef", default, skip_serializing_if = "Option::is_none")] + pub source_ref: Option<String>, + #[doc = "The target ref to update. For example, refs/heads/master."] + #[serde(rename = "targetRef", default, skip_serializing_if = "Option::is_none")] + pub target_ref: Option<String>, } impl SourceToTargetRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for an added status on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StatusAddedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl StatusAddedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for a status update on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StatusUpdatedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl StatusUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Real time event (SignalR) for deleted statuses on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StatusesDeletedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl StatusesDeletedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a Supported IDE entity."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SupportedIde { - #[doc = "The download URL for the IDE."] - #[serde( - rename = "downloadUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub download_url: Option<String>, - #[doc = "The type of the IDE."] - #[serde(rename = "ideType", default, skip_serializing_if = "Option::is_none")] - pub ide_type: Option<supported_ide::IdeType>, - #[doc = "The name of the IDE."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The URL to open the protocol handler for the IDE."] - #[serde( - rename = "protocolHandlerUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub protocol_handler_url: Option<String>, - #[doc = "A list of SupportedPlatforms."] - #[serde( - rename = "supportedPlatforms", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub supported_platforms: Vec<String>, + #[doc = "The download URL for the IDE."] + #[serde( + rename = "downloadUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub download_url: Option<String>, + #[doc = "The type of the IDE."] + #[serde(rename = "ideType", default, skip_serializing_if = "Option::is_none")] + pub ide_type: Option<supported_ide::IdeType>, + #[doc = "The name of the IDE."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The URL to open the protocol handler for the IDE."] + #[serde( + rename = "protocolHandlerUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub protocol_handler_url: Option<String>, + #[doc = "A list of SupportedPlatforms."] + #[serde( + rename = "supportedPlatforms", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub supported_platforms: Vec<String>, } impl SupportedIde { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod supported_ide { - use super::*; - #[doc = "The type of the IDE."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum IdeType { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "androidStudio")] - AndroidStudio, - #[serde(rename = "appCode")] - AppCode, - #[serde(rename = "cLion")] - CLion, - #[serde(rename = "dataGrip")] - DataGrip, - #[serde(rename = "eclipse")] - Eclipse, - #[serde(rename = "intelliJ")] - IntelliJ, - #[serde(rename = "mps")] - Mps, - #[serde(rename = "phpStorm")] - PhpStorm, - #[serde(rename = "pyCharm")] - PyCharm, - #[serde(rename = "rubyMine")] - RubyMine, - #[serde(rename = "tower")] - Tower, - #[serde(rename = "visualStudio")] - VisualStudio, - #[serde(rename = "vsCode")] - VsCode, - #[serde(rename = "webStorm")] - WebStorm, - } + use super::*; + #[doc = "The type of the IDE."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum IdeType { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "androidStudio")] + AndroidStudio, + #[serde(rename = "appCode")] + AppCode, + #[serde(rename = "cLion")] + CLion, + #[serde(rename = "dataGrip")] + DataGrip, + #[serde(rename = "eclipse")] + Eclipse, + #[serde(rename = "intelliJ")] + IntelliJ, + #[serde(rename = "mps")] + Mps, + #[serde(rename = "phpStorm")] + PhpStorm, + #[serde(rename = "pyCharm")] + PyCharm, + #[serde(rename = "rubyMine")] + RubyMine, + #[serde(rename = "tower")] + Tower, + #[serde(rename = "visualStudio")] + VisualStudio, + #[serde(rename = "vsCode")] + VsCode, + #[serde(rename = "webStorm")] + WebStorm, + } } #[doc = "Reference object for a TeamProjectCollection."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamProjectCollectionReference { - #[doc = "Collection avatar Url."] - #[serde(rename = "avatarUrl", default, skip_serializing_if = "Option::is_none")] - pub avatar_url: Option<String>, - #[doc = "Collection Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Collection Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Collection REST Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Collection Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Collection Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Collection REST Url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TeamProjectCollectionReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a shallow reference to a TeamProject."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TeamProjectReference { - #[doc = "Project abbreviation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub abbreviation: Option<String>, - #[doc = "Url to default team identity image."] - #[serde( - rename = "defaultTeamImageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_team_image_url: Option<String>, - #[doc = "The project's description (if any)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Project identifier."] - pub id: String, - #[doc = "Project last update time."] - #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] - pub last_update_time: time::OffsetDateTime, - #[doc = "Project name."] - pub name: String, - #[doc = "Project revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, - #[doc = "Project state."] - pub state: team_project_reference::State, - #[doc = "Url to the full version of the object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Project visibility."] - pub visibility: team_project_reference::Visibility, + #[doc = "Project abbreviation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub abbreviation: Option<String>, + #[doc = "Url to default team identity image."] + #[serde( + rename = "defaultTeamImageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_team_image_url: Option<String>, + #[doc = "The project's description (if any)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Project identifier."] + pub id: String, + #[doc = "Project last update time."] + #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] + pub last_update_time: time::OffsetDateTime, + #[doc = "Project name."] + pub name: String, + #[doc = "Project revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i64>, + #[doc = "Project state."] + pub state: team_project_reference::State, + #[doc = "Url to the full version of the object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Project visibility."] + pub visibility: team_project_reference::Visibility, } impl TeamProjectReference { - pub fn new( - id: String, - last_update_time: time::OffsetDateTime, - name: String, - state: team_project_reference::State, - visibility: team_project_reference::Visibility, - ) -> Self { - Self { - abbreviation: None, - default_team_image_url: None, - description: None, - id, - last_update_time, - name, - revision: None, - state, - url: None, - visibility, - } - } + pub fn new( + id: String, + last_update_time: time::OffsetDateTime, + name: String, + state: team_project_reference::State, + visibility: team_project_reference::Visibility, + ) -> Self { + Self { + abbreviation: None, + default_team_image_url: None, + description: None, + id, + last_update_time, + name, + revision: None, + state, + url: None, + visibility, + } + } } pub mod team_project_reference { - use super::*; - #[doc = "Project state."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "deleting")] - Deleting, - #[serde(rename = "new")] - New, - #[serde(rename = "wellFormed")] - WellFormed, - #[serde(rename = "createPending")] - CreatePending, - #[serde(rename = "all")] - All, - #[serde(rename = "unchanged")] - Unchanged, - #[serde(rename = "deleted")] - Deleted, - } - #[doc = "Project visibility."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Visibility { - #[serde(rename = "private")] - Private, - #[serde(rename = "public")] - Public, - #[serde(rename = "organization")] - Organization, - #[serde(rename = "unchanged")] - Unchanged, - } + use super::*; + #[doc = "Project state."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "deleting")] + Deleting, + #[serde(rename = "new")] + New, + #[serde(rename = "wellFormed")] + WellFormed, + #[serde(rename = "createPending")] + CreatePending, + #[serde(rename = "all")] + All, + #[serde(rename = "unchanged")] + Unchanged, + #[serde(rename = "deleted")] + Deleted, + } + #[doc = "Project visibility."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Visibility { + #[serde(rename = "private")] + Private, + #[serde(rename = "public")] + Public, + #[serde(rename = "organization")] + Organization, + #[serde(rename = "unchanged")] + Unchanged, + } } #[doc = "Class representing a branch object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcBranch { - #[serde(flatten)] - pub tfvc_branch_ref: TfvcBranchRef, - #[doc = "List of children for the branch."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub children: Vec<TfvcBranch>, - #[doc = "List of branch mappings."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mappings: Vec<TfvcBranchMapping>, - #[doc = "This is the shallow branchref class."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option<TfvcShallowBranchRef>, - #[doc = "List of paths of the related branches."] - #[serde( - rename = "relatedBranches", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub related_branches: Vec<TfvcShallowBranchRef>, + #[serde(flatten)] + pub tfvc_branch_ref: TfvcBranchRef, + #[doc = "List of children for the branch."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub children: Vec<TfvcBranch>, + #[doc = "List of branch mappings."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mappings: Vec<TfvcBranchMapping>, + #[doc = "This is the shallow branchref class."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option<TfvcShallowBranchRef>, + #[doc = "List of paths of the related branches."] + #[serde( + rename = "relatedBranches", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub related_branches: Vec<TfvcShallowBranchRef>, } impl TfvcBranch { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A branch mapping."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcBranchMapping { - #[doc = "Depth of the branch."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub depth: Option<String>, - #[doc = "Server item for the branch."] - #[serde( - rename = "serverItem", - default, - skip_serializing_if = "Option::is_none" - )] - pub server_item: Option<String>, - #[doc = "Type of the branch."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Depth of the branch."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub depth: Option<String>, + #[doc = "Server item for the branch."] + #[serde( + rename = "serverItem", + default, + skip_serializing_if = "Option::is_none" + )] + pub server_item: Option<String>, + #[doc = "Type of the branch."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl TfvcBranchMapping { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for a branchref."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcBranchRef { - #[serde(flatten)] - pub tfvc_shallow_branch_ref: TfvcShallowBranchRef, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Creation date of the branch."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Branch description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Is the branch deleted?"] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "URL to retrieve the item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(flatten)] + pub tfvc_shallow_branch_ref: TfvcShallowBranchRef, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Creation date of the branch."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Branch description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Is the branch deleted?"] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "URL to retrieve the item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TfvcBranchRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A change."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TfvcChange { - #[serde(flatten)] - pub change: Change, - #[doc = "List of merge sources in case of rename or branch creation."] - #[serde( - rename = "mergeSources", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub merge_sources: Vec<TfvcMergeSource>, - #[doc = "Version at which a (shelved) change was pended against"] - #[serde( - rename = "pendingVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub pending_version: Option<i32>, + #[serde(flatten)] + pub change: Change, + #[doc = "List of merge sources in case of rename or branch creation."] + #[serde( + rename = "mergeSources", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub merge_sources: Vec<TfvcMergeSource>, + #[doc = "Version at which a (shelved) change was pended against"] + #[serde( + rename = "pendingVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub pending_version: Option<i32>, } impl TfvcChange { - pub fn new(change: Change) -> Self { - Self { - change, - merge_sources: Vec::new(), - pending_version: None, - } + pub fn new(change: Change) -> Self { + Self { + change, + merge_sources: Vec::new(), + pending_version: None, } + } } #[doc = "A collection of changes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcChangeset { - #[serde(flatten)] - pub tfvc_changeset_ref: TfvcChangesetRef, - #[doc = "Changeset Account Id also known as Organization Id."] - #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] - pub account_id: Option<String>, - #[doc = "List of associated changes."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub changes: Vec<TfvcChange>, - #[doc = "List of Checkin Notes for the changeset."] - #[serde( - rename = "checkinNotes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub checkin_notes: Vec<CheckinNote>, - #[doc = "Changeset collection Id."] - #[serde( - rename = "collectionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub collection_id: Option<String>, - #[doc = "True if more changes are available."] - #[serde( - rename = "hasMoreChanges", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_more_changes: Option<bool>, - #[doc = "Information on the policy override."] - #[serde( - rename = "policyOverride", - default, - skip_serializing_if = "Option::is_none" - )] - pub policy_override: Option<TfvcPolicyOverrideInfo>, - #[doc = "Team Project Ids for the changeset."] - #[serde( - rename = "teamProjectIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub team_project_ids: Vec<String>, - #[doc = "List of work items associated with the changeset."] - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<AssociatedWorkItem>, + #[serde(flatten)] + pub tfvc_changeset_ref: TfvcChangesetRef, + #[doc = "Changeset Account Id also known as Organization Id."] + #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] + pub account_id: Option<String>, + #[doc = "List of associated changes."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub changes: Vec<TfvcChange>, + #[doc = "List of Checkin Notes for the changeset."] + #[serde( + rename = "checkinNotes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub checkin_notes: Vec<CheckinNote>, + #[doc = "Changeset collection Id."] + #[serde( + rename = "collectionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub collection_id: Option<String>, + #[doc = "True if more changes are available."] + #[serde( + rename = "hasMoreChanges", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_more_changes: Option<bool>, + #[doc = "Information on the policy override."] + #[serde( + rename = "policyOverride", + default, + skip_serializing_if = "Option::is_none" + )] + pub policy_override: Option<TfvcPolicyOverrideInfo>, + #[doc = "Team Project Ids for the changeset."] + #[serde( + rename = "teamProjectIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub team_project_ids: Vec<String>, + #[doc = "List of work items associated with the changeset."] + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<AssociatedWorkItem>, } impl TfvcChangeset { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for a changeset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcChangesetRef { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<IdentityRef>, - #[doc = "Changeset Id."] - #[serde( - rename = "changesetId", - default, - skip_serializing_if = "Option::is_none" - )] - pub changeset_id: Option<i32>, - #[doc = ""] - #[serde( - rename = "checkedInBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub checked_in_by: Option<IdentityRef>, - #[doc = "Comment for the changeset."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Was the Comment result truncated?"] - #[serde( - rename = "commentTruncated", - default, - skip_serializing_if = "Option::is_none" - )] - pub comment_truncated: Option<bool>, - #[doc = "Creation date of the changeset."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "URL to retrieve the item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<IdentityRef>, + #[doc = "Changeset Id."] + #[serde( + rename = "changesetId", + default, + skip_serializing_if = "Option::is_none" + )] + pub changeset_id: Option<i32>, + #[doc = ""] + #[serde( + rename = "checkedInBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub checked_in_by: Option<IdentityRef>, + #[doc = "Comment for the changeset."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Was the Comment result truncated?"] + #[serde( + rename = "commentTruncated", + default, + skip_serializing_if = "Option::is_none" + )] + pub comment_truncated: Option<bool>, + #[doc = "Creation date of the changeset."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "URL to retrieve the item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TfvcChangesetRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Criteria used in a search for change lists."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcChangesetSearchCriteria { - #[doc = "Alias or display name of user who made the changes."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<String>, - #[doc = "Whether or not to follow renames for the given item being queried."] - #[serde( - rename = "followRenames", - default, - skip_serializing_if = "Option::is_none" - )] - pub follow_renames: Option<bool>, - #[doc = "If provided, only include changesets created after this date (string)."] - #[serde(rename = "fromDate", default, skip_serializing_if = "Option::is_none")] - pub from_date: Option<String>, - #[doc = "If provided, only include changesets after this changesetID."] - #[serde(rename = "fromId", default, skip_serializing_if = "Option::is_none")] - pub from_id: Option<i32>, - #[doc = "Whether to include the _links field on the shallow references."] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[doc = "Path of item to search under."] - #[serde(rename = "itemPath", default, skip_serializing_if = "Option::is_none")] - pub item_path: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mappings: Vec<TfvcMappingFilter>, - #[doc = "If provided, only include changesets created before this date (string)."] - #[serde(rename = "toDate", default, skip_serializing_if = "Option::is_none")] - pub to_date: Option<String>, - #[doc = "If provided, a version descriptor for the latest change list to include."] - #[serde(rename = "toId", default, skip_serializing_if = "Option::is_none")] - pub to_id: Option<i32>, + #[doc = "Alias or display name of user who made the changes."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<String>, + #[doc = "Whether or not to follow renames for the given item being queried."] + #[serde( + rename = "followRenames", + default, + skip_serializing_if = "Option::is_none" + )] + pub follow_renames: Option<bool>, + #[doc = "If provided, only include changesets created after this date (string)."] + #[serde(rename = "fromDate", default, skip_serializing_if = "Option::is_none")] + pub from_date: Option<String>, + #[doc = "If provided, only include changesets after this changesetID."] + #[serde(rename = "fromId", default, skip_serializing_if = "Option::is_none")] + pub from_id: Option<i32>, + #[doc = "Whether to include the _links field on the shallow references."] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[doc = "Path of item to search under."] + #[serde(rename = "itemPath", default, skip_serializing_if = "Option::is_none")] + pub item_path: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mappings: Vec<TfvcMappingFilter>, + #[doc = "If provided, only include changesets created before this date (string)."] + #[serde(rename = "toDate", default, skip_serializing_if = "Option::is_none")] + pub to_date: Option<String>, + #[doc = "If provided, a version descriptor for the latest change list to include."] + #[serde(rename = "toId", default, skip_serializing_if = "Option::is_none")] + pub to_id: Option<i32>, } impl TfvcChangesetSearchCriteria { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Request body for Get batched changesets."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcChangesetsRequestData { - #[doc = "List of changeset Ids."] - #[serde( - rename = "changesetIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub changeset_ids: Vec<i32>, - #[doc = "Max length of the comment."] - #[serde( - rename = "commentLength", - default, - skip_serializing_if = "Option::is_none" - )] - pub comment_length: Option<i32>, - #[doc = "Whether to include the _links field on the shallow references"] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, + #[doc = "List of changeset Ids."] + #[serde( + rename = "changesetIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub changeset_ids: Vec<i32>, + #[doc = "Max length of the comment."] + #[serde( + rename = "commentLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub comment_length: Option<i32>, + #[doc = "Whether to include the _links field on the shallow references"] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, } impl TfvcChangesetsRequestData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcCheckinEventData { - #[doc = "A collection of changes."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub changeset: Option<TfvcChangeset>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, + #[doc = "A collection of changes."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub changeset: Option<TfvcChangeset>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, } impl TfvcCheckinEventData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcHistoryEntry { - #[serde(flatten)] - pub history_entry: HistoryEntry, - #[doc = "The encoding of the item at this point in history (only relevant for File history, not folders)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encoding: Option<i32>, - #[doc = "The file id of the item at this point in history (only relevant for File history, not folders)"] - #[serde(rename = "fileId", default, skip_serializing_if = "Option::is_none")] - pub file_id: Option<i32>, + #[serde(flatten)] + pub history_entry: HistoryEntry, + #[doc = "The encoding of the item at this point in history (only relevant for File history, not folders)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encoding: Option<i32>, + #[doc = "The file id of the item at this point in history (only relevant for File history, not folders)"] + #[serde(rename = "fileId", default, skip_serializing_if = "Option::is_none")] + pub file_id: Option<i32>, } impl TfvcHistoryEntry { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for an item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcItem { - #[serde(flatten)] - pub item_model: ItemModel, - #[doc = "Item changed datetime."] - #[serde( - rename = "changeDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub change_date: Option<time::OffsetDateTime>, - #[doc = "Greater than 0 if item is deleted."] - #[serde( - rename = "deletionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub deletion_id: Option<i32>, - #[doc = "File encoding from database, -1 represents binary."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encoding: Option<i32>, - #[doc = "MD5 hash as a base 64 string, applies to files only."] - #[serde(rename = "hashValue", default, skip_serializing_if = "Option::is_none")] - pub hash_value: Option<String>, - #[doc = "True if item is a branch."] - #[serde(rename = "isBranch", default, skip_serializing_if = "Option::is_none")] - pub is_branch: Option<bool>, - #[doc = "True if there is a change pending."] - #[serde( - rename = "isPendingChange", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_pending_change: Option<bool>, - #[doc = "The size of the file, if applicable."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[doc = "Changeset version Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i32>, + #[serde(flatten)] + pub item_model: ItemModel, + #[doc = "Item changed datetime."] + #[serde( + rename = "changeDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub change_date: Option<time::OffsetDateTime>, + #[doc = "Greater than 0 if item is deleted."] + #[serde( + rename = "deletionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub deletion_id: Option<i32>, + #[doc = "File encoding from database, -1 represents binary."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encoding: Option<i32>, + #[doc = "MD5 hash as a base 64 string, applies to files only."] + #[serde(rename = "hashValue", default, skip_serializing_if = "Option::is_none")] + pub hash_value: Option<String>, + #[doc = "True if item is a branch."] + #[serde(rename = "isBranch", default, skip_serializing_if = "Option::is_none")] + pub is_branch: Option<bool>, + #[doc = "True if there is a change pending."] + #[serde( + rename = "isPendingChange", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_pending_change: Option<bool>, + #[doc = "The size of the file, if applicable."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[doc = "Changeset version Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i32>, } impl TfvcItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Item path and Version descriptor properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcItemDescriptor { - #[doc = "Item path."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Defaults to OneLevel."] - #[serde( - rename = "recursionLevel", - default, - skip_serializing_if = "Option::is_none" - )] - pub recursion_level: Option<tfvc_item_descriptor::RecursionLevel>, - #[doc = "Specify the desired version, can be null or empty string only if VersionType is latest or tip."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, - #[doc = "Defaults to None."] - #[serde( - rename = "versionOption", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_option: Option<tfvc_item_descriptor::VersionOption>, - #[doc = "Defaults to Latest."] - #[serde( - rename = "versionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_type: Option<tfvc_item_descriptor::VersionType>, + #[doc = "Item path."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Defaults to OneLevel."] + #[serde( + rename = "recursionLevel", + default, + skip_serializing_if = "Option::is_none" + )] + pub recursion_level: Option<tfvc_item_descriptor::RecursionLevel>, + #[doc = "Specify the desired version, can be null or empty string only if VersionType is latest or tip."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, + #[doc = "Defaults to None."] + #[serde( + rename = "versionOption", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_option: Option<tfvc_item_descriptor::VersionOption>, + #[doc = "Defaults to Latest."] + #[serde( + rename = "versionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_type: Option<tfvc_item_descriptor::VersionType>, } impl TfvcItemDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod tfvc_item_descriptor { - use super::*; - #[doc = "Defaults to OneLevel."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum RecursionLevel { - #[serde(rename = "none")] - None, - #[serde(rename = "oneLevel")] - OneLevel, - #[serde(rename = "oneLevelPlusNestedEmptyFolders")] - OneLevelPlusNestedEmptyFolders, - #[serde(rename = "full")] - Full, - } - #[doc = "Defaults to None."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionOption { - #[serde(rename = "none")] - None, - #[serde(rename = "previous")] - Previous, - #[serde(rename = "useRename")] - UseRename, - } - #[doc = "Defaults to Latest."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionType { - #[serde(rename = "none")] - None, - #[serde(rename = "changeset")] - Changeset, - #[serde(rename = "shelveset")] - Shelveset, - #[serde(rename = "change")] - Change, - #[serde(rename = "date")] - Date, - #[serde(rename = "latest")] - Latest, - #[serde(rename = "tip")] - Tip, - #[serde(rename = "mergeSource")] - MergeSource, - } + use super::*; + #[doc = "Defaults to OneLevel."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum RecursionLevel { + #[serde(rename = "none")] + None, + #[serde(rename = "oneLevel")] + OneLevel, + #[serde(rename = "oneLevelPlusNestedEmptyFolders")] + OneLevelPlusNestedEmptyFolders, + #[serde(rename = "full")] + Full, + } + #[doc = "Defaults to None."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionOption { + #[serde(rename = "none")] + None, + #[serde(rename = "previous")] + Previous, + #[serde(rename = "useRename")] + UseRename, + } + #[doc = "Defaults to Latest."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionType { + #[serde(rename = "none")] + None, + #[serde(rename = "changeset")] + Changeset, + #[serde(rename = "shelveset")] + Shelveset, + #[serde(rename = "change")] + Change, + #[serde(rename = "date")] + Date, + #[serde(rename = "latest")] + Latest, + #[serde(rename = "tip")] + Tip, + #[serde(rename = "mergeSource")] + MergeSource, + } } #[doc = "Metadata for an item including the previous hash value for files."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcItemPreviousHash { - #[serde(flatten)] - pub tfvc_item: TfvcItem, - #[doc = "MD5 hash as a base 64 string, applies to files only."] - #[serde( - rename = "previousHashValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub previous_hash_value: Option<String>, + #[serde(flatten)] + pub tfvc_item: TfvcItem, + #[doc = "MD5 hash as a base 64 string, applies to files only."] + #[serde( + rename = "previousHashValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub previous_hash_value: Option<String>, } impl TfvcItemPreviousHash { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Request body used by Get Items Batch"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcItemRequestData { - #[doc = "If true, include metadata about the file type"] - #[serde( - rename = "includeContentMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_content_metadata: Option<bool>, - #[doc = "Whether to include the _links field on the shallow references"] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[serde( - rename = "itemDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub item_descriptors: Vec<TfvcItemDescriptor>, + #[doc = "If true, include metadata about the file type"] + #[serde( + rename = "includeContentMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_content_metadata: Option<bool>, + #[doc = "Whether to include the _links field on the shallow references"] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[serde( + rename = "itemDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub item_descriptors: Vec<TfvcItemDescriptor>, } impl TfvcItemRequestData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for a label."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcLabel { - #[serde(flatten)] - pub tfvc_label_ref: TfvcLabelRef, - #[doc = "List of items."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub items: Vec<TfvcItem>, + #[serde(flatten)] + pub tfvc_label_ref: TfvcLabelRef, + #[doc = "List of items."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub items: Vec<TfvcItem>, } impl TfvcLabel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for a Label."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcLabelRef { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Label description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Label Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Label scope."] - #[serde( - rename = "labelScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub label_scope: Option<String>, - #[doc = "Last modified datetime for the label."] - #[serde( - rename = "modifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_date: Option<time::OffsetDateTime>, - #[doc = "Label name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Label Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Label description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Label Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Label scope."] + #[serde( + rename = "labelScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub label_scope: Option<String>, + #[doc = "Last modified datetime for the label."] + #[serde( + rename = "modifiedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_date: Option<time::OffsetDateTime>, + #[doc = "Label name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Label Url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TfvcLabelRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcLabelRequestData { - #[doc = "Whether to include the _links field on the shallow references"] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[serde( - rename = "itemLabelFilter", - default, - skip_serializing_if = "Option::is_none" - )] - pub item_label_filter: Option<String>, - #[serde( - rename = "labelScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub label_scope: Option<String>, - #[serde( - rename = "maxItemCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_item_count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, + #[doc = "Whether to include the _links field on the shallow references"] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[serde( + rename = "itemLabelFilter", + default, + skip_serializing_if = "Option::is_none" + )] + pub item_label_filter: Option<String>, + #[serde( + rename = "labelScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub label_scope: Option<String>, + #[serde( + rename = "maxItemCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_item_count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, } impl TfvcLabelRequestData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "MappingFilter can be used to include or exclude specific paths."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcMappingFilter { - #[doc = "True if ServerPath should be excluded."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub exclude: Option<bool>, - #[doc = "Path to be included or excluded."] - #[serde( - rename = "serverPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub server_path: Option<String>, + #[doc = "True if ServerPath should be excluded."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub exclude: Option<bool>, + #[doc = "Path to be included or excluded."] + #[serde( + rename = "serverPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub server_path: Option<String>, } impl TfvcMappingFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcMergeSource { - #[doc = "Indicates if this a rename source. If false, it is a merge source."] - #[serde(rename = "isRename", default, skip_serializing_if = "Option::is_none")] - pub is_rename: Option<bool>, - #[doc = "The server item of the merge source."] - #[serde( - rename = "serverItem", - default, - skip_serializing_if = "Option::is_none" - )] - pub server_item: Option<String>, - #[doc = "Start of the version range."] - #[serde( - rename = "versionFrom", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_from: Option<i32>, - #[doc = "End of the version range."] - #[serde(rename = "versionTo", default, skip_serializing_if = "Option::is_none")] - pub version_to: Option<i32>, + #[doc = "Indicates if this a rename source. If false, it is a merge source."] + #[serde(rename = "isRename", default, skip_serializing_if = "Option::is_none")] + pub is_rename: Option<bool>, + #[doc = "The server item of the merge source."] + #[serde( + rename = "serverItem", + default, + skip_serializing_if = "Option::is_none" + )] + pub server_item: Option<String>, + #[doc = "Start of the version range."] + #[serde( + rename = "versionFrom", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_from: Option<i32>, + #[doc = "End of the version range."] + #[serde(rename = "versionTo", default, skip_serializing_if = "Option::is_none")] + pub version_to: Option<i32>, } impl TfvcMergeSource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Policy failure information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcPolicyFailureInfo { - #[doc = "Policy failure message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "Name of the policy that failed."] - #[serde( - rename = "policyName", - default, - skip_serializing_if = "Option::is_none" - )] - pub policy_name: Option<String>, + #[doc = "Policy failure message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "Name of the policy that failed."] + #[serde( + rename = "policyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub policy_name: Option<String>, } impl TfvcPolicyFailureInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Information on the policy override."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcPolicyOverrideInfo { - #[doc = "Overidden policy comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Information on the failed policy that was overridden."] - #[serde( - rename = "policyFailures", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub policy_failures: Vec<TfvcPolicyFailureInfo>, + #[doc = "Overidden policy comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Information on the failed policy that was overridden."] + #[serde( + rename = "policyFailures", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub policy_failures: Vec<TfvcPolicyFailureInfo>, } impl TfvcPolicyOverrideInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This is the shallow branchref class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcShallowBranchRef { - #[doc = "Path for the branch."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[doc = "Path for the branch."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl TfvcShallowBranchRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for a shelveset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcShelveset { - #[serde(flatten)] - pub tfvc_shelveset_ref: TfvcShelvesetRef, - #[doc = "List of changes."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub changes: Vec<TfvcChange>, - #[doc = "List of checkin notes."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub notes: Vec<CheckinNote>, - #[doc = "Information on the policy override."] - #[serde( - rename = "policyOverride", - default, - skip_serializing_if = "Option::is_none" - )] - pub policy_override: Option<TfvcPolicyOverrideInfo>, - #[doc = "List of associated workitems."] - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<AssociatedWorkItem>, + #[serde(flatten)] + pub tfvc_shelveset_ref: TfvcShelvesetRef, + #[doc = "List of changes."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub changes: Vec<TfvcChange>, + #[doc = "List of checkin notes."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub notes: Vec<CheckinNote>, + #[doc = "Information on the policy override."] + #[serde( + rename = "policyOverride", + default, + skip_serializing_if = "Option::is_none" + )] + pub policy_override: Option<TfvcPolicyOverrideInfo>, + #[doc = "List of associated workitems."] + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<AssociatedWorkItem>, } impl TfvcShelveset { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for a shallow shelveset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcShelvesetRef { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Shelveset comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Shelveset comment truncated as applicable."] - #[serde( - rename = "commentTruncated", - default, - skip_serializing_if = "Option::is_none" - )] - pub comment_truncated: Option<bool>, - #[doc = "Shelveset create date."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Shelveset Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Shelveset name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Shelveset Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Shelveset comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Shelveset comment truncated as applicable."] + #[serde( + rename = "commentTruncated", + default, + skip_serializing_if = "Option::is_none" + )] + pub comment_truncated: Option<bool>, + #[doc = "Shelveset create date."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Shelveset Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Shelveset name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Shelveset Url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TfvcShelvesetRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcShelvesetRequestData { - #[doc = "Whether to include policyOverride and notes Only applies when requesting a single deep shelveset"] - #[serde( - rename = "includeDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_details: Option<bool>, - #[doc = "Whether to include the _links field on the shallow references. Does not apply when requesting a single deep shelveset object. Links will always be included in the deep shelveset."] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[doc = "Whether to include workItems"] - #[serde( - rename = "includeWorkItems", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_work_items: Option<bool>, - #[doc = "Max number of changes to include"] - #[serde( - rename = "maxChangeCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_change_count: Option<i32>, - #[doc = "Max length of comment"] - #[serde( - rename = "maxCommentLength", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_comment_length: Option<i32>, - #[doc = "Shelveset name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Owner's ID. Could be a name or a guid."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, + #[doc = "Whether to include policyOverride and notes Only applies when requesting a single deep shelveset"] + #[serde( + rename = "includeDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_details: Option<bool>, + #[doc = "Whether to include the _links field on the shallow references. Does not apply when requesting a single deep shelveset object. Links will always be included in the deep shelveset."] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[doc = "Whether to include workItems"] + #[serde( + rename = "includeWorkItems", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_work_items: Option<bool>, + #[doc = "Max number of changes to include"] + #[serde( + rename = "maxChangeCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_change_count: Option<i32>, + #[doc = "Max length of comment"] + #[serde( + rename = "maxCommentLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_comment_length: Option<i32>, + #[doc = "Shelveset name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Owner's ID. Could be a name or a guid."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, } impl TfvcShelvesetRequestData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcStatistics { - #[doc = "Id of the last changeset the stats are based on."] - #[serde( - rename = "changesetId", - default, - skip_serializing_if = "Option::is_none" - )] - pub changeset_id: Option<i32>, - #[doc = "Count of files at the requested scope."] - #[serde( - rename = "fileCountTotal", - default, - skip_serializing_if = "Option::is_none" - )] - pub file_count_total: Option<i64>, + #[doc = "Id of the last changeset the stats are based on."] + #[serde( + rename = "changesetId", + default, + skip_serializing_if = "Option::is_none" + )] + pub changeset_id: Option<i32>, + #[doc = "Count of files at the requested scope."] + #[serde( + rename = "fileCountTotal", + default, + skip_serializing_if = "Option::is_none" + )] + pub file_count_total: Option<i64>, } impl TfvcStatistics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Version descriptor properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcVersionDescriptor { - #[doc = "Version object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, - #[serde( - rename = "versionOption", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_option: Option<tfvc_version_descriptor::VersionOption>, - #[serde( - rename = "versionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_type: Option<tfvc_version_descriptor::VersionType>, + #[doc = "Version object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, + #[serde( + rename = "versionOption", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_option: Option<tfvc_version_descriptor::VersionOption>, + #[serde( + rename = "versionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_type: Option<tfvc_version_descriptor::VersionType>, } impl TfvcVersionDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod tfvc_version_descriptor { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionOption { - #[serde(rename = "none")] - None, - #[serde(rename = "previous")] - Previous, - #[serde(rename = "useRename")] - UseRename, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionType { - #[serde(rename = "none")] - None, - #[serde(rename = "changeset")] - Changeset, - #[serde(rename = "shelveset")] - Shelveset, - #[serde(rename = "change")] - Change, - #[serde(rename = "date")] - Date, - #[serde(rename = "latest")] - Latest, - #[serde(rename = "tip")] - Tip, - #[serde(rename = "mergeSource")] - MergeSource, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionOption { + #[serde(rename = "none")] + None, + #[serde(rename = "previous")] + Previous, + #[serde(rename = "useRename")] + UseRename, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionType { + #[serde(rename = "none")] + None, + #[serde(rename = "changeset")] + Changeset, + #[serde(rename = "shelveset")] + Shelveset, + #[serde(rename = "change")] + Change, + #[serde(rename = "date")] + Date, + #[serde(rename = "latest")] + Latest, + #[serde(rename = "tip")] + Tip, + #[serde(rename = "mergeSource")] + MergeSource, + } } #[doc = "Real time event (SignalR) for a title/description update on a pull request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TitleDescriptionUpdatedEvent { - #[serde(flatten)] - pub real_time_pull_request_event: RealTimePullRequestEvent, + #[serde(flatten)] + pub real_time_pull_request_event: RealTimePullRequestEvent, } impl TitleDescriptionUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateRefsRequest { - #[serde( - rename = "refUpdateRequests", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ref_update_requests: Vec<GitRefUpdate>, - #[serde( - rename = "updateMode", - default, - skip_serializing_if = "Option::is_none" - )] - pub update_mode: Option<update_refs_request::UpdateMode>, + #[serde( + rename = "refUpdateRequests", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ref_update_requests: Vec<GitRefUpdate>, + #[serde( + rename = "updateMode", + default, + skip_serializing_if = "Option::is_none" + )] + pub update_mode: Option<update_refs_request::UpdateMode>, } impl UpdateRefsRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod update_refs_request { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum UpdateMode { - #[serde(rename = "bestEffort")] - BestEffort, - #[serde(rename = "allOrNone")] - AllOrNone, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum UpdateMode { + #[serde(rename = "bestEffort")] + BestEffort, + #[serde(rename = "allOrNone")] + AllOrNone, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VersionControlProjectInfo { - #[serde( - rename = "defaultSourceControlType", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_source_control_type: Option<version_control_project_info::DefaultSourceControlType>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[serde( - rename = "supportsGit", - default, - skip_serializing_if = "Option::is_none" - )] - pub supports_git: Option<bool>, - #[serde( - rename = "supportsTFVC", - default, - skip_serializing_if = "Option::is_none" - )] - pub supports_tfvc: Option<bool>, + #[serde( + rename = "defaultSourceControlType", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_source_control_type: Option<version_control_project_info::DefaultSourceControlType>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[serde( + rename = "supportsGit", + default, + skip_serializing_if = "Option::is_none" + )] + pub supports_git: Option<bool>, + #[serde( + rename = "supportsTFVC", + default, + skip_serializing_if = "Option::is_none" + )] + pub supports_tfvc: Option<bool>, } impl VersionControlProjectInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod version_control_project_info { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DefaultSourceControlType { - #[serde(rename = "tfvc")] - Tfvc, - #[serde(rename = "git")] - Git, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DefaultSourceControlType { + #[serde(rename = "tfvc")] + Tfvc, + #[serde(rename = "git")] + Git, + } } #[doc = "A particular revision for a policy configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VersionedPolicyConfigurationRef { - #[serde(flatten)] - pub policy_configuration_ref: PolicyConfigurationRef, - #[doc = "The policy configuration revision ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[serde(flatten)] + pub policy_configuration_ref: PolicyConfigurationRef, + #[doc = "The policy configuration revision ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl VersionedPolicyConfigurationRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The representation of data needed to create a tag definition which is sent across the wire."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WebApiCreateTagRequestData { - #[doc = "Name of the tag definition that will be created."] - pub name: String, + #[doc = "Name of the tag definition that will be created."] + pub name: String, } impl WebApiCreateTagRequestData { - pub fn new(name: String) -> Self { - Self { name } - } + pub fn new(name: String) -> Self { + Self { name } + } } #[doc = "The representation of a tag definition which is sent across the wire."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiTagDefinition { - #[doc = "Whether or not the tag definition is active."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub active: Option<bool>, - #[doc = "ID of the tag definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The name of the tag definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Resource URL for the Tag Definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Whether or not the tag definition is active."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub active: Option<bool>, + #[doc = "ID of the tag definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The name of the tag definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Resource URL for the Tag Definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WebApiTagDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WebApiTagDefinitionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WebApiTagDefinition>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WebApiTagDefinition>, } impl WebApiTagDefinitionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/graph/mod.rs b/azure_devops_rust_api/src/graph/mod.rs index 1fa4559c..e494f2e3 100644 --- a/azure_devops_rust_api/src/graph/mod.rs +++ b/azure_devops_rust_api/src/graph/mod.rs @@ -9,3684 +9,3338 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://vssps.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self - } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self - } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self - } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self - } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) - } + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } } impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) - } + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + 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 identity_translation_client(&self) -> identity_translation::Client { + identity_translation::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 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()) + } } pub mod descriptors { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Resolve a storage key to a descriptor"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `storage_key`: Storage key of the subject (user, group, scope, etc.) to resolve"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get( + &self, + storage_key: impl Into<String>, + organization: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + storage_key: storage_key.into(), + organization: organization.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Resolve a storage key to a descriptor"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `storage_key`: Storage key of the subject (user, group, scope, etc.) to resolve"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get( - &self, - storage_key: impl Into<String>, - organization: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - storage_key: storage_key.into(), - organization: organization.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphDescriptorResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphDescriptorResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) storage_key: String, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/descriptors/{}", - this.client.endpoint(), - &this.organization, - &this.storage_key - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphDescriptorResult>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GraphDescriptorResult>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphDescriptorResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphDescriptorResult = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) storage_key: String, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/descriptors/{}", + this.client.endpoint(), + &this.organization, + &this.storage_key + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphDescriptorResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GraphDescriptorResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod groups { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The subset of the full graph group used to uniquely find the graph subject in an external provider."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GraphGroupCreationContext>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `group_descriptor`: The descriptor of the desired graph group."] + pub fn get( + &self, + organization: impl Into<String>, + group_descriptor: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `group_descriptor`: The descriptor of the group to modify."] + #[doc = "* `body`: The JSON+Patch document containing the fields to alter."] + pub fn update( + &self, + organization: impl Into<String>, + group_descriptor: impl Into<String>, + body: impl Into<models::JsonPatchDocument>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `group_descriptor`: The descriptor of the group to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + group_descriptor: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + group_descriptor: group_descriptor.into(), + } + } + } + pub mod list { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The subset of the full graph group used to uniquely find the graph subject in an external provider."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GraphGroupCreationContext>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `group_descriptor`: The descriptor of the desired graph group."] - pub fn get( - &self, - organization: impl Into<String>, - group_descriptor: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `group_descriptor`: The descriptor of the group to modify."] - #[doc = "* `body`: The JSON+Patch document containing the fields to alter."] - pub fn update( - &self, - organization: impl Into<String>, - group_descriptor: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `group_descriptor`: The descriptor of the group to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - group_descriptor: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - group_descriptor: group_descriptor.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphGroupList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphGroupList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn x_ms_continuation_token(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static( - "x-ms-continuationtoken", - )) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) scope_descriptor: Option<String>, - pub(crate) subject_types: Option<String>, - pub(crate) continuation_token: Option<String>, - } - impl RequestBuilder { - #[doc = "Specify a non-default scope (collection, project) to search for groups."] - pub fn scope_descriptor(mut self, scope_descriptor: impl Into<String>) -> Self { - self.scope_descriptor = Some(scope_descriptor.into()); - self - } - #[doc = "A comma separated list of user subject subtypes to reduce the retrieved results, e.g. Microsoft.IdentityModel.Claims.ClaimsIdentity"] - pub fn subject_types(mut self, subject_types: impl Into<String>) -> Self { - self.subject_types = Some(subject_types.into()); - self - } - #[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<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/groups", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphGroupList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GraphGroupList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphGroup> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GraphGroupCreationContext, - pub(crate) scope_descriptor: Option<String>, - pub(crate) group_descriptors: Option<String>, - } - 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<String>) -> Self { - self.scope_descriptor = Some(scope_descriptor.into()); - self - } - #[doc = "A comma separated list of descriptors referencing groups you want the graph group to join"] - pub fn group_descriptors(mut self, group_descriptors: impl Into<String>) -> Self { - self.group_descriptors = Some(group_descriptors.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/groups", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphGroup>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GraphGroup>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphGroup> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) group_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/groups/{}", - this.client.endpoint(), - &this.organization, - &this.group_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphGroup>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GraphGroup>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphGroup> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphGroup = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) group_descriptor: String, - pub(crate) body: models::JsonPatchDocument, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/groups/{}", - this.client.endpoint(), - &this.organization, - &this.group_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphGroup>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GraphGroup>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) group_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/groups/{}", - this.client.endpoint(), - &this.organization, - &this.group_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphGroupList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphGroupList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn x_ms_continuation_token(&self) -> azure_core::Result<&str> { + self + .0 + .get_str(&azure_core::headers::HeaderName::from_static( + "x-ms-continuationtoken", + )) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) scope_descriptor: Option<String>, + pub(crate) subject_types: Option<String>, + pub(crate) continuation_token: Option<String>, + } + impl RequestBuilder { + #[doc = "Specify a non-default scope (collection, project) to search for groups."] + pub fn scope_descriptor(mut self, scope_descriptor: impl Into<String>) -> Self { + self.scope_descriptor = Some(scope_descriptor.into()); + self + } + #[doc = "A comma separated list of user subject subtypes to reduce the retrieved results, e.g. Microsoft.IdentityModel.Claims.ClaimsIdentity"] + pub fn subject_types(mut self, subject_types: impl Into<String>) -> Self { + self.subject_types = Some(subject_types.into()); + self + } + #[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<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/groups", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphGroupList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GraphGroupList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphGroup> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphGroup = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GraphGroupCreationContext, + pub(crate) scope_descriptor: Option<String>, + pub(crate) group_descriptors: Option<String>, + } + 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<String>) -> Self { + self.scope_descriptor = Some(scope_descriptor.into()); + self + } + #[doc = "A comma separated list of descriptors referencing groups you want the graph group to join"] + pub fn group_descriptors(mut self, group_descriptors: impl Into<String>) -> Self { + self.group_descriptors = Some(group_descriptors.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/groups", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphGroup>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GraphGroup>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphGroup> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphGroup = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) group_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/groups/{}", + this.client.endpoint(), + &this.organization, + &this.group_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphGroup>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GraphGroup>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphGroup> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphGroup = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) group_descriptor: String, + pub(crate) body: models::JsonPatchDocument, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/groups/{}", + this.client.endpoint(), + &this.organization, + &this.group_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphGroup>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GraphGroup>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) group_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/groups/{}", + this.client.endpoint(), + &this.organization, + &this.group_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod identity_translation { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn translate(&self, organization: impl Into<String>) -> translate::RequestBuilder { + translate::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + master_id: None, + local_id: None, + } + } + } + pub mod translate { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) master_id: Option<String>, + pub(crate) local_id: Option<String>, + } + impl RequestBuilder { + pub fn master_id(mut self, master_id: impl Into<String>) -> Self { + self.master_id = Some(master_id.into()); + self + } + pub fn local_id(mut self, local_id: impl Into<String>) -> Self { + self.local_id = Some(local_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/identitytranslation", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(master_id) = &this.master_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("masterId", master_id); + } + if let Some(local_id) = &this.local_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("localId", local_id); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod memberships { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `subject_descriptor`: Fetch all direct memberships of this descriptor."] + pub fn list( + &self, + organization: impl Into<String>, + subject_descriptor: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `subject_descriptor`: A descriptor to the child subject in the relationship."] + #[doc = "* `container_descriptor`: A descriptor to the container in the relationship."] + pub fn get( + &self, + organization: impl Into<String>, + subject_descriptor: impl Into<String>, + container_descriptor: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `subject_descriptor`: A descriptor to a group or user that can be the child subject in the relationship."] + #[doc = "* `container_descriptor`: A descriptor to a group that can be the container in the relationship."] + pub fn add( + &self, + organization: impl Into<String>, + subject_descriptor: impl Into<String>, + container_descriptor: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `subject_descriptor`: A descriptor to a group or user that is the child subject in the relationship."] + #[doc = "* `container_descriptor`: A descriptor to a group that is the container in the relationship."] + pub fn remove_membership( + &self, + organization: impl Into<String>, + subject_descriptor: impl Into<String>, + container_descriptor: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `subject_descriptor`: The group or user that is a child subject of the relationship."] + #[doc = "* `container_descriptor`: The group that is the container in the relationship."] + pub fn check_membership_existence( + &self, + organization: impl Into<String>, + subject_descriptor: impl Into<String>, + container_descriptor: impl Into<String>, + ) -> 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 list { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `subject_descriptor`: Fetch all direct memberships of this descriptor."] - pub fn list( - &self, - organization: impl Into<String>, - subject_descriptor: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `subject_descriptor`: A descriptor to the child subject in the relationship."] - #[doc = "* `container_descriptor`: A descriptor to the container in the relationship."] - pub fn get( - &self, - organization: impl Into<String>, - subject_descriptor: impl Into<String>, - container_descriptor: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `subject_descriptor`: A descriptor to a group or user that can be the child subject in the relationship."] - #[doc = "* `container_descriptor`: A descriptor to a group that can be the container in the relationship."] - pub fn add( - &self, - organization: impl Into<String>, - subject_descriptor: impl Into<String>, - container_descriptor: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `subject_descriptor`: A descriptor to a group or user that is the child subject in the relationship."] - #[doc = "* `container_descriptor`: A descriptor to a group that is the container in the relationship."] - pub fn remove_membership( - &self, - organization: impl Into<String>, - subject_descriptor: impl Into<String>, - container_descriptor: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `subject_descriptor`: The group or user that is a child subject of the relationship."] - #[doc = "* `container_descriptor`: The group that is the container in the relationship."] - pub fn check_membership_existence( - &self, - organization: impl Into<String>, - subject_descriptor: impl Into<String>, - container_descriptor: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphMembershipList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphMembershipList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subject_descriptor: String, - pub(crate) direction: Option<String>, - pub(crate) depth: Option<i32>, - } - impl RequestBuilder { - #[doc = "Defaults to Up."] - pub fn direction(mut self, direction: impl Into<String>) -> Self { - self.direction = Some(direction.into()); - self - } - #[doc = "The maximum number of edges to traverse up or down the membership tree. Currently the only supported value is '1'."] - pub fn depth(mut self, depth: i32) -> Self { - self.depth = Some(depth); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/Memberships/{}", - this.client.endpoint(), - &this.organization, - &this.subject_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(direction) = &this.direction { - req.url_mut() - .query_pairs_mut() - .append_pair("direction", direction); - } - if let Some(depth) = &this.depth { - req.url_mut() - .query_pairs_mut() - .append_pair("depth", &depth.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphMembershipList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GraphMembershipList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphMembership> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphMembership = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subject_descriptor: String, - pub(crate) container_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/memberships/{}/{}", - this.client.endpoint(), - &this.organization, - &this.subject_descriptor, - &this.container_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphMembership>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GraphMembership>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphMembership> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphMembership = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subject_descriptor: String, - pub(crate) container_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/memberships/{}/{}", - this.client.endpoint(), - &this.organization, - &this.subject_descriptor, - &this.container_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphMembership>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GraphMembership>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove_membership { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subject_descriptor: String, - pub(crate) container_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/memberships/{}/{}", - this.client.endpoint(), - &this.organization, - &this.subject_descriptor, - &this.container_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod check_membership_existence { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subject_descriptor: String, - pub(crate) container_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/memberships/{}/{}", - this.client.endpoint(), - &this.organization, - &this.subject_descriptor, - &this.container_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphMembershipList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphMembershipList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subject_descriptor: String, + pub(crate) direction: Option<String>, + pub(crate) depth: Option<i32>, + } + impl RequestBuilder { + #[doc = "Defaults to Up."] + pub fn direction(mut self, direction: impl Into<String>) -> Self { + self.direction = Some(direction.into()); + self + } + #[doc = "The maximum number of edges to traverse up or down the membership tree. Currently the only supported value is '1'."] + pub fn depth(mut self, depth: i32) -> Self { + self.depth = Some(depth); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/Memberships/{}", + this.client.endpoint(), + &this.organization, + &this.subject_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(direction) = &this.direction { + req + .url_mut() + .query_pairs_mut() + .append_pair("direction", direction); + } + if let Some(depth) = &this.depth { + req + .url_mut() + .query_pairs_mut() + .append_pair("depth", &depth.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphMembershipList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GraphMembershipList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphMembership> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphMembership = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subject_descriptor: String, + pub(crate) container_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/memberships/{}/{}", + this.client.endpoint(), + &this.organization, + &this.subject_descriptor, + &this.container_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphMembership>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GraphMembership>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphMembership> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphMembership = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subject_descriptor: String, + pub(crate) container_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/memberships/{}/{}", + this.client.endpoint(), + &this.organization, + &this.subject_descriptor, + &this.container_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphMembership>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GraphMembership>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod remove_membership { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subject_descriptor: String, + pub(crate) container_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/memberships/{}/{}", + this.client.endpoint(), + &this.organization, + &this.subject_descriptor, + &this.container_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod check_membership_existence { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subject_descriptor: String, + pub(crate) container_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/memberships/{}/{}", + this.client.endpoint(), + &this.organization, + &this.subject_descriptor, + &this.container_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod membership_states { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Check whether a subject is active or inactive."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `subject_descriptor`: Descriptor of the subject (user, group, scope, etc.) to check state of"] + pub fn get( + &self, + organization: impl Into<String>, + subject_descriptor: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subject_descriptor: subject_descriptor.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Check whether a subject is active or inactive."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `subject_descriptor`: Descriptor of the subject (user, group, scope, etc.) to check state of"] - pub fn get( - &self, - organization: impl Into<String>, - subject_descriptor: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - subject_descriptor: subject_descriptor.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphMembershipState> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphMembershipState = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subject_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/membershipstates/{}", - this.client.endpoint(), - &this.organization, - &this.subject_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphMembershipState>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GraphMembershipState>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphMembershipState> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphMembershipState = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subject_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/membershipstates/{}", + this.client.endpoint(), + &this.organization, + &this.subject_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphMembershipState>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GraphMembershipState>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod request_access { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn request_access( + &self, + organization: impl Into<String>, + body: impl Into<models::JToken>, + ) -> request_access::RequestBuilder { + request_access::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + pub mod request_access { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn request_access( - &self, - organization: impl Into<String>, - body: impl Into<models::JToken>, - ) -> request_access::RequestBuilder { - request_access::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - } - pub mod request_access { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::JToken, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/requestaccess", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } -} -pub mod service_principals { - use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The subset of the full graph service principal used to uniquely find the graph subject in an external provider."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GraphServicePrincipalCreationContext>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `service_principal_descriptor`: The descriptor of the desired service principal."] - pub fn get( - &self, - organization: impl Into<String>, - service_principal_descriptor: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `service_principal_descriptor`: The descriptor of the service principal to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - service_principal_descriptor: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - service_principal_descriptor: service_principal_descriptor.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphServicePrincipalList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphServicePrincipalList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn x_ms_continuation_token(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static( - "x-ms-continuationtoken", - )) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) continuation_token: Option<String>, - pub(crate) scope_descriptor: Option<String>, - } - 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<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Specify a non-default scope (collection, project) to search for service principals."] - pub fn scope_descriptor(mut self, scope_descriptor: impl Into<String>) -> Self { - self.scope_descriptor = Some(scope_descriptor.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/serviceprincipals", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphServicePrincipalList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GraphServicePrincipalList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphServicePrincipal> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphServicePrincipal = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GraphServicePrincipalCreationContext, - pub(crate) group_descriptors: Option<String>, - } - 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<String>) -> Self { - self.group_descriptors = Some(group_descriptors.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/serviceprincipals", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphServicePrincipal>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GraphServicePrincipal>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphServicePrincipal> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphServicePrincipal = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/serviceprincipals/{}", - this.client.endpoint(), - &this.organization, - &this.service_principal_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphServicePrincipal>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GraphServicePrincipal>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/serviceprincipals/{}", - this.client.endpoint(), - &this.organization, - &this.service_principal_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::JToken, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/requestaccess", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod storage_keys { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Resolve a descriptor to a storage key."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get( + &self, + subject_descriptor: impl Into<String>, + organization: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subject_descriptor: subject_descriptor.into(), + organization: organization.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Resolve a descriptor to a storage key."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get( - &self, - subject_descriptor: impl Into<String>, - organization: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subject_descriptor: subject_descriptor.into(), - organization: organization.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphStorageKeyResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphStorageKeyResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subject_descriptor: String, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/storagekeys/{}", - this.client.endpoint(), - &this.organization, - &this.subject_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphStorageKeyResult>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GraphStorageKeyResult>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphStorageKeyResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphStorageKeyResult = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subject_descriptor: String, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/storagekeys/{}", + this.client.endpoint(), + &this.organization, + &this.subject_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphStorageKeyResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GraphStorageKeyResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod subject_lookup { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Resolve descriptors to users, groups or scopes (Subjects) in a batch."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A list of descriptors that specifies a subset of subjects to retrieve. Each descriptor uniquely identifies the subject across all instance scopes, but only at a single point in time."] + pub fn lookup_subjects( + &self, + organization: impl Into<String>, + body: impl Into<models::GraphSubjectLookup>, + ) -> lookup_subjects::RequestBuilder { + lookup_subjects::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + pub mod lookup_subjects { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Resolve descriptors to users, groups or scopes (Subjects) in a batch."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A list of descriptors that specifies a subset of subjects to retrieve. Each descriptor uniquely identifies the subject across all instance scopes, but only at a single point in time."] - pub fn lookup_subjects( - &self, - organization: impl Into<String>, - body: impl Into<models::GraphSubjectLookup>, - ) -> lookup_subjects::RequestBuilder { - lookup_subjects::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - } - pub mod lookup_subjects { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<serde_json::Value> { - let bytes = self.0.into_body().collect().await?; - let body: serde_json::Value = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GraphSubjectLookup, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/subjectlookup", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<serde_json::Value>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<serde_json::Value>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<serde_json::Value> { + let bytes = self.0.into_body().collect().await?; + let body: serde_json::Value = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GraphSubjectLookup, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/subjectlookup", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<serde_json::Value>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<serde_json::Value>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod subject_query { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The query that we'll be using to search includes the following: Query: the search term. The search will be prefix matching only. SubjectKind: \"User\" or \"Group\" can be specified, both or either ScopeDescriptor: Non-default scope can be specified, i.e. project scope descriptor"] + pub fn query( + &self, + organization: impl Into<String>, + body: impl Into<models::GraphSubjectQuery>, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + pub mod query { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The query that we'll be using to search includes the following: Query: the search term. The search will be prefix matching only. SubjectKind: \"User\" or \"Group\" can be specified, both or either ScopeDescriptor: Non-default scope can be specified, i.e. project scope descriptor"] - pub fn query( - &self, - organization: impl Into<String>, - body: impl Into<models::GraphSubjectQuery>, - ) -> query::RequestBuilder { - query::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - } - pub mod query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphSubjectList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphSubjectList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GraphSubjectQuery, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/subjectquery", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphSubjectList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GraphSubjectList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphSubjectList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphSubjectList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GraphSubjectQuery, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/subjectquery", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphSubjectList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GraphSubjectList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod avatars { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get( + &self, + subject_descriptor: impl Into<String>, + organization: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subject_descriptor: subject_descriptor.into(), + organization: organization.into(), + size: None, + format: None, + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn set_avatar( + &self, + body: impl Into<models::Avatar>, + subject_descriptor: impl Into<String>, + organization: impl Into<String>, + ) -> set_avatar::RequestBuilder { + set_avatar::RequestBuilder { + client: self.0.clone(), + body: body.into(), + subject_descriptor: subject_descriptor.into(), + organization: organization.into(), + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn delete( + &self, + subject_descriptor: impl Into<String>, + organization: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subject_descriptor: subject_descriptor.into(), + organization: organization.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get( - &self, - subject_descriptor: impl Into<String>, - organization: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subject_descriptor: subject_descriptor.into(), - organization: organization.into(), - size: None, - format: None, - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn set_avatar( - &self, - body: impl Into<models::Avatar>, - subject_descriptor: impl Into<String>, - organization: impl Into<String>, - ) -> set_avatar::RequestBuilder { - set_avatar::RequestBuilder { - client: self.0.clone(), - body: body.into(), - subject_descriptor: subject_descriptor.into(), - organization: organization.into(), - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn delete( - &self, - subject_descriptor: impl Into<String>, - organization: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subject_descriptor: subject_descriptor.into(), - organization: organization.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Avatar> { - let bytes = self.0.into_body().collect().await?; - let body: models::Avatar = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subject_descriptor: String, - pub(crate) organization: String, - pub(crate) size: Option<String>, - pub(crate) format: Option<String>, - } - impl RequestBuilder { - pub fn size(mut self, size: impl Into<String>) -> Self { - self.size = Some(size.into()); - self - } - pub fn format(mut self, format: impl Into<String>) -> Self { - self.format = Some(format.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/Subjects/{}/avatars", - this.client.endpoint(), - &this.organization, - &this.subject_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(size) = &this.size { - req.url_mut().query_pairs_mut().append_pair("size", size); - } - if let Some(format) = &this.format { - req.url_mut() - .query_pairs_mut() - .append_pair("format", format); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Avatar>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Avatar>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod set_avatar { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) body: models::Avatar, - pub(crate) subject_descriptor: String, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/Subjects/{}/avatars", - this.client.endpoint(), - &this.organization, - &this.subject_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subject_descriptor: String, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/Subjects/{}/avatars", - this.client.endpoint(), - &this.organization, - &this.subject_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Avatar> { + let bytes = self.0.into_body().collect().await?; + let body: models::Avatar = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subject_descriptor: String, + pub(crate) organization: String, + pub(crate) size: Option<String>, + pub(crate) format: Option<String>, + } + impl RequestBuilder { + pub fn size(mut self, size: impl Into<String>) -> Self { + self.size = Some(size.into()); + self + } + pub fn format(mut self, format: impl Into<String>) -> Self { + self.format = Some(format.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/Subjects/{}/avatars", + this.client.endpoint(), + &this.organization, + &this.subject_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(size) = &this.size { + req.url_mut().query_pairs_mut().append_pair("size", size); + } + if let Some(format) = &this.format { + req + .url_mut() + .query_pairs_mut() + .append_pair("format", format); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Avatar>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Avatar>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod set_avatar { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) body: models::Avatar, + pub(crate) subject_descriptor: String, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/Subjects/{}/avatars", + this.client.endpoint(), + &this.organization, + &this.subject_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subject_descriptor: String, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/Subjects/{}/avatars", + this.client.endpoint(), + &this.organization, + &this.subject_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod users { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> 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 VSTS 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 VSTS 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 VSTS group and/or specify a custom storage key for the user."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The subset of the full graph user used to uniquely find the graph subject in an external provider."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::GraphUserCreationContext>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `user_descriptor`: The descriptor of the desired user."] + pub fn get( + &self, + organization: impl Into<String>, + user_descriptor: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + user_descriptor: user_descriptor.into(), + } + } + #[doc = "Map an existing user to a different identity"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The subset of the full graph user used to uniquely find the graph subject in an external provider."] + #[doc = "* `user_descriptor`: the descriptor of the user to update"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::GraphUserUpdateContext>, + user_descriptor: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `user_descriptor`: The descriptor of the user to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + user_descriptor: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + user_descriptor: user_descriptor.into(), + } + } + } + pub mod list { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The subset of the full graph user used to uniquely find the graph subject in an external provider."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::GraphUserCreationContext>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `user_descriptor`: The descriptor of the desired user."] - pub fn get( - &self, - organization: impl Into<String>, - user_descriptor: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The subset of the full graph user used to uniquely find the graph subject in an external provider."] - #[doc = "* `user_descriptor`: The descriptor of the user to update"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::GraphUserUpdateContext>, - user_descriptor: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `user_descriptor`: The descriptor of the user to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - user_descriptor: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - user_descriptor: user_descriptor.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphUserList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphUserList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn x_ms_continuation_token(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static( - "x-ms-continuationtoken", - )) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subject_types: Option<String>, - pub(crate) continuation_token: Option<String>, - pub(crate) scope_descriptor: Option<String>, - } - 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<String>) -> Self { - self.subject_types = Some(subject_types.into()); - self - } - #[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<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Specify a non-default scope (collection, project) to search for users."] - pub fn scope_descriptor(mut self, scope_descriptor: impl Into<String>) -> Self { - self.scope_descriptor = Some(scope_descriptor.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/users", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphUserList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GraphUserList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphUser> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphUser = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GraphUserCreationContext, - pub(crate) group_descriptors: Option<String>, - } - 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<String>) -> Self { - self.group_descriptors = Some(group_descriptors.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/users", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphUser>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GraphUser>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphUser> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphUser = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) user_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/users/{}", - this.client.endpoint(), - &this.organization, - &this.user_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphUser>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GraphUser>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphUser> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphUser = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GraphUserUpdateContext, - pub(crate) user_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/users/{}", - this.client.endpoint(), - &this.organization, - &this.user_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphUser>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GraphUser>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) user_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/users/{}", - this.client.endpoint(), - &this.organization, - &this.user_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphUserList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphUserList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn x_ms_continuation_token(&self) -> azure_core::Result<&str> { + self + .0 + .get_str(&azure_core::headers::HeaderName::from_static( + "x-ms-continuationtoken", + )) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subject_types: Option<String>, + pub(crate) continuation_token: Option<String>, + pub(crate) scope_descriptor: Option<String>, + } + 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<String>) -> Self { + self.subject_types = Some(subject_types.into()); + self + } + #[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<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "Specify a non-default scope (collection, project) to search for users."] + pub fn scope_descriptor(mut self, scope_descriptor: impl Into<String>) -> Self { + self.scope_descriptor = Some(scope_descriptor.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/users", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphUserList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GraphUserList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphUser> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphUser = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GraphUserCreationContext, + pub(crate) group_descriptors: Option<String>, + } + 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<String>) -> Self { + self.group_descriptors = Some(group_descriptors.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/users", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphUser>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GraphUser>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphUser> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphUser = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) user_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/users/{}", + this.client.endpoint(), + &this.organization, + &this.user_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphUser>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GraphUser>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphUser> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphUser = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GraphUserUpdateContext, + pub(crate) user_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/users/{}", + this.client.endpoint(), + &this.organization, + &this.user_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphUser>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::GraphUser>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) user_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/users/{}", + this.client.endpoint(), + &this.organization, + &this.user_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod provider_info { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get( + &self, + user_descriptor: impl Into<String>, + organization: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + user_descriptor: user_descriptor.into(), + organization: organization.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get( - &self, - user_descriptor: impl Into<String>, - organization: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - user_descriptor: user_descriptor.into(), - organization: organization.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GraphProviderInfo> { - let bytes = self.0.into_body().collect().await?; - let body: models::GraphProviderInfo = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) user_descriptor: String, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/graph/Users/{}/providerinfo", - this.client.endpoint(), - &this.organization, - &this.user_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GraphProviderInfo>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GraphProviderInfo>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GraphProviderInfo> { + let bytes = self.0.into_body().collect().await?; + let body: models::GraphProviderInfo = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) user_descriptor: String, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/graph/Users/{}/providerinfo", + this.client.endpoint(), + &this.organization, + &this.user_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GraphProviderInfo>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GraphProviderInfo>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } diff --git a/azure_devops_rust_api/src/graph/models.rs b/azure_devops_rust_api/src/graph/models.rs index 1cea427a..97c10381 100644 --- a/azure_devops_rust_api/src/graph/models.rs +++ b/azure_devops_rust_api/src/graph/models.rs @@ -7,1239 +7,985 @@ use serde::{Deserialize, Serialize, Serializer}; use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AadGraphMember { - #[serde(flatten)] - pub graph_member: GraphMember, - #[doc = "The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle."] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - #[doc = "When true, the group has been deleted in the identity provider"] - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "The meta type of the user in the origin, such as \"member\", \"guest\", etc. See UserMetaType for the set of possible values."] - #[serde(rename = "metaType", default, skip_serializing_if = "Option::is_none")] - pub meta_type: Option<String>, -} -impl AadGraphMember { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Avatar { - #[serde( - rename = "isAutoGenerated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_auto_generated: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<avatar::Size>, - #[serde( - rename = "timeStamp", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub time_stamp: Option<time::OffsetDateTime>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<String>, + #[serde( + rename = "isAutoGenerated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_auto_generated: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<avatar::Size>, + #[serde( + rename = "timeStamp", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub time_stamp: Option<time::OffsetDateTime>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<String>, } impl Avatar { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod avatar { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Size { - #[serde(rename = "small")] - Small, - #[serde(rename = "medium")] - Medium, - #[serde(rename = "large")] - Large, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Size { + #[serde(rename = "small")] + Small, + #[serde(rename = "medium")] + Medium, + #[serde(rename = "large")] + Large, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphCachePolicies { - #[doc = "Size of the cache"] - #[serde(rename = "cacheSize", default, skip_serializing_if = "Option::is_none")] - pub cache_size: Option<i32>, + #[doc = "Size of the cache"] + #[serde(rename = "cacheSize", default, skip_serializing_if = "Option::is_none")] + pub cache_size: Option<i32>, } impl GraphCachePolicies { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Subject descriptor of a Graph entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphDescriptorResult { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl GraphDescriptorResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a set of data used to communicate with a federated provider on behalf of a particular user."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphFederatedProviderData { - #[doc = "The access token that can be used to communicated with the federated provider on behalf on the target identity, if we were able to successfully acquire one, otherwise <code>null</code>, if we were not."] - #[serde( - rename = "accessToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub access_token: Option<String>, - #[doc = "The name of the federated provider, e.g. \"github.com\"."] - #[serde( - rename = "providerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub provider_name: Option<String>, - #[doc = "The descriptor of the graph subject to which this federated provider data corresponds."] - #[serde( - rename = "subjectDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub subject_descriptor: Option<String>, - #[doc = "The version number of this federated provider data, which corresponds to when it was last updated. Can be used to prevent returning stale provider data from the cache when the caller is aware of a newer version, such as to prevent local cache poisoning from a remote cache or store. This is the app layer equivalent of the data layer sequence ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i64>, + #[doc = "The access token that can be used to communicated with the federated provider on behalf on the target identity, if we were able to successfully acquire one, otherwise <code>null</code>, if we were not."] + #[serde( + rename = "accessToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub access_token: Option<String>, + #[doc = "The name of the federated provider, e.g. \"github.com\"."] + #[serde( + rename = "providerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub provider_name: Option<String>, + #[doc = "The descriptor of the graph subject to which this federated provider data corresponds."] + #[serde( + rename = "subjectDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub subject_descriptor: Option<String>, + #[doc = "The version number of this federated provider data, which corresponds to when it was last updated. Can be used to prevent returning stale provider data from the cache when the caller is aware of a newer version, such as to prevent local cache poisoning from a remote cache or store. This is the app layer equivalent of the data layer sequence ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i64>, } impl GraphFederatedProviderData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphGlobalExtendedPropertyBatch { - #[serde( - rename = "propertyNameFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub property_name_filters: Vec<String>, - #[serde( - rename = "subjectDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub subject_descriptors: Vec<String>, + #[serde( + rename = "propertyNameFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub property_name_filters: Vec<String>, + #[serde( + rename = "subjectDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub subject_descriptors: Vec<String>, } impl GraphGlobalExtendedPropertyBatch { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Graph group entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphGroup { - #[serde(flatten)] - pub graph_member: GraphMember, - #[doc = "A short phrase to help human readers disambiguate groups with similar names"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, + #[serde(flatten)] + pub graph_member: GraphMember, + #[doc = "A short phrase to help human readers disambiguate groups with similar names"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, } impl GraphGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Do not attempt to use this type to create a new group. This type does not contain sufficient fields to create a new group."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphGroupCreationContext { - #[doc = "Optional: If provided, we will use this identifier for the storage key of the created group"] - #[serde( - rename = "storageKey", - default, - skip_serializing_if = "Option::is_none" - )] - pub storage_key: Option<String>, + #[doc = "Optional: If provided, we will use this identifier for the storage key of the created group"] + #[serde( + rename = "storageKey", + default, + skip_serializing_if = "Option::is_none" + )] + pub storage_key: Option<String>, } impl GraphGroupCreationContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphGroupList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GraphGroup>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GraphGroup>, } impl GraphGroupList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Use this type to create a new group using the mail address as a reference to an existing group from an external AD or AAD backed provider. This is the subset of GraphGroup fields required for creation of a group for the AAD and AD use case."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphGroupMailAddressCreationContext { - #[serde(flatten)] - pub graph_group_creation_context: GraphGroupCreationContext, - #[doc = "This should be the mail address or the group in the source AD or AAD provider. Example: jamal@contoso.com Team Services will communicate with the source provider to fill all other fields on creation."] - #[serde( - rename = "mailAddress", - default, - skip_serializing_if = "Option::is_none" - )] - pub mail_address: Option<String>, + #[serde(flatten)] + pub graph_group_creation_context: GraphGroupCreationContext, + #[doc = "This should be the mail address or the group in the source AD or AAD provider. Example: jamal@contoso.com Team Services will communicate with the source provider to fill all other fields on creation."] + #[serde( + rename = "mailAddress", + default, + skip_serializing_if = "Option::is_none" + )] + pub mail_address: Option<String>, } impl GraphGroupMailAddressCreationContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Use this type to create a new group using the OriginID as a reference to an existing group from an external AD or AAD backed provider. This is the subset of GraphGroup fields required for creation of a group for the AD and AAD use case."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphGroupOriginIdCreationContext { - #[serde(flatten)] - pub graph_group_creation_context: GraphGroupCreationContext, - #[doc = "This should be the object id or sid of the group from the source AD or AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Team Services will communicate with the source provider to fill all other fields on creation."] - #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] - pub origin_id: Option<String>, + #[serde(flatten)] + pub graph_group_creation_context: GraphGroupCreationContext, + #[doc = "This should be the object id or sid of the group from the source AD or AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Team Services will communicate with the source provider to fill all other fields on creation."] + #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] + pub origin_id: Option<String>, } impl GraphGroupOriginIdCreationContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Use this type to create a new Vsts group that is not backed by an external provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphGroupVstsCreationContext { - #[serde(flatten)] - pub graph_group_creation_context: GraphGroupCreationContext, - #[doc = "For internal use only in back compat scenarios."] - #[serde( - rename = "crossProject", - default, - skip_serializing_if = "Option::is_none" - )] - pub cross_project: Option<bool>, - #[doc = "Used by VSTS groups; if set this will be the group description, otherwise ignored"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "Used by VSTS groups; if set this will be the group DisplayName, otherwise ignored"] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "For internal use only in back compat scenarios."] - #[serde( - rename = "restrictedVisibility", - default, - skip_serializing_if = "Option::is_none" - )] - pub restricted_visibility: Option<bool>, - #[doc = "For internal use only in back compat scenarios."] - #[serde( - rename = "specialGroupType", - default, - skip_serializing_if = "Option::is_none" - )] - pub special_group_type: Option<String>, + #[serde(flatten)] + pub graph_group_creation_context: GraphGroupCreationContext, + #[doc = "For internal use only in back compat scenarios."] + #[serde( + rename = "crossProject", + default, + skip_serializing_if = "Option::is_none" + )] + pub cross_project: Option<bool>, + #[doc = "Used by VSTS groups; if set this will be the group description, otherwise ignored"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "Used by VSTS groups; if set this will be the group DisplayName, otherwise ignored"] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "For internal use only in back compat scenarios."] + #[serde( + rename = "restrictedVisibility", + default, + skip_serializing_if = "Option::is_none" + )] + pub restricted_visibility: Option<bool>, + #[doc = "For internal use only in back compat scenarios."] + #[serde( + rename = "specialGroupType", + default, + skip_serializing_if = "Option::is_none" + )] + pub special_group_type: Option<String>, } impl GraphGroupVstsCreationContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphMember { - #[serde(flatten)] - pub graph_subject: GraphSubject, - #[doc = "This represents the name of the container of origin for a graph member. (For MSA this is \"Windows Live ID\", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub domain: Option<String>, - #[doc = "The email address of record for a given graph member. This may be different than the principal name."] - #[serde( - rename = "mailAddress", - default, - skip_serializing_if = "Option::is_none" - )] - pub mail_address: Option<String>, - #[doc = "This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS."] - #[serde( - rename = "principalName", - default, - skip_serializing_if = "Option::is_none" - )] - pub principal_name: Option<String>, + #[serde(flatten)] + pub graph_subject: GraphSubject, + #[doc = "This represents the name of the container of origin for a graph member. (For MSA this is \"Windows Live ID\", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub domain: Option<String>, + #[doc = "The email address of record for a given graph member. This may be different than the principal name."] + #[serde( + rename = "mailAddress", + default, + skip_serializing_if = "Option::is_none" + )] + pub mail_address: Option<String>, + #[doc = "This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS."] + #[serde( + rename = "principalName", + default, + skip_serializing_if = "Option::is_none" + )] + pub principal_name: Option<String>, } impl GraphMember { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Relationship between a container and a member"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphMembership { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[serde( - rename = "containerDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub container_descriptor: Option<String>, - #[serde( - rename = "memberDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub member_descriptor: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[serde( + rename = "containerDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub container_descriptor: Option<String>, + #[serde( + rename = "memberDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub member_descriptor: Option<String>, } impl GraphMembership { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphMembershipList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GraphMembership>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GraphMembership>, } impl GraphMembershipList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Status of a Graph membership (active/inactive)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphMembershipState { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "When true, the membership is active"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub active: Option<bool>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "When true, the membership is active"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub active: Option<bool>, } impl GraphMembershipState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphMembershipTraversal { - #[doc = "Reason why the subject could not be traversed completely"] - #[serde( - rename = "incompletenessReason", - default, - skip_serializing_if = "Option::is_none" - )] - pub incompleteness_reason: Option<String>, - #[doc = "When true, the subject is traversed completely"] - #[serde( - rename = "isComplete", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_complete: Option<bool>, - #[doc = "The traversed subject descriptor"] - #[serde( - rename = "subjectDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub subject_descriptor: Option<String>, - #[doc = "Subject descriptor ids of the traversed members"] - #[serde( - rename = "traversedSubjectIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub traversed_subject_ids: Vec<String>, - #[doc = "Subject descriptors of the traversed members"] - #[serde( - rename = "traversedSubjects", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub traversed_subjects: Vec<String>, + #[doc = "Reason why the subject could not be traversed completely"] + #[serde( + rename = "incompletenessReason", + default, + skip_serializing_if = "Option::is_none" + )] + pub incompleteness_reason: Option<String>, + #[doc = "When true, the subject is traversed completely"] + #[serde( + rename = "isComplete", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_complete: Option<bool>, + #[doc = "The traversed subject descriptor"] + #[serde( + rename = "subjectDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub subject_descriptor: Option<String>, + #[doc = "Subject descriptor ids of the traversed members"] + #[serde( + rename = "traversedSubjectIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub traversed_subject_ids: Vec<String>, + #[doc = "Subject descriptors of the traversed members"] + #[serde( + rename = "traversedSubjects", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub traversed_subjects: Vec<String>, } impl GraphMembershipTraversal { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Who is the provider for this user and what is the identifier and domain that is used to uniquely identify the user."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphProviderInfo { - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This represents the name of the container of origin for a graph member. (For MSA this is \"Windows Live ID\", for AAD the tenantID of the directory.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub domain: Option<String>, - #[doc = "The type of source provider for the origin identifier (ex: \"aad\", \"msa\")"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub origin: Option<String>, - #[doc = "The unique identifier from the system of origin. (For MSA this is the PUID in hex notation, for AAD this is the object id.)"] - #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] - pub origin_id: Option<String>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This represents the name of the container of origin for a graph member. (For MSA this is \"Windows Live ID\", for AAD the tenantID of the directory.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub domain: Option<String>, + #[doc = "The type of source provider for the origin identifier (ex: \"aad\", \"msa\")"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option<String>, + #[doc = "The unique identifier from the system of origin. (For MSA this is the PUID in hex notation, for AAD this is the object id.)"] + #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] + pub origin_id: Option<String>, } impl GraphProviderInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Container where a graph entity is defined (organization, project, team)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphScope { - #[serde(flatten)] - pub graph_subject: GraphSubject, - #[doc = "The subject descriptor that references the administrators group for this scope. Only members of this group can change the contents of this scope or assign other users permissions to access this scope."] - #[serde( - rename = "administratorDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub administrator_descriptor: Option<String>, - #[doc = "When true, this scope is also a securing host for one or more scopes."] - #[serde(rename = "isGlobal", default, skip_serializing_if = "Option::is_none")] - pub is_global: Option<bool>, - #[doc = "The subject descriptor for the closest account or organization in the ancestor tree of this scope."] - #[serde( - rename = "parentDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_descriptor: Option<String>, - #[doc = "The type of this scope. Typically ServiceHost or TeamProject."] - #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] - pub scope_type: Option<graph_scope::ScopeType>, - #[doc = "The subject descriptor for the containing organization in the ancestor tree of this scope."] - #[serde( - rename = "securingHostDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub securing_host_descriptor: Option<String>, + #[serde(flatten)] + pub graph_subject: GraphSubject, + #[doc = "The subject descriptor that references the administrators group for this scope. Only members of this group can change the contents of this scope or assign other users permissions to access this scope."] + #[serde( + rename = "administratorDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub administrator_descriptor: Option<String>, + #[doc = "When true, this scope is also a securing host for one or more scopes."] + #[serde(rename = "isGlobal", default, skip_serializing_if = "Option::is_none")] + pub is_global: Option<bool>, + #[doc = "The subject descriptor for the closest account or organization in the ancestor tree of this scope."] + #[serde( + rename = "parentDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_descriptor: Option<String>, + #[doc = "The type of this scope. Typically ServiceHost or TeamProject."] + #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] + pub scope_type: Option<graph_scope::ScopeType>, + #[doc = "The subject descriptor for the containing organization in the ancestor tree of this scope."] + #[serde( + rename = "securingHostDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub securing_host_descriptor: Option<String>, } impl GraphScope { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod graph_scope { - use super::*; - #[doc = "The type of this scope. Typically ServiceHost or TeamProject."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ScopeType { - #[serde(rename = "generic")] - Generic, - #[serde(rename = "serviceHost")] - ServiceHost, - #[serde(rename = "teamProject")] - TeamProject, - } + use super::*; + #[doc = "The type of this scope. Typically ServiceHost or TeamProject."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ScopeType { + #[serde(rename = "generic")] + Generic, + #[serde(rename = "serviceHost")] + ServiceHost, + #[serde(rename = "teamProject")] + TeamProject, + } } #[doc = "This type is the subset of fields that can be provided by the user to create a Vsts scope. Scope creation is currently limited to internal back-compat scenarios. End users that attempt to create a scope with this API will fail."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphScopeCreationContext { - #[doc = "Set this field to override the default description of this scope's admin group."] - #[serde( - rename = "adminGroupDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub admin_group_description: Option<String>, - #[doc = "All scopes have an Administrator Group that controls access to the contents of the scope. Set this field to use a non-default group name for that administrators group."] - #[serde( - rename = "adminGroupName", - default, - skip_serializing_if = "Option::is_none" - )] - pub admin_group_name: Option<String>, - #[doc = "Set this optional field if this scope is created on behalf of a user other than the user making the request. This should be the Id of the user that is not the requester."] - #[serde(rename = "creatorId", default, skip_serializing_if = "Option::is_none")] - pub creator_id: Option<String>, - #[doc = "The scope must be provided with a unique name within the parent scope. This means the created scope can have a parent or child with the same name, but no siblings with the same name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The type of scope being created."] - #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] - pub scope_type: Option<graph_scope_creation_context::ScopeType>, - #[doc = "An optional ID that uniquely represents the scope within it's parent scope. If this parameter is not provided, Vsts will generate on automatically."] - #[serde( - rename = "storageKey", - default, - skip_serializing_if = "Option::is_none" - )] - pub storage_key: Option<String>, + #[doc = "Set this field to override the default description of this scope's admin group."] + #[serde( + rename = "adminGroupDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub admin_group_description: Option<String>, + #[doc = "All scopes have an Administrator Group that controls access to the contents of the scope. Set this field to use a non-default group name for that administrators group."] + #[serde( + rename = "adminGroupName", + default, + skip_serializing_if = "Option::is_none" + )] + pub admin_group_name: Option<String>, + #[doc = "Set this optional field if this scope is created on behalf of a user other than the user making the request. This should be the Id of the user that is not the requester."] + #[serde(rename = "creatorId", default, skip_serializing_if = "Option::is_none")] + pub creator_id: Option<String>, + #[doc = "The scope must be provided with a unique name within the parent scope. This means the created scope can have a parent or child with the same name, but no siblings with the same name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The type of scope being created."] + #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] + pub scope_type: Option<graph_scope_creation_context::ScopeType>, + #[doc = "An optional ID that uniquely represents the scope within it's parent scope. If this parameter is not provided, Vsts will generate on automatically."] + #[serde( + rename = "storageKey", + default, + skip_serializing_if = "Option::is_none" + )] + pub storage_key: Option<String>, } impl GraphScopeCreationContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod graph_scope_creation_context { - use super::*; - #[doc = "The type of scope being created."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ScopeType { - #[serde(rename = "generic")] - Generic, - #[serde(rename = "serviceHost")] - ServiceHost, - #[serde(rename = "teamProject")] - TeamProject, - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GraphServicePrincipal { - #[serde(flatten)] - pub aad_graph_member: AadGraphMember, - #[serde( - rename = "applicationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub application_id: Option<String>, -} -impl GraphServicePrincipal { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Do not attempt to use this type to create a new service principal. Use one of the subclasses instead. This type does not contain sufficient fields to create a new service principal."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GraphServicePrincipalCreationContext { - #[doc = "Optional: If provided, we will use this identifier for the storage key of the created service principal"] - #[serde( - rename = "storageKey", - default, - skip_serializing_if = "Option::is_none" - )] - pub storage_key: Option<String>, -} -impl GraphServicePrincipalCreationContext { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GraphServicePrincipalList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GraphServicePrincipal>, -} -impl GraphServicePrincipalList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Use this type to create a new service principal using the OriginID as a reference to an existing service principal from an external AAD backed provider. This is the subset of GraphServicePrincipal fields required for creation of a GraphServicePrincipal for the AAD use case when looking up the service principal by its unique ID in the backing provider."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GraphServicePrincipalOriginIdCreationContext { - #[serde(flatten)] - pub graph_service_principal_creation_context: GraphServicePrincipalCreationContext, - #[doc = "This should be the object id of the service principal from the AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Team Services will communicate with the source provider to fill all other fields on creation."] - #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] - pub origin_id: Option<String>, -} -impl GraphServicePrincipalOriginIdCreationContext { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Use this type to update an existing service principal using the OriginID as a reference to an existing service principal from an external AAD backed provider. This is the subset of GraphServicePrincipal fields required for creation of a GraphServicePrincipal for AAD use case when looking up the service principal by its unique ID in the backing provider."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GraphServicePrincipalOriginIdUpdateContext { - #[serde(flatten)] - pub graph_service_principal_update_context: GraphServicePrincipalUpdateContext, - #[doc = "This should be the object id or sid of the service principal from the source AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Azure Devops will communicate with the source provider to fill all other fields on creation."] - #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] - pub origin_id: Option<String>, -} -impl GraphServicePrincipalOriginIdUpdateContext { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Do not attempt to use this type to update service principal. Use one of the subclasses instead. This type does not contain sufficient fields to create a new service principal."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GraphServicePrincipalUpdateContext {} -impl GraphServicePrincipalUpdateContext { - pub fn new() -> Self { - Self::default() - } + use super::*; + #[doc = "The type of scope being created."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ScopeType { + #[serde(rename = "generic")] + Generic, + #[serde(rename = "serviceHost")] + ServiceHost, + #[serde(rename = "teamProject")] + TeamProject, + } } #[doc = "Storage key of a Graph entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphStorageKeyResult { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl GraphStorageKeyResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Top-level graph entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubject { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "[Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor."] - #[serde( - rename = "legacyDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub legacy_descriptor: Option<String>, - #[doc = "The type of source provider for the origin identifier (ex:AD, AAD, MSA)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub origin: Option<String>, - #[doc = "The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider."] - #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] - pub origin_id: Option<String>, - #[doc = "This field identifies the type of the graph subject (ex: Group, Scope, User)."] - #[serde( - rename = "subjectKind", - default, - skip_serializing_if = "Option::is_none" - )] - pub subject_kind: Option<String>, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "[Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor."] + #[serde( + rename = "legacyDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub legacy_descriptor: Option<String>, + #[doc = "The type of source provider for the origin identifier (ex:AD, AAD, MSA)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option<String>, + #[doc = "The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider."] + #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] + pub origin_id: Option<String>, + #[doc = "This field identifies the type of the graph subject (ex: Group, Scope, User)."] + #[serde( + rename = "subjectKind", + default, + skip_serializing_if = "Option::is_none" + )] + pub subject_kind: Option<String>, } impl GraphSubject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GraphSubject>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GraphSubject>, } impl GraphSubjectList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Batching of subjects to lookup using the Graph API"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectLookup { - #[serde( - rename = "lookupKeys", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub lookup_keys: Vec<GraphSubjectLookupKey>, + #[serde( + rename = "lookupKeys", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub lookup_keys: Vec<GraphSubjectLookupKey>, } impl GraphSubjectLookup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectLookupKey { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, } impl GraphSubjectLookupKey { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Subject to search using the Graph API"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectQuery { - #[doc = "Search term to search for Azure Devops users or/and groups"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option<String>, - #[doc = "Optional parameter. Specify a non-default scope (collection, project) to search for users or groups within the scope."] - #[serde( - rename = "scopeDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub scope_descriptor: Option<String>, - #[doc = "\"User\" or \"Group\" can be specified, both or either"] - #[serde( - rename = "subjectKind", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub subject_kind: Vec<String>, + #[doc = "Search term to search for Azure Devops users or/and groups"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option<String>, + #[doc = "Optional parameter. Specify a non-default scope (collection, project) to search for users or groups within the scope."] + #[serde( + rename = "scopeDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub scope_descriptor: Option<String>, + #[doc = "\"User\" or \"Group\" can be specified, both or either"] + #[serde( + rename = "subjectKind", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub subject_kind: Vec<String>, } impl GraphSubjectQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSystemSubject { - #[serde(flatten)] - pub graph_subject: GraphSubject, + #[serde(flatten)] + pub graph_subject: GraphSubject, } impl GraphSystemSubject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = ""] +#[doc = "Graph user entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphUser { - #[serde(flatten)] - pub aad_graph_member: AadGraphMember, + #[serde(flatten)] + pub graph_member: GraphMember, + #[doc = "The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle."] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + #[doc = "When true, the group has been deleted in the identity provider"] + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "The meta type of the user in the origin, such as \"member\", \"guest\", etc. See UserMetaType for the set of possible values."] + #[serde(rename = "metaType", default, skip_serializing_if = "Option::is_none")] + pub meta_type: Option<String>, } impl GraphUser { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Do not attempt to use this type to create a new user. Use one of the subclasses instead. This type does not contain sufficient fields to create a new user."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphUserCreationContext { - #[doc = "Optional: If provided, we will use this identifier for the storage key of the created user"] - #[serde( - rename = "storageKey", - default, - skip_serializing_if = "Option::is_none" - )] - pub storage_key: Option<String>, + #[doc = "Optional: If provided, we will use this identifier for the storage key of the created user"] + #[serde( + rename = "storageKey", + default, + skip_serializing_if = "Option::is_none" + )] + pub storage_key: Option<String>, } impl GraphUserCreationContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphUserList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GraphUser>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GraphUser>, } impl GraphUserList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Use this type to create a new user using the mail address as a reference to an existing user from an external AD or AAD backed provider. This is the subset of GraphUser fields required for creation of a GraphUser for the AD and AAD use case when looking up the user by its mail address in the backing provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphUserMailAddressCreationContext { - #[serde(flatten)] - pub graph_user_creation_context: GraphUserCreationContext, - #[doc = "This should be the mail address of the user in the source AD or AAD provider. Example: Jamal.Hartnett@contoso.com Team Services will communicate with the source provider to fill all other fields on creation."] - #[serde( - rename = "mailAddress", - default, - skip_serializing_if = "Option::is_none" - )] - pub mail_address: Option<String>, + #[serde(flatten)] + pub graph_user_creation_context: GraphUserCreationContext, + #[serde( + rename = "mailAddress", + default, + skip_serializing_if = "Option::is_none" + )] + pub mail_address: Option<String>, } impl GraphUserMailAddressCreationContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Use this type to create a new user using the OriginID as a reference to an existing user from an external AD or AAD backed provider. This is the subset of GraphUser fields required for creation of a GraphUser for the AD and AAD use case when looking up the user by its unique ID in the backing provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphUserOriginIdCreationContext { - #[serde(flatten)] - pub graph_user_creation_context: GraphUserCreationContext, - #[doc = "This should be the name of the origin provider. Example: github.com"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub origin: Option<String>, - #[doc = "This should be the object id or sid of the user from the source AD or AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Team Services will communicate with the source provider to fill all other fields on creation."] - #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] - pub origin_id: Option<String>, + #[serde(flatten)] + pub graph_user_creation_context: GraphUserCreationContext, + #[doc = "This should be the name of the origin provider. Example: github.com"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option<String>, + #[doc = "This should be the object id or sid of the user from the source AD or AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Team Services will communicate with the source provider to fill all other fields on creation."] + #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] + pub origin_id: Option<String>, } impl GraphUserOriginIdCreationContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Use this type to update an existing user using the OriginID as a reference to an existing user from an external AD or AAD backed provider. This is the subset of GraphUser fields required for creation of a GraphUser for the AD and AAD use case when looking up the user by its unique ID in the backing provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphUserOriginIdUpdateContext { - #[serde(flatten)] - pub graph_user_update_context: GraphUserUpdateContext, - #[doc = "This should be the object id or sid of the user from the source AD or AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Azure Devops will communicate with the source provider to fill all other fields on creation."] - #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] - pub origin_id: Option<String>, + #[serde(flatten)] + pub graph_user_update_context: GraphUserUpdateContext, + #[doc = "This should be the object id or sid of the user from the source AD or AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Azure Devops will communicate with the source provider to fill all other fields on creation."] + #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] + pub origin_id: Option<String>, } impl GraphUserOriginIdUpdateContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Use this type to create a new user using the principal name as a reference to an existing user from an external AD or AAD backed provider. This is the subset of GraphUser fields required for creation of a GraphUser for the AD and AAD use case when looking up the user by its principal name in the backing provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphUserPrincipalNameCreationContext { - #[serde(flatten)] - pub graph_user_creation_context: GraphUserCreationContext, - #[doc = "This should be the principal name or upn of the user in the source AD or AAD provider. Example: jamal@contoso.com Team Services will communicate with the source provider to fill all other fields on creation."] - #[serde( - rename = "principalName", - default, - skip_serializing_if = "Option::is_none" - )] - pub principal_name: Option<String>, + #[serde(flatten)] + pub graph_user_creation_context: GraphUserCreationContext, + #[doc = "This should be the principal name or upn of the user in the source AD or AAD provider. Example: jamal@contoso.com Team Services will communicate with the source provider to fill all other fields on creation."] + #[serde( + rename = "principalName", + default, + skip_serializing_if = "Option::is_none" + )] + pub principal_name: Option<String>, } impl GraphUserPrincipalNameCreationContext { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Use this type for transfering identity rights, for instance after performing a Tenant switch."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GraphUserPrincipalNameUpdateContext { - #[serde(flatten)] - pub graph_user_update_context: GraphUserUpdateContext, - #[doc = "This should be Principal Name (UPN) to which we want to transfer rights. Example: destination@email.com"] - #[serde( - rename = "principalName", - default, - skip_serializing_if = "Option::is_none" - )] - pub principal_name: Option<String>, -} -impl GraphUserPrincipalNameUpdateContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Do not attempt to use this type to update user. Use one of the subclasses instead. This type does not contain sufficient fields to create a new user."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphUserUpdateContext {} impl GraphUserUpdateContext { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct IdentityMapping { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<UserPrincipalName>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<UserPrincipalName>, -} -impl IdentityMapping { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct IdentityMappings { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mappings: Vec<IdentityMapping>, -} -impl IdentityMappings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an abstract JSON token."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JToken { - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub first: Box<Option<JToken>>, - #[doc = "Gets a value indicating whether this token has child tokens."] - #[serde(rename = "hasValues", default, skip_serializing_if = "Option::is_none")] - pub has_values: Option<bool>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Box<Option<JToken>>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub last: Box<Option<JToken>>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub next: Box<Option<JToken>>, - #[doc = "Gets or sets the parent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option<String>, - #[doc = "Gets the path of the JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub previous: Box<Option<JToken>>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub root: Box<Option<JToken>>, - #[doc = "Gets the node type for this JToken."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first: Box<Option<JToken>>, + #[doc = "Gets a value indicating whether this token has child tokens."] + #[serde(rename = "hasValues", default, skip_serializing_if = "Option::is_none")] + pub has_values: Option<bool>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Box<Option<JToken>>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last: Box<Option<JToken>>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next: Box<Option<JToken>>, + #[doc = "Gets or sets the parent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option<String>, + #[doc = "Gets the path of the JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous: Box<Option<JToken>>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub root: Box<Option<JToken>>, + #[doc = "Gets the node type for this JToken."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl JToken { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for JSON Patch Operations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchDocument {} impl JsonPatchDocument { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for a JSON Patch operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchOperation { - #[doc = "The path to copy from for the Move/Copy operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub from: Option<String>, - #[doc = "The patch operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub op: Option<json_patch_operation::Op>, - #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "The value for the operation. This is either a primitive or a JToken."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = "The path to copy from for the Move/Copy operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub from: Option<String>, + #[doc = "The patch operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub op: Option<json_patch_operation::Op>, + #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "The value for the operation. This is either a primitive or a JToken."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl JsonPatchOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod json_patch_operation { - use super::*; - #[doc = "The patch operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Op { - #[serde(rename = "add")] - Add, - #[serde(rename = "remove")] - Remove, - #[serde(rename = "replace")] - Replace, - #[serde(rename = "move")] - Move, - #[serde(rename = "copy")] - Copy, - #[serde(rename = "test")] - Test, - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MappingResult { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option<String>, - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, -} -impl MappingResult { - pub fn new() -> Self { - Self::default() - } + use super::*; + #[doc = "The patch operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Op { + #[serde(rename = "add")] + Add, + #[serde(rename = "remove")] + Remove, + #[serde(rename = "replace")] + Replace, + #[serde(rename = "move")] + Move, + #[serde(rename = "copy")] + Copy, + #[serde(rename = "test")] + Test, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PagedGraphGroups { - #[doc = "This will be non-null if there is another page of data. There will never be more than one continuation token returned by a request."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub continuation_token: Vec<String>, - #[doc = "The enumerable list of groups found within a page."] - #[serde( - rename = "graphGroups", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub graph_groups: Vec<GraphGroup>, + #[doc = "This will be non-null if there is another page of data. There will never be more than one continuation token returned by a request."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub continuation_token: Vec<String>, + #[doc = "The enumerable list of groups found within a page."] + #[serde( + rename = "graphGroups", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub graph_groups: Vec<GraphGroup>, } impl PagedGraphGroups { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PagedGraphMembers { - #[doc = "This will be non-null if there is another page of data. There will never be more than one continuation token returned by a request."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub continuation_token: Vec<String>, - #[doc = "The enumerable list of members found within a page."] - #[serde( - rename = "graphMembers", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub graph_members: Vec<GraphMember>, -} -impl PagedGraphMembers { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PagedGraphServicePrincipals { - #[doc = "This will be non-null if there is another page of data. There will never be more than one continuation token returned by a request."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub continuation_token: Vec<String>, - #[doc = "The enumerable list of service principals found within a page."] - #[serde( - rename = "graphServicePrincipals", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub graph_service_principals: Vec<GraphServicePrincipal>, -} -impl PagedGraphServicePrincipals { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PagedGraphUsers { - #[doc = "This will be non-null if there is another page of data. There will never be more than one continuation token returned by a request."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub continuation_token: Vec<String>, - #[doc = "The enumerable set of users found within a page."] - #[serde( - rename = "graphUsers", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub graph_users: Vec<GraphUser>, + #[doc = "This will be non-null if there is another page of data. There will never be more than one continuation token returned by a request."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub continuation_token: Vec<String>, + #[doc = "The enumerable set of users found within a page."] + #[serde( + rename = "graphUsers", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub graph_users: Vec<GraphUser>, } impl PagedGraphUsers { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RequestAccessPayLoad { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[serde( - rename = "projectUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_uri: Option<String>, - #[serde( - rename = "urlRequested", - default, - skip_serializing_if = "Option::is_none" - )] - pub url_requested: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[serde( + rename = "projectUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_uri: Option<String>, + #[serde( + rename = "urlRequested", + default, + skip_serializing_if = "Option::is_none" + )] + pub url_requested: Option<String>, } impl RequestAccessPayLoad { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResolveDisconnectedUsersResponse { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option<String>, - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[serde( - rename = "mappingResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mapping_results: Vec<MappingResult>, -} -impl ResolveDisconnectedUsersResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserPrincipalName { - #[serde( - rename = "principalName", - default, - skip_serializing_if = "Option::is_none" - )] - pub principal_name: Option<String>, -} -impl UserPrincipalName { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/hooks/mod.rs b/azure_devops_rust_api/src/hooks/mod.rs index 2b0436d6..1db7cf0b 100644 --- a/azure_devops_rust_api/src/hooks/mod.rs +++ b/azure_devops_rust_api/src/hooks/mod.rs @@ -9,2899 +9,2915 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + } + 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()) + } +} +pub mod consumers { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `consumer_id`: ID for a consumer."] + pub fn get( + &self, + organization: impl Into<String>, + consumer_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `consumer_id`: ID for a consumer."] + pub fn list_consumer_actions( + &self, + organization: impl Into<String>, + consumer_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `consumer_id`: ID for a consumer."] + #[doc = "* `consumer_action_id`: ID for a consumerActionId."] + pub fn get_consumer_action( + &self, + organization: impl Into<String>, + consumer_id: impl Into<String>, + consumer_action_id: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ConsumerList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ConsumerList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) publisher_id: Option<String>, + } + impl RequestBuilder { + pub fn publisher_id(mut self, publisher_id: impl Into<String>) -> Self { + self.publisher_id = Some(publisher_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/consumers", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(publisher_id) = &this.publisher_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("publisherId", publisher_id); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ConsumerList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ConsumerList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Consumer> { + let bytes = self.0.into_body().collect().await?; + let body: models::Consumer = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) consumer_id: String, + pub(crate) publisher_id: Option<String>, + } + impl RequestBuilder { + pub fn publisher_id(mut self, publisher_id: impl Into<String>) -> Self { + self.publisher_id = Some(publisher_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/consumers/{}", + this.client.endpoint(), + &this.organization, + &this.consumer_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(publisher_id) = &this.publisher_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("publisherId", publisher_id); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Consumer>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Consumer>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); + } + pub mod list_consumer_actions { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ConsumerActionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ConsumerActionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) consumer_id: String, + pub(crate) publisher_id: Option<String>, + } + impl RequestBuilder { + pub fn publisher_id(mut self, publisher_id: impl Into<String>) -> Self { + self.publisher_id = Some(publisher_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/consumers/{}/actions", + this.client.endpoint(), + &this.organization, + &this.consumer_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(publisher_id) = &this.publisher_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("publisherId", publisher_id); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ConsumerActionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ConsumerActionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + } + pub mod get_consumer_action { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ConsumerAction> { + let bytes = self.0.into_body().collect().await?; + let body: models::ConsumerAction = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) consumer_id: String, + pub(crate) consumer_action_id: String, + pub(crate) publisher_id: Option<String>, + } + impl RequestBuilder { + pub fn publisher_id(mut self, publisher_id: impl Into<String>) -> Self { + self.publisher_id = Some(publisher_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/consumers/{}/actions/{}", + this.client.endpoint(), + &this.organization, + &this.consumer_id, + &this.consumer_action_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(publisher_id) = &this.publisher_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("publisherId", publisher_id); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ConsumerAction>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ConsumerAction>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) +pub mod notifications { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn query( + &self, + organization: impl Into<String>, + body: impl Into<models::NotificationsQuery>, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } } -} -pub mod consumers { + #[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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `subscription_id`: ID for a subscription."] + pub fn list( + &self, + organization: impl Into<String>, + subscription_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `subscription_id`: ID for a subscription."] + pub fn get( + &self, + organization: impl Into<String>, + subscription_id: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::Notification>, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + use_real_data: None, + } + } + } + pub mod query { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `consumer_id`: ID for a consumer."] - pub fn get( - &self, - organization: impl Into<String>, - consumer_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `consumer_id`: ID for a consumer."] - pub fn list_consumer_actions( - &self, - organization: impl Into<String>, - consumer_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `consumer_id`: ID for a consumer."] - #[doc = "* `consumer_action_id`: ID for a consumerActionId."] - pub fn get_consumer_action( - &self, - organization: impl Into<String>, - consumer_id: impl Into<String>, - consumer_action_id: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ConsumerList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ConsumerList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) publisher_id: Option<String>, - } - impl RequestBuilder { - pub fn publisher_id(mut self, publisher_id: impl Into<String>) -> Self { - self.publisher_id = Some(publisher_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/consumers", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(publisher_id) = &this.publisher_id { - req.url_mut() - .query_pairs_mut() - .append_pair("publisherId", publisher_id); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ConsumerList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ConsumerList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Consumer> { - let bytes = self.0.into_body().collect().await?; - let body: models::Consumer = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) consumer_id: String, - pub(crate) publisher_id: Option<String>, - } - impl RequestBuilder { - pub fn publisher_id(mut self, publisher_id: impl Into<String>) -> Self { - self.publisher_id = Some(publisher_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/consumers/{}", - this.client.endpoint(), - &this.organization, - &this.consumer_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(publisher_id) = &this.publisher_id { - req.url_mut() - .query_pairs_mut() - .append_pair("publisherId", publisher_id); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Consumer>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Consumer>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_consumer_actions { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ConsumerActionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ConsumerActionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) consumer_id: String, - pub(crate) publisher_id: Option<String>, - } - impl RequestBuilder { - pub fn publisher_id(mut self, publisher_id: impl Into<String>) -> Self { - self.publisher_id = Some(publisher_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/consumers/{}/actions", - this.client.endpoint(), - &this.organization, - &this.consumer_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(publisher_id) = &this.publisher_id { - req.url_mut() - .query_pairs_mut() - .append_pair("publisherId", publisher_id); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ConsumerActionList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ConsumerActionList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_consumer_action { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ConsumerAction> { - let bytes = self.0.into_body().collect().await?; - let body: models::ConsumerAction = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) consumer_id: String, - pub(crate) consumer_action_id: String, - pub(crate) publisher_id: Option<String>, - } - impl RequestBuilder { - pub fn publisher_id(mut self, publisher_id: impl Into<String>) -> Self { - self.publisher_id = Some(publisher_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/consumers/{}/actions/{}", - this.client.endpoint(), - &this.organization, - &this.consumer_id, - &this.consumer_action_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(publisher_id) = &this.publisher_id { - req.url_mut() - .query_pairs_mut() - .append_pair("publisherId", publisher_id); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ConsumerAction>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ConsumerAction>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::NotificationsQuery> { + let bytes = self.0.into_body().collect().await?; + let body: models::NotificationsQuery = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod notifications { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::NotificationsQuery, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/notificationsquery", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::NotificationsQuery>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::NotificationsQuery>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn query( - &self, - organization: impl Into<String>, - body: impl Into<models::NotificationsQuery>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `subscription_id`: ID for a subscription."] - pub fn list( - &self, - organization: impl Into<String>, - subscription_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `subscription_id`: ID for a subscription."] - pub fn get( - &self, - organization: impl Into<String>, - subscription_id: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::Notification>, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - use_real_data: None, - } - } - } - pub mod query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::NotificationsQuery> { - let bytes = self.0.into_body().collect().await?; - let body: models::NotificationsQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::NotificationsQuery, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/notificationsquery", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::NotificationsQuery>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::NotificationsQuery>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::NotificationList> { - let bytes = self.0.into_body().collect().await?; - let body: models::NotificationList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subscription_id: String, - pub(crate) max_results: Option<i32>, - pub(crate) status: Option<String>, - pub(crate) result: Option<String>, - } - 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); - self - } - #[doc = "Get only notifications with this status."] - pub fn status(mut self, status: impl Into<String>) -> Self { - self.status = Some(status.into()); - self - } - #[doc = "Get only notifications with this result type."] - pub fn result(mut self, result: impl Into<String>) -> Self { - self.result = Some(result.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}/notifications", - this.client.endpoint(), - &this.organization, - &this.subscription_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - if let Some(result) = &this.result { - req.url_mut() - .query_pairs_mut() - .append_pair("result", result); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::NotificationList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::NotificationList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Notification> { - let bytes = self.0.into_body().collect().await?; - let body: models::Notification = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subscription_id: String, - pub(crate) notification_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}/notifications/{}", - this.client.endpoint(), - &this.organization, - &this.subscription_id, - &this.notification_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Notification>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Notification>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Notification> { - let bytes = self.0.into_body().collect().await?; - let body: models::Notification = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Notification, - pub(crate) use_real_data: Option<bool>, - } - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/testnotifications", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Notification>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Notification>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::NotificationList> { + let bytes = self.0.into_body().collect().await?; + let body: models::NotificationList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subscription_id: String, + pub(crate) max_results: Option<i32>, + pub(crate) status: Option<String>, + pub(crate) result: Option<String>, + } + 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); + self + } + #[doc = "Get only notifications with this status."] + pub fn status(mut self, status: impl Into<String>) -> Self { + self.status = Some(status.into()); + self + } + #[doc = "Get only notifications with this result type."] + pub fn result(mut self, result: impl Into<String>) -> Self { + self.result = Some(result.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}/notifications", + this.client.endpoint(), + &this.organization, + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + if let Some(result) = &this.result { + req + .url_mut() + .query_pairs_mut() + .append_pair("result", result); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::NotificationList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::NotificationList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Notification> { + let bytes = self.0.into_body().collect().await?; + let body: models::Notification = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subscription_id: String, + pub(crate) notification_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}/notifications/{}", + this.client.endpoint(), + &this.organization, + &this.subscription_id, + &this.notification_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Notification>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::Notification>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Notification> { + let bytes = self.0.into_body().collect().await?; + let body: models::Notification = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Notification, + pub(crate) use_real_data: Option<bool>, + } + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/testnotifications", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Notification>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::Notification>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod publishers { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of publishers."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Get a specific service hooks publisher."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `publisher_id`: ID for a publisher."] + pub fn get( + &self, + organization: impl Into<String>, + publisher_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `publisher_id`: ID for a publisher."] + pub fn list_event_types( + &self, + organization: impl Into<String>, + publisher_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `publisher_id`: ID for a publisher."] + pub fn get_event_type( + &self, + organization: impl Into<String>, + publisher_id: impl Into<String>, + event_type_id: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn query_input_values( + &self, + organization: impl Into<String>, + body: impl Into<models::InputValuesQuery>, + publisher_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn query_publishers( + &self, + organization: impl Into<String>, + body: impl Into<models::PublishersQuery>, + ) -> query_publishers::RequestBuilder { + query_publishers::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of publishers."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - #[doc = "Get a specific service hooks publisher."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `publisher_id`: ID for a publisher."] - pub fn get( - &self, - organization: impl Into<String>, - publisher_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `publisher_id`: ID for a publisher."] - pub fn list_event_types( - &self, - organization: impl Into<String>, - publisher_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `publisher_id`: ID for a publisher."] - pub fn get_event_type( - &self, - organization: impl Into<String>, - publisher_id: impl Into<String>, - event_type_id: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn query_input_values( - &self, - organization: impl Into<String>, - body: impl Into<models::InputValuesQuery>, - publisher_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn query_publishers( - &self, - organization: impl Into<String>, - body: impl Into<models::PublishersQuery>, - ) -> query_publishers::RequestBuilder { - query_publishers::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PublisherList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PublisherList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/publishers", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PublisherList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PublisherList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Publisher> { - let bytes = self.0.into_body().collect().await?; - let body: models::Publisher = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) publisher_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/publishers/{}", - this.client.endpoint(), - &this.organization, - &this.publisher_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Publisher>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Publisher>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_event_types { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::EventTypeDescriptorList> { - let bytes = self.0.into_body().collect().await?; - let body: models::EventTypeDescriptorList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) publisher_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/publishers/{}/eventtypes", - this.client.endpoint(), - &this.organization, - &this.publisher_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::EventTypeDescriptorList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::EventTypeDescriptorList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_event_type { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::EventTypeDescriptor> { - let bytes = self.0.into_body().collect().await?; - let body: models::EventTypeDescriptor = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) publisher_id: String, - pub(crate) event_type_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/publishers/{}/eventtypes/{}", - this.client.endpoint(), - &this.organization, - &this.publisher_id, - &this.event_type_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::EventTypeDescriptor>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::EventTypeDescriptor>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod query_input_values { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::InputValuesQuery> { - let bytes = self.0.into_body().collect().await?; - let body: models::InputValuesQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::InputValuesQuery, - pub(crate) publisher_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/publishers/{}/inputValuesQuery", - this.client.endpoint(), - &this.organization, - &this.publisher_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::InputValuesQuery>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::InputValuesQuery>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod query_publishers { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PublishersQuery> { - let bytes = self.0.into_body().collect().await?; - let body: models::PublishersQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PublishersQuery, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/publishersquery", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PublishersQuery>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PublishersQuery>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PublisherList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PublisherList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/publishers", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PublisherList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PublisherList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Publisher> { + let bytes = self.0.into_body().collect().await?; + let body: models::Publisher = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) publisher_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/publishers/{}", + this.client.endpoint(), + &this.organization, + &this.publisher_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Publisher>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Publisher>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_event_types { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::EventTypeDescriptorList> { + let bytes = self.0.into_body().collect().await?; + let body: models::EventTypeDescriptorList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) publisher_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/publishers/{}/eventtypes", + this.client.endpoint(), + &this.organization, + &this.publisher_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::EventTypeDescriptorList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::EventTypeDescriptorList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_event_type { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::EventTypeDescriptor> { + let bytes = self.0.into_body().collect().await?; + let body: models::EventTypeDescriptor = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) publisher_id: String, + pub(crate) event_type_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/publishers/{}/eventtypes/{}", + this.client.endpoint(), + &this.organization, + &this.publisher_id, + &this.event_type_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::EventTypeDescriptor>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::EventTypeDescriptor>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod query_input_values { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::InputValuesQuery> { + let bytes = self.0.into_body().collect().await?; + let body: models::InputValuesQuery = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::InputValuesQuery, + pub(crate) publisher_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/publishers/{}/inputValuesQuery", + this.client.endpoint(), + &this.organization, + &this.publisher_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::InputValuesQuery>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::InputValuesQuery>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod query_publishers { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PublishersQuery> { + let bytes = self.0.into_body().collect().await?; + let body: models::PublishersQuery = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PublishersQuery, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/publishersquery", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PublishersQuery>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PublishersQuery>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod subscriptions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of subscriptions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Subscription to be created."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::Subscription>, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Get a specific service hooks subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `subscription_id`: ID for a subscription."] + pub fn get( + &self, + organization: impl Into<String>, + subscription_id: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Update a subscription. <param name=\"subscriptionId\">ID for a subscription that you wish to update.</param>"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn replace_subscription( + &self, + organization: impl Into<String>, + body: impl Into<models::Subscription>, + subscription_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `subscription_id`: ID for a subscription."] + pub fn delete( + &self, + organization: impl Into<String>, + subscription_id: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Query for service hook subscriptions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn create_subscriptions_query( + &self, + organization: impl Into<String>, + body: impl Into<models::SubscriptionsQuery>, + ) -> create_subscriptions_query::RequestBuilder { + create_subscriptions_query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of subscriptions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Subscription to be created."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::Subscription>, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - #[doc = "Get a specific service hooks subscription."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `subscription_id`: ID for a subscription."] - pub fn get( - &self, - organization: impl Into<String>, - subscription_id: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Update a subscription. <param name=\"subscriptionId\">ID for a subscription that you wish to update.</param>"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn replace_subscription( - &self, - organization: impl Into<String>, - body: impl Into<models::Subscription>, - subscription_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `subscription_id`: ID for a subscription."] - pub fn delete( - &self, - organization: impl Into<String>, - subscription_id: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Query for service hook subscriptions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn create_subscriptions_query( - &self, - organization: impl Into<String>, - body: impl Into<models::SubscriptionsQuery>, - ) -> create_subscriptions_query::RequestBuilder { - create_subscriptions_query::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SubscriptionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) publisher_id: Option<String>, - pub(crate) event_type: Option<String>, - pub(crate) consumer_id: Option<String>, - pub(crate) consumer_action_id: Option<String>, - } - impl RequestBuilder { - #[doc = "ID for a subscription."] - pub fn publisher_id(mut self, publisher_id: impl Into<String>) -> Self { - self.publisher_id = Some(publisher_id.into()); - self - } - #[doc = "The event type to filter on (if any)."] - pub fn event_type(mut self, event_type: impl Into<String>) -> Self { - self.event_type = Some(event_type.into()); - self - } - #[doc = "ID for a consumer."] - pub fn consumer_id(mut self, consumer_id: impl Into<String>) -> Self { - self.consumer_id = Some(consumer_id.into()); - self - } - #[doc = "ID for a consumerActionId."] - pub fn consumer_action_id(mut self, consumer_action_id: impl Into<String>) -> Self { - self.consumer_action_id = Some(consumer_action_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SubscriptionList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::SubscriptionList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Subscription> { - let bytes = self.0.into_body().collect().await?; - let body: models::Subscription = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Subscription, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Subscription>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Subscription>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Subscription> { - let bytes = self.0.into_body().collect().await?; - let body: models::Subscription = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subscription_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}", - this.client.endpoint(), - &this.organization, - &this.subscription_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Subscription>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Subscription>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod replace_subscription { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Subscription> { - let bytes = self.0.into_body().collect().await?; - let body: models::Subscription = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Subscription, - pub(crate) subscription_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}", - this.client.endpoint(), - &this.organization, - &this.subscription_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Subscription>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Subscription>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subscription_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}", - this.client.endpoint(), - &this.organization, - &this.subscription_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod create_subscriptions_query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SubscriptionsQuery> { - let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionsQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::SubscriptionsQuery, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptionsquery", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SubscriptionsQuery>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::SubscriptionsQuery>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SubscriptionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) publisher_id: Option<String>, + pub(crate) event_type: Option<String>, + pub(crate) consumer_id: Option<String>, + pub(crate) consumer_action_id: Option<String>, + } + impl RequestBuilder { + #[doc = "ID for a subscription."] + pub fn publisher_id(mut self, publisher_id: impl Into<String>) -> Self { + self.publisher_id = Some(publisher_id.into()); + self + } + #[doc = "The event type to filter on (if any)."] + pub fn event_type(mut self, event_type: impl Into<String>) -> Self { + self.event_type = Some(event_type.into()); + self + } + #[doc = "ID for a consumer."] + pub fn consumer_id(mut self, consumer_id: impl Into<String>) -> Self { + self.consumer_id = Some(consumer_id.into()); + self + } + #[doc = "ID for a consumerActionId."] + pub fn consumer_action_id(mut self, consumer_action_id: impl Into<String>) -> Self { + self.consumer_action_id = Some(consumer_action_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SubscriptionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SubscriptionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Subscription> { + let bytes = self.0.into_body().collect().await?; + let body: models::Subscription = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Subscription, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Subscription>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::Subscription>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Subscription> { + let bytes = self.0.into_body().collect().await?; + let body: models::Subscription = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subscription_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}", + this.client.endpoint(), + &this.organization, + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Subscription>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::Subscription>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod replace_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Subscription> { + let bytes = self.0.into_body().collect().await?; + let body: models::Subscription = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Subscription, + pub(crate) subscription_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}", + this.client.endpoint(), + &this.organization, + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Subscription>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::Subscription>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subscription_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}", + this.client.endpoint(), + &this.organization, + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod create_subscriptions_query { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SubscriptionsQuery> { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionsQuery = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::SubscriptionsQuery, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptionsquery", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SubscriptionsQuery>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SubscriptionsQuery>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod diagnostics { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get( + &self, + organization: impl Into<String>, + subscription_id: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::UpdateSubscripitonDiagnosticsParameters>, + subscription_id: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get( - &self, - organization: impl Into<String>, - subscription_id: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::UpdateSubscripitonDiagnosticsParameters>, - subscription_id: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SubscriptionDiagnostics> { - let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionDiagnostics = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subscription_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}/diagnostics", - this.client.endpoint(), - &this.organization, - &this.subscription_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SubscriptionDiagnostics>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::SubscriptionDiagnostics>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SubscriptionDiagnostics> { - let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionDiagnostics = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::UpdateSubscripitonDiagnosticsParameters, - pub(crate) subscription_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}/diagnostics", - this.client.endpoint(), - &this.organization, - &this.subscription_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SubscriptionDiagnostics>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::SubscriptionDiagnostics>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SubscriptionDiagnostics> { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionDiagnostics = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subscription_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}/diagnostics", + this.client.endpoint(), + &this.organization, + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SubscriptionDiagnostics>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SubscriptionDiagnostics>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SubscriptionDiagnostics> { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionDiagnostics = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UpdateSubscripitonDiagnosticsParameters, + pub(crate) subscription_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}/diagnostics", + this.client.endpoint(), + &this.organization, + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SubscriptionDiagnostics>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SubscriptionDiagnostics>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/hooks/models.rs b/azure_devops_rust_api/src/hooks/models.rs index b5c68b33..45b66880 100644 --- a/azure_devops_rust_api/src/hooks/models.rs +++ b/azure_devops_rust_api/src/hooks/models.rs @@ -8,1747 +8,1745 @@ use std::str::FromStr; #[doc = "Defines the data contract of a consumer."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Consumer { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Gets this consumer's actions."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub actions: Vec<ConsumerAction>, - #[doc = "Gets or sets this consumer's authentication type."] - #[serde( - rename = "authenticationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub authentication_type: Option<consumer::AuthenticationType>, - #[doc = "Gets or sets this consumer's localized description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Describes how to configure a subscription that is managed externally."] - #[serde( - rename = "externalConfiguration", - default, - skip_serializing_if = "Option::is_none" - )] - pub external_configuration: Option<ExternalConfigurationDescriptor>, - #[doc = "Gets or sets this consumer's identifier."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Gets or sets this consumer's image URL, if any."] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Gets or sets this consumer's information URL, if any."] - #[serde( - rename = "informationUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub information_url: Option<String>, - #[doc = "Gets or sets this consumer's input descriptors."] - #[serde( - rename = "inputDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_descriptors: Vec<InputDescriptor>, - #[doc = "Gets or sets this consumer's localized name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The url for this resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Gets this consumer's actions."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub actions: Vec<ConsumerAction>, + #[doc = "Gets or sets this consumer's authentication type."] + #[serde( + rename = "authenticationType", + default, + skip_serializing_if = "Option::is_none" + )] + pub authentication_type: Option<consumer::AuthenticationType>, + #[doc = "Gets or sets this consumer's localized description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Describes how to configure a subscription that is managed externally."] + #[serde( + rename = "externalConfiguration", + default, + skip_serializing_if = "Option::is_none" + )] + pub external_configuration: Option<ExternalConfigurationDescriptor>, + #[doc = "Gets or sets this consumer's identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Gets or sets this consumer's image URL, if any."] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Gets or sets this consumer's information URL, if any."] + #[serde( + rename = "informationUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub information_url: Option<String>, + #[doc = "Gets or sets this consumer's input descriptors."] + #[serde( + rename = "inputDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_descriptors: Vec<InputDescriptor>, + #[doc = "Gets or sets this consumer's localized name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The url for this resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Consumer { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod consumer { - use super::*; - #[doc = "Gets or sets this consumer's authentication type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AuthenticationType { - #[serde(rename = "none")] - None, - #[serde(rename = "oAuth")] - OAuth, - #[serde(rename = "external")] - External, - } + use super::*; + #[doc = "Gets or sets this consumer's authentication type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AuthenticationType { + #[serde(rename = "none")] + None, + #[serde(rename = "oAuth")] + OAuth, + #[serde(rename = "external")] + External, + } } #[doc = "Defines the data contract of a consumer action."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ConsumerAction { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Gets or sets the flag indicating if resource version can be overridden when creating or editing a subscription."] - #[serde( - rename = "allowResourceVersionOverride", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_resource_version_override: Option<bool>, - #[doc = "Gets or sets the identifier of the consumer to which this action belongs."] - #[serde( - rename = "consumerId", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_id: Option<String>, - #[doc = "Gets or sets this action's localized description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Gets or sets this action's identifier."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Gets or sets this action's input descriptors."] - #[serde( - rename = "inputDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_descriptors: Vec<InputDescriptor>, - #[doc = "Gets or sets this action's localized name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets this action's supported event identifiers."] - #[serde( - rename = "supportedEventTypes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub supported_event_types: Vec<String>, - #[doc = "Gets or sets this action's supported resource versions."] - #[serde( - rename = "supportedResourceVersions", - default, - skip_serializing_if = "Option::is_none" - )] - pub supported_resource_versions: Option<serde_json::Value>, - #[doc = "The url for this resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Gets or sets the flag indicating if resource version can be overridden when creating or editing a subscription."] + #[serde( + rename = "allowResourceVersionOverride", + default, + skip_serializing_if = "Option::is_none" + )] + pub allow_resource_version_override: Option<bool>, + #[doc = "Gets or sets the identifier of the consumer to which this action belongs."] + #[serde( + rename = "consumerId", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_id: Option<String>, + #[doc = "Gets or sets this action's localized description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Gets or sets this action's identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Gets or sets this action's input descriptors."] + #[serde( + rename = "inputDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_descriptors: Vec<InputDescriptor>, + #[doc = "Gets or sets this action's localized name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets this action's supported event identifiers."] + #[serde( + rename = "supportedEventTypes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub supported_event_types: Vec<String>, + #[doc = "Gets or sets this action's supported resource versions."] + #[serde( + rename = "supportedResourceVersions", + default, + skip_serializing_if = "Option::is_none" + )] + pub supported_resource_versions: Option<serde_json::Value>, + #[doc = "The url for this resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ConsumerAction { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ConsumerActionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ConsumerAction>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ConsumerAction>, } impl ConsumerActionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ConsumerList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Consumer>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Consumer>, } impl ConsumerList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Encapsulates the properties of an event."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Event { - #[doc = "Gets or sets the UTC-based date and time that this event was created."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Provides different formats of an event message"] - #[serde( - rename = "detailedMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub detailed_message: Option<FormattedEventMessage>, - #[doc = "Gets or sets the type of this event."] - #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] - pub event_type: Option<String>, - #[doc = "Gets or sets the unique identifier of this event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Provides different formats of an event message"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<FormattedEventMessage>, - #[doc = "Gets or sets the identifier of the publisher that raised this event."] - #[serde( - rename = "publisherId", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_id: Option<String>, - #[doc = "Gets or sets the data associated with this event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option<serde_json::Value>, - #[doc = "Gets or sets the resource containers."] - #[serde( - rename = "resourceContainers", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_containers: Option<serde_json::Value>, - #[doc = "Gets or sets the version of the data associated with this event."] - #[serde( - rename = "resourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_version: Option<String>, - #[doc = "Represents a session token to be attached in Events for Consumer actions that need it."] - #[serde( - rename = "sessionToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub session_token: Option<SessionToken>, + #[doc = "Gets or sets the UTC-based date and time that this event was created."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Provides different formats of an event message"] + #[serde( + rename = "detailedMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub detailed_message: Option<FormattedEventMessage>, + #[doc = "Gets or sets the type of this event."] + #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] + pub event_type: Option<String>, + #[doc = "Gets or sets the unique identifier of this event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Provides different formats of an event message"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<FormattedEventMessage>, + #[doc = "Gets or sets the identifier of the publisher that raised this event."] + #[serde( + rename = "publisherId", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_id: Option<String>, + #[doc = "Gets or sets the data associated with this event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option<serde_json::Value>, + #[doc = "Gets or sets the resource containers."] + #[serde( + rename = "resourceContainers", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_containers: Option<serde_json::Value>, + #[doc = "Gets or sets the version of the data associated with this event."] + #[serde( + rename = "resourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_version: Option<String>, + #[doc = "Represents a session token to be attached in Events for Consumer actions that need it."] + #[serde( + rename = "sessionToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub session_token: Option<SessionToken>, } impl Event { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a type of event"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventTypeDescriptor { - #[doc = "A localized description of the event type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "A unique id for the event type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Event-specific inputs"] - #[serde( - rename = "inputDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_descriptors: Vec<InputDescriptor>, - #[doc = "A localized friendly name for the event type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "A unique id for the publisher of this event type"] - #[serde( - rename = "publisherId", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_id: Option<String>, - #[doc = "Supported versions for the event's resource payloads."] - #[serde( - rename = "supportedResourceVersions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub supported_resource_versions: Vec<String>, - #[doc = "The url for this resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "A localized description of the event type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "A unique id for the event type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Event-specific inputs"] + #[serde( + rename = "inputDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_descriptors: Vec<InputDescriptor>, + #[doc = "A localized friendly name for the event type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "A unique id for the publisher of this event type"] + #[serde( + rename = "publisherId", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_id: Option<String>, + #[doc = "Supported versions for the event's resource payloads."] + #[serde( + rename = "supportedResourceVersions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub supported_resource_versions: Vec<String>, + #[doc = "The url for this resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl EventTypeDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EventTypeDescriptorList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<EventTypeDescriptor>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<EventTypeDescriptor>, } impl EventTypeDescriptorList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes how to configure a subscription that is managed externally."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalConfigurationDescriptor { - #[doc = "Url of the site to create this type of subscription."] - #[serde( - rename = "createSubscriptionUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub create_subscription_url: Option<String>, - #[doc = "The name of an input property that contains the URL to edit a subscription."] - #[serde( - rename = "editSubscriptionPropertyName", - default, - skip_serializing_if = "Option::is_none" - )] - pub edit_subscription_property_name: Option<String>, - #[doc = "True if the external configuration applies only to hosted."] - #[serde( - rename = "hostedOnly", - default, - skip_serializing_if = "Option::is_none" - )] - pub hosted_only: Option<bool>, + #[doc = "Url of the site to create this type of subscription."] + #[serde( + rename = "createSubscriptionUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub create_subscription_url: Option<String>, + #[doc = "The name of an input property that contains the URL to edit a subscription."] + #[serde( + rename = "editSubscriptionPropertyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub edit_subscription_property_name: Option<String>, + #[doc = "True if the external configuration applies only to hosted."] + #[serde( + rename = "hostedOnly", + default, + skip_serializing_if = "Option::is_none" + )] + pub hosted_only: Option<bool>, } impl ExternalConfigurationDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Provides different formats of an event message"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FormattedEventMessage { - #[doc = "Gets or sets the html format of the message"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub html: Option<String>, - #[doc = "Gets or sets the markdown format of the message"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub markdown: Option<String>, - #[doc = "Gets or sets the raw text of the message"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, + #[doc = "Gets or sets the html format of the message"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub html: Option<String>, + #[doc = "Gets or sets the markdown format of the message"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub markdown: Option<String>, + #[doc = "Gets or sets the raw text of the message"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, } impl FormattedEventMessage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, } + } } #[doc = "Describes an input for subscriptions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputDescriptor { - #[doc = "The ids of all inputs that the value of this input is dependent on."] - #[serde( - rename = "dependencyInputIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dependency_input_ids: Vec<String>, - #[doc = "Description of what this input is used for"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group."] - #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] - pub group_name: Option<String>, - #[doc = "If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change."] - #[serde( - rename = "hasDynamicValueInformation", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_dynamic_value_information: Option<bool>, - #[doc = "Identifier for the subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Mode in which the value of this input should be entered"] - #[serde(rename = "inputMode", default, skip_serializing_if = "Option::is_none")] - pub input_mode: Option<input_descriptor::InputMode>, - #[doc = "Gets whether this input is confidential, such as for a password or application key"] - #[serde( - rename = "isConfidential", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_confidential: Option<bool>, - #[doc = "Localized name which can be shown as a label for the subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Custom properties for the input which can be used by the service provider"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "Gets whether this input is included in the default generated action description."] - #[serde( - rename = "useInDefaultDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub use_in_default_description: Option<bool>, - #[doc = "Describes what values are valid for a subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub validation: Option<InputValidation>, - #[doc = "A hint for input value. It can be used in the UI as the input placeholder."] - #[serde(rename = "valueHint", default, skip_serializing_if = "Option::is_none")] - pub value_hint: Option<String>, - #[doc = "Information about the possible/allowed values for a given subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub values: Option<InputValues>, + #[doc = "The ids of all inputs that the value of this input is dependent on."] + #[serde( + rename = "dependencyInputIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dependency_input_ids: Vec<String>, + #[doc = "Description of what this input is used for"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group."] + #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] + pub group_name: Option<String>, + #[doc = "If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change."] + #[serde( + rename = "hasDynamicValueInformation", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_dynamic_value_information: Option<bool>, + #[doc = "Identifier for the subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Mode in which the value of this input should be entered"] + #[serde(rename = "inputMode", default, skip_serializing_if = "Option::is_none")] + pub input_mode: Option<input_descriptor::InputMode>, + #[doc = "Gets whether this input is confidential, such as for a password or application key"] + #[serde( + rename = "isConfidential", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_confidential: Option<bool>, + #[doc = "Localized name which can be shown as a label for the subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Custom properties for the input which can be used by the service provider"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "Gets whether this input is included in the default generated action description."] + #[serde( + rename = "useInDefaultDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub use_in_default_description: Option<bool>, + #[doc = "Describes what values are valid for a subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub validation: Option<InputValidation>, + #[doc = "A hint for input value. It can be used in the UI as the input placeholder."] + #[serde(rename = "valueHint", default, skip_serializing_if = "Option::is_none")] + pub value_hint: Option<String>, + #[doc = "Information about the possible/allowed values for a given subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option<InputValues>, } impl InputDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod input_descriptor { - use super::*; - #[doc = "Mode in which the value of this input should be entered"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum InputMode { - #[serde(rename = "none")] - None, - #[serde(rename = "textBox")] - TextBox, - #[serde(rename = "passwordBox")] - PasswordBox, - #[serde(rename = "combo")] - Combo, - #[serde(rename = "radioButtons")] - RadioButtons, - #[serde(rename = "checkBox")] - CheckBox, - #[serde(rename = "textArea")] - TextArea, - } + use super::*; + #[doc = "Mode in which the value of this input should be entered"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum InputMode { + #[serde(rename = "none")] + None, + #[serde(rename = "textBox")] + TextBox, + #[serde(rename = "passwordBox")] + PasswordBox, + #[serde(rename = "combo")] + Combo, + #[serde(rename = "radioButtons")] + RadioButtons, + #[serde(rename = "checkBox")] + CheckBox, + #[serde(rename = "textArea")] + TextArea, + } } #[doc = "Defines a filter for subscription inputs. The filter matches a set of inputs if any (one or more) of the groups evaluates to true."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputFilter { - #[doc = "Groups of input filter expressions. This filter matches a set of inputs if any (one or more) of the groups evaluates to true."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub conditions: Vec<InputFilterCondition>, + #[doc = "Groups of input filter expressions. This filter matches a set of inputs if any (one or more) of the groups evaluates to true."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub conditions: Vec<InputFilterCondition>, } impl InputFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An expression which can be applied to filter a list of subscription inputs"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputFilterCondition { - #[doc = "Whether or not to do a case sensitive match"] - #[serde( - rename = "caseSensitive", - default, - skip_serializing_if = "Option::is_none" - )] - pub case_sensitive: Option<bool>, - #[doc = "The Id of the input to filter on"] - #[serde(rename = "inputId", default, skip_serializing_if = "Option::is_none")] - pub input_id: Option<String>, - #[doc = "The \"expected\" input value to compare with the actual input value"] - #[serde( - rename = "inputValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub input_value: Option<String>, - #[doc = "The operator applied between the expected and actual input value"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operator: Option<input_filter_condition::Operator>, + #[doc = "Whether or not to do a case sensitive match"] + #[serde( + rename = "caseSensitive", + default, + skip_serializing_if = "Option::is_none" + )] + pub case_sensitive: Option<bool>, + #[doc = "The Id of the input to filter on"] + #[serde(rename = "inputId", default, skip_serializing_if = "Option::is_none")] + pub input_id: Option<String>, + #[doc = "The \"expected\" input value to compare with the actual input value"] + #[serde( + rename = "inputValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub input_value: Option<String>, + #[doc = "The operator applied between the expected and actual input value"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option<input_filter_condition::Operator>, } impl InputFilterCondition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod input_filter_condition { - use super::*; - #[doc = "The operator applied between the expected and actual input value"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Operator { - #[serde(rename = "equals")] - Equals, - #[serde(rename = "notEquals")] - NotEquals, - } + use super::*; + #[doc = "The operator applied between the expected and actual input value"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Operator { + #[serde(rename = "equals")] + Equals, + #[serde(rename = "notEquals")] + NotEquals, + } } #[doc = "Describes what values are valid for a subscription input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValidation { - #[doc = "Gets or sets the data type to validate."] - #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] - pub data_type: Option<input_validation::DataType>, - #[doc = "Gets or sets if this is a required field."] - #[serde( - rename = "isRequired", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_required: Option<bool>, - #[doc = "Gets or sets the maximum length of this descriptor."] - #[serde(rename = "maxLength", default, skip_serializing_if = "Option::is_none")] - pub max_length: Option<i32>, - #[doc = "Gets or sets the minimum value for this descriptor."] - #[serde(rename = "maxValue", default, skip_serializing_if = "Option::is_none")] - pub max_value: Option<f32>, - #[doc = "Gets or sets the minimum length of this descriptor."] - #[serde(rename = "minLength", default, skip_serializing_if = "Option::is_none")] - pub min_length: Option<i32>, - #[doc = "Gets or sets the minimum value for this descriptor."] - #[serde(rename = "minValue", default, skip_serializing_if = "Option::is_none")] - pub min_value: Option<f32>, - #[doc = "Gets or sets the pattern to validate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pattern: Option<String>, - #[doc = "Gets or sets the error on pattern mismatch."] - #[serde( - rename = "patternMismatchErrorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub pattern_mismatch_error_message: Option<String>, + #[doc = "Gets or sets the data data type to validate."] + #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] + pub data_type: Option<input_validation::DataType>, + #[doc = "Gets or sets if this is a required field."] + #[serde( + rename = "isRequired", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_required: Option<bool>, + #[doc = "Gets or sets the maximum length of this descriptor."] + #[serde(rename = "maxLength", default, skip_serializing_if = "Option::is_none")] + pub max_length: Option<i32>, + #[doc = "Gets or sets the minimum value for this descriptor."] + #[serde(rename = "maxValue", default, skip_serializing_if = "Option::is_none")] + pub max_value: Option<f32>, + #[doc = "Gets or sets the minimum length of this descriptor."] + #[serde(rename = "minLength", default, skip_serializing_if = "Option::is_none")] + pub min_length: Option<i32>, + #[doc = "Gets or sets the minimum value for this descriptor."] + #[serde(rename = "minValue", default, skip_serializing_if = "Option::is_none")] + pub min_value: Option<f32>, + #[doc = "Gets or sets the pattern to validate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pattern: Option<String>, + #[doc = "Gets or sets the error on pattern mismatch."] + #[serde( + rename = "patternMismatchErrorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub pattern_mismatch_error_message: Option<String>, } impl InputValidation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod input_validation { - use super::*; - #[doc = "Gets or sets the data type to validate."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DataType { - #[serde(rename = "none")] - None, - #[serde(rename = "string")] - String, - #[serde(rename = "number")] - Number, - #[serde(rename = "boolean")] - Boolean, - #[serde(rename = "guid")] - Guid, - #[serde(rename = "uri")] - Uri, - } + use super::*; + #[doc = "Gets or sets the data data type to validate."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DataType { + #[serde(rename = "none")] + None, + #[serde(rename = "string")] + String, + #[serde(rename = "number")] + Number, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "guid")] + Guid, + #[serde(rename = "uri")] + Uri, + } } #[doc = "Information about a single value for an input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValue { - #[doc = "Any other data about this input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "The text to show for the display of this value"] - #[serde( - rename = "displayValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_value: Option<String>, - #[doc = "The value to store for this input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Any other data about this input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "The text to show for the display of this value"] + #[serde( + rename = "displayValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_value: Option<String>, + #[doc = "The value to store for this input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl InputValue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Information about the possible/allowed values for a given subscription input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValues { - #[doc = "The default value to use for this input"] - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<String>, - #[doc = "Error information related to a subscription input value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option<InputValuesError>, - #[doc = "The id of the input"] - #[serde(rename = "inputId", default, skip_serializing_if = "Option::is_none")] - pub input_id: Option<String>, - #[doc = "Should this input be disabled"] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False)"] - #[serde( - rename = "isLimitedToPossibleValues", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_limited_to_possible_values: Option<bool>, - #[doc = "Should this input be made read-only"] - #[serde( - rename = "isReadOnly", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_read_only: Option<bool>, - #[doc = "Possible values that this input can take"] - #[serde( - rename = "possibleValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub possible_values: Vec<InputValue>, + #[doc = "The default value to use for this input"] + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<String>, + #[doc = "Error information related to a subscription input value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option<InputValuesError>, + #[doc = "The id of the input"] + #[serde(rename = "inputId", default, skip_serializing_if = "Option::is_none")] + pub input_id: Option<String>, + #[doc = "Should this input be disabled"] + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[doc = "Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False)"] + #[serde( + rename = "isLimitedToPossibleValues", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_limited_to_possible_values: Option<bool>, + #[doc = "Should this input be made read-only"] + #[serde( + rename = "isReadOnly", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_read_only: Option<bool>, + #[doc = "Possible values that this input can take"] + #[serde( + rename = "possibleValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub possible_values: Vec<InputValue>, } impl InputValues { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Error information related to a subscription input value."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValuesError { - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, } impl InputValuesError { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValuesQuery { - #[serde( - rename = "currentValues", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_values: Option<serde_json::Value>, - #[doc = "The input values to return on input, and the result from the consumer on output."] - #[serde( - rename = "inputValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_values: Vec<InputValues>, - #[doc = "Subscription containing information about the publisher/consumer and the current input values"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option<serde_json::Value>, + #[serde( + rename = "currentValues", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_values: Option<serde_json::Value>, + #[doc = "The input values to return on input, and the result from the consumer on output."] + #[serde( + rename = "inputValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_values: Vec<InputValues>, + #[doc = "Subscription containing information about the publisher/consumer and the current input values"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option<serde_json::Value>, } impl InputValuesQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the data contract of the result of processing an event for a subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Notification { - #[doc = "Gets or sets date and time that this result was created."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Defines the data contract of notification details."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub details: Option<NotificationDetails>, - #[doc = "The event id associated with this notification"] - #[serde(rename = "eventId", default, skip_serializing_if = "Option::is_none")] - pub event_id: Option<String>, - #[doc = "The notification id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Gets or sets date and time that this result was last modified."] - #[serde( - rename = "modifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_date: Option<time::OffsetDateTime>, - #[doc = "Result of the notification"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<notification::Result>, - #[doc = "Status of the notification"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<notification::Status>, - #[doc = "The subscriber Id associated with this notification. This is the last identity who touched in the subscription. In case of test notifications it can be the tester if the subscription is not created yet."] - #[serde( - rename = "subscriberId", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscriber_id: Option<String>, - #[doc = "The subscription id associated with this notification"] - #[serde( - rename = "subscriptionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_id: Option<String>, + #[doc = "Gets or sets date and time that this result was created."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Defines the data contract of notification details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub details: Option<NotificationDetails>, + #[doc = "The event id associated with this notification"] + #[serde(rename = "eventId", default, skip_serializing_if = "Option::is_none")] + pub event_id: Option<String>, + #[doc = "The notification id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Gets or sets date and time that this result was last modified."] + #[serde( + rename = "modifiedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_date: Option<time::OffsetDateTime>, + #[doc = "Result of the notification"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<notification::Result>, + #[doc = "Status of the notification"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<notification::Status>, + #[doc = "The subscriber Id associated with this notification. This is the last identity who touched in the subscription. In case of test notifications it can be the tester if the subscription is not created yet."] + #[serde( + rename = "subscriberId", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscriber_id: Option<String>, + #[doc = "The subscription id associated with this notification"] + #[serde( + rename = "subscriptionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_id: Option<String>, } impl Notification { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod notification { - use super::*; - #[doc = "Result of the notification"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "pending")] - Pending, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "filtered")] - Filtered, - } - #[doc = "Status of the notification"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "queued")] - Queued, - #[serde(rename = "processing")] - Processing, - #[serde(rename = "requestInProgress")] - RequestInProgress, - #[serde(rename = "completed")] - Completed, - } + use super::*; + #[doc = "Result of the notification"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "filtered")] + Filtered, + } + #[doc = "Status of the notification"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "queued")] + Queued, + #[serde(rename = "processing")] + Processing, + #[serde(rename = "requestInProgress")] + RequestInProgress, + #[serde(rename = "completed")] + Completed, + } } #[doc = "Defines the data contract of notification details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NotificationDetails { - #[doc = "Gets or sets the time that this notification was completed (response received from the consumer)"] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Gets or sets this notification detail's consumer action identifier."] - #[serde( - rename = "consumerActionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_action_id: Option<String>, - #[doc = "Gets or sets this notification detail's consumer identifier."] - #[serde( - rename = "consumerId", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_id: Option<String>, - #[doc = "Gets or sets this notification detail's consumer inputs."] - #[serde( - rename = "consumerInputs", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_inputs: Option<serde_json::Value>, - #[doc = "Gets or sets the time that this notification was dequeued for processing"] - #[serde( - rename = "dequeuedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub dequeued_date: Option<time::OffsetDateTime>, - #[doc = "Gets or sets this notification detail's error detail."] - #[serde( - rename = "errorDetail", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_detail: Option<String>, - #[doc = "Gets or sets this notification detail's error message."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "Encapsulates the properties of an event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub event: Option<Event>, - #[doc = "Gets or sets this notification detail's event type."] - #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] - pub event_type: Option<String>, - #[doc = "Gets or sets the time that this notification was finished processing (just before the request is sent to the consumer)"] - #[serde( - rename = "processedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub processed_date: Option<time::OffsetDateTime>, - #[doc = "Gets or sets this notification detail's publisher identifier."] - #[serde( - rename = "publisherId", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_id: Option<String>, - #[doc = "Gets or sets this notification detail's publisher inputs."] - #[serde( - rename = "publisherInputs", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_inputs: Option<serde_json::Value>, - #[doc = "Gets or sets the time that this notification was queued (created)"] - #[serde( - rename = "queuedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub queued_date: Option<time::OffsetDateTime>, - #[doc = "Gets or sets this notification detail's request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub request: Option<String>, - #[doc = "Number of requests attempted to be sent to the consumer"] - #[serde( - rename = "requestAttempts", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_attempts: Option<i32>, - #[doc = "Duration of the request to the consumer in seconds"] - #[serde( - rename = "requestDuration", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_duration: Option<f64>, - #[doc = "Gets or sets this notification detail's response."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub response: Option<String>, + #[doc = "Gets or sets the time that this notification was completed (response received from the consumer)"] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Gets or sets this notification detail's consumer action identifier."] + #[serde( + rename = "consumerActionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_action_id: Option<String>, + #[doc = "Gets or sets this notification detail's consumer identifier."] + #[serde( + rename = "consumerId", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_id: Option<String>, + #[doc = "Gets or sets this notification detail's consumer inputs."] + #[serde( + rename = "consumerInputs", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_inputs: Option<serde_json::Value>, + #[doc = "Gets or sets the time that this notification was dequeued for processing"] + #[serde( + rename = "dequeuedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub dequeued_date: Option<time::OffsetDateTime>, + #[doc = "Gets or sets this notification detail's error detail."] + #[serde( + rename = "errorDetail", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_detail: Option<String>, + #[doc = "Gets or sets this notification detail's error message."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "Encapsulates the properties of an event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub event: Option<Event>, + #[doc = "Gets or sets this notification detail's event type."] + #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] + pub event_type: Option<String>, + #[doc = "Gets or sets the time that this notification was finished processing (just before the request is sent to the consumer)"] + #[serde( + rename = "processedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub processed_date: Option<time::OffsetDateTime>, + #[doc = "Gets or sets this notification detail's publisher identifier."] + #[serde( + rename = "publisherId", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_id: Option<String>, + #[doc = "Gets or sets this notification detail's publisher inputs."] + #[serde( + rename = "publisherInputs", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_inputs: Option<serde_json::Value>, + #[doc = "Gets or sets the time that this notification was queued (created)"] + #[serde( + rename = "queuedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub queued_date: Option<time::OffsetDateTime>, + #[doc = "Gets or sets this notification detail's request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request: Option<String>, + #[doc = "Number of requests attempted to be sent to the consumer"] + #[serde( + rename = "requestAttempts", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_attempts: Option<i32>, + #[doc = "Duration of the request to the consumer in seconds"] + #[serde( + rename = "requestDuration", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_duration: Option<f64>, + #[doc = "Gets or sets this notification detail's response."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub response: Option<String>, } impl NotificationDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NotificationList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Notification>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Notification>, } impl NotificationList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Summary of a particular result and count."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NotificationResultsSummaryDetail { - #[doc = "Count of notification sent out with a matching result."] - #[serde( - rename = "notificationCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub notification_count: Option<i32>, - #[doc = "Result of the notification"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<notification_results_summary_detail::Result>, + #[doc = "Count of notification sent out with a matching result."] + #[serde( + rename = "notificationCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub notification_count: Option<i32>, + #[doc = "Result of the notification"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<notification_results_summary_detail::Result>, } impl NotificationResultsSummaryDetail { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod notification_results_summary_detail { - use super::*; - #[doc = "Result of the notification"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "pending")] - Pending, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "filtered")] - Filtered, - } + use super::*; + #[doc = "Result of the notification"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "filtered")] + Filtered, + } } #[doc = "Summary of the notifications for a subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NotificationSummary { - #[doc = "The notification results for this particular subscription."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<NotificationResultsSummaryDetail>, - #[doc = "The subscription id associated with this notification"] - #[serde( - rename = "subscriptionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_id: Option<String>, + #[doc = "The notification results for this particular subscription."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<NotificationResultsSummaryDetail>, + #[doc = "The subscription id associated with this notification"] + #[serde( + rename = "subscriptionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_id: Option<String>, } impl NotificationSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a query for service hook notifications."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NotificationsQuery { - #[doc = "The subscriptions associated with the notifications returned from the query"] - #[serde( - rename = "associatedSubscriptions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub associated_subscriptions: Vec<Subscription>, - #[doc = "If true, we will return all notification history for the query provided; otherwise, the summary is returned."] - #[serde( - rename = "includeDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_details: Option<bool>, - #[doc = "Optional maximum date at which the notification was created"] - #[serde( - rename = "maxCreatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub max_created_date: Option<time::OffsetDateTime>, - #[doc = "Optional maximum number of overall results to include"] - #[serde( - rename = "maxResults", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_results: Option<i32>, - #[doc = "Optional maximum number of results for each subscription. Only takes effect when a list of subscription ids is supplied in the query."] - #[serde( - rename = "maxResultsPerSubscription", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_results_per_subscription: Option<i32>, - #[doc = "Optional minimum date at which the notification was created"] - #[serde( - rename = "minCreatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub min_created_date: Option<time::OffsetDateTime>, - #[doc = "Optional publisher id to restrict the results to"] - #[serde( - rename = "publisherId", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_id: Option<String>, - #[doc = "Results from the query"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<Notification>, - #[doc = "Optional notification result type to filter results to"] - #[serde( - rename = "resultType", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_type: Option<notifications_query::ResultType>, - #[doc = "Optional notification status to filter results to"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<notifications_query::Status>, - #[doc = "Optional list of subscription ids to restrict the results to"] - #[serde( - rename = "subscriptionIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub subscription_ids: Vec<String>, - #[doc = "Summary of notifications - the count of each result type (success, fail, ..)."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub summary: Vec<NotificationSummary>, + #[doc = "The subscriptions associated with the notifications returned from the query"] + #[serde( + rename = "associatedSubscriptions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub associated_subscriptions: Vec<Subscription>, + #[doc = "If true, we will return all notification history for the query provided; otherwise, the summary is returned."] + #[serde( + rename = "includeDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_details: Option<bool>, + #[doc = "Optional maximum date at which the notification was created"] + #[serde( + rename = "maxCreatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub max_created_date: Option<time::OffsetDateTime>, + #[doc = "Optional maximum number of overall results to include"] + #[serde( + rename = "maxResults", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_results: Option<i32>, + #[doc = "Optional maximum number of results for each subscription. Only takes effect when a list of subscription ids is supplied in the query."] + #[serde( + rename = "maxResultsPerSubscription", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_results_per_subscription: Option<i32>, + #[doc = "Optional minimum date at which the notification was created"] + #[serde( + rename = "minCreatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub min_created_date: Option<time::OffsetDateTime>, + #[doc = "Optional publisher id to restrict the results to"] + #[serde( + rename = "publisherId", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_id: Option<String>, + #[doc = "Results from the query"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<Notification>, + #[doc = "Optional notification result type to filter results to"] + #[serde( + rename = "resultType", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_type: Option<notifications_query::ResultType>, + #[doc = "Optional notification status to filter results to"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<notifications_query::Status>, + #[doc = "Optional list of subscription ids to restrict the results to"] + #[serde( + rename = "subscriptionIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub subscription_ids: Vec<String>, + #[doc = "Summary of notifications - the count of each result type (success, fail, ..)."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub summary: Vec<NotificationSummary>, } impl NotificationsQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod notifications_query { - use super::*; - #[doc = "Optional notification result type to filter results to"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ResultType { - #[serde(rename = "pending")] - Pending, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "filtered")] - Filtered, - } - #[doc = "Optional notification status to filter results to"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "queued")] - Queued, - #[serde(rename = "processing")] - Processing, - #[serde(rename = "requestInProgress")] - RequestInProgress, - #[serde(rename = "completed")] - Completed, - } + use super::*; + #[doc = "Optional notification result type to filter results to"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ResultType { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "filtered")] + Filtered, + } + #[doc = "Optional notification status to filter results to"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "queued")] + Queued, + #[serde(rename = "processing")] + Processing, + #[serde(rename = "requestInProgress")] + RequestInProgress, + #[serde(rename = "completed")] + Completed, + } } #[doc = "Defines the data contract of an event publisher."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Publisher { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Gets this publisher's localized description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Gets this publisher's identifier."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Publisher-specific inputs"] - #[serde( - rename = "inputDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_descriptors: Vec<InputDescriptor>, - #[doc = "Gets this publisher's localized name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The service instance type of the first party publisher."] - #[serde( - rename = "serviceInstanceType", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_instance_type: Option<String>, - #[doc = "Gets this publisher's supported event types."] - #[serde( - rename = "supportedEvents", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub supported_events: Vec<EventTypeDescriptor>, - #[doc = "The url for this resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Gets this publisher's localized description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Gets this publisher's identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Publisher-specific inputs"] + #[serde( + rename = "inputDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_descriptors: Vec<InputDescriptor>, + #[doc = "Gets this publisher's localized name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The service instance type of the first party publisher."] + #[serde( + rename = "serviceInstanceType", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_instance_type: Option<String>, + #[doc = "Gets this publisher's supported event types."] + #[serde( + rename = "supportedEvents", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub supported_events: Vec<EventTypeDescriptor>, + #[doc = "The url for this resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Publisher { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Wrapper around an event which is being published"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PublisherEvent { - #[doc = "Add key/value pairs which will be stored with a published notification in the SH service DB. This key/value pairs are for diagnostic purposes only and will have not effect on the delivery of a notification."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub diagnostics: Option<serde_json::Value>, - #[doc = "Encapsulates the properties of an event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub event: Option<Event>, - #[doc = "Gets or sets flag for filtered events"] - #[serde( - rename = "isFilteredEvent", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_filtered_event: Option<bool>, - #[doc = "Additional data that needs to be sent as part of notification to complement the Resource data in the Event"] - #[serde( - rename = "notificationData", - default, - skip_serializing_if = "Option::is_none" - )] - pub notification_data: Option<serde_json::Value>, - #[doc = "Gets or sets the array of older supported resource versions."] - #[serde( - rename = "otherResourceVersions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub other_resource_versions: Vec<VersionedResource>, - #[doc = "Optional publisher-input filters which restricts the set of subscriptions which are triggered by the event"] - #[serde( - rename = "publisherInputFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub publisher_input_filters: Vec<InputFilter>, - #[doc = "Encapsulates an event subscription."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subscription: Option<Subscription>, + #[doc = "Add key/value pairs which will be stored with a published notification in the SH service DB. This key/value pairs are for diagnostic purposes only and will have not effect on the delivery of a notification."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub diagnostics: Option<serde_json::Value>, + #[doc = "Encapsulates the properties of an event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub event: Option<Event>, + #[doc = "Gets or sets flag for filtered events"] + #[serde( + rename = "isFilteredEvent", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_filtered_event: Option<bool>, + #[doc = "Additional data that needs to be sent as part of notification to complement the Resource data in the Event"] + #[serde( + rename = "notificationData", + default, + skip_serializing_if = "Option::is_none" + )] + pub notification_data: Option<serde_json::Value>, + #[doc = "Gets or sets the array of older supported resource versions."] + #[serde( + rename = "otherResourceVersions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub other_resource_versions: Vec<VersionedResource>, + #[doc = "Optional publisher-input filters which restricts the set of subscriptions which are triggered by the event"] + #[serde( + rename = "publisherInputFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub publisher_input_filters: Vec<InputFilter>, + #[doc = "Encapsulates an event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subscription: Option<Subscription>, } impl PublisherEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PublisherList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Publisher>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Publisher>, } impl PublisherList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a query for service hook publishers."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PublishersQuery { - #[doc = "Optional list of publisher ids to restrict the results to"] - #[serde( - rename = "publisherIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub publisher_ids: Vec<String>, - #[doc = "Filter for publisher inputs"] - #[serde( - rename = "publisherInputs", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_inputs: Option<serde_json::Value>, - #[doc = "Results from the query"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<Publisher>, + #[doc = "Optional list of publisher ids to restrict the results to"] + #[serde( + rename = "publisherIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub publisher_ids: Vec<String>, + #[doc = "Filter for publisher inputs"] + #[serde( + rename = "publisherInputs", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_inputs: Option<serde_json::Value>, + #[doc = "Results from the query"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<Publisher>, } impl PublishersQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The base class for all resource containers, i.e. Account, Collection, Project"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceContainer { - #[doc = "Gets or sets the container's base URL, i.e. the URL of the host (collection, application, or deployment) containing the container resource."] - #[serde(rename = "baseUrl", default, skip_serializing_if = "Option::is_none")] - pub base_url: Option<String>, - #[doc = "Gets or sets the container's specific Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Gets or sets the container's name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the container's REST API URL."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Gets or sets the container's base URL, i.e. the URL of the host (collection, application, or deployment) containing the container resource."] + #[serde(rename = "baseUrl", default, skip_serializing_if = "Option::is_none")] + pub base_url: Option<String>, + #[doc = "Gets or sets the container's specific Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Gets or sets the container's name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the container's REST API URL."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ResourceContainer { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a session token to be attached in Events for Consumer actions that need it."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SessionToken { - #[doc = "The error message in case of error"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option<String>, - #[doc = "The access token"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub token: Option<String>, - #[doc = "The expiration date in UTC"] - #[serde( - rename = "validTo", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub valid_to: Option<time::OffsetDateTime>, + #[doc = "The error message in case of error"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option<String>, + #[doc = "The access token"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option<String>, + #[doc = "The expiration date in UTC"] + #[serde( + rename = "validTo", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub valid_to: Option<time::OffsetDateTime>, } impl SessionToken { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Encapsulates an event subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Subscription { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[serde( - rename = "actionDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_description: Option<String>, - #[serde( - rename = "consumerActionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_action_id: Option<String>, - #[serde( - rename = "consumerId", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_id: Option<String>, - #[doc = "Consumer input values"] - #[serde( - rename = "consumerInputs", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_inputs: Option<serde_json::Value>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[serde( - rename = "eventDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub event_description: Option<String>, - #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] - pub event_type: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde( - rename = "lastProbationRetryDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_probation_retry_date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[serde( - rename = "modifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_date: Option<time::OffsetDateTime>, - #[serde( - rename = "probationRetries", - default, - skip_serializing_if = "Option::is_none" - )] - pub probation_retries: Option<i32>, - #[serde( - rename = "publisherId", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_id: Option<String>, - #[doc = "Publisher input values"] - #[serde( - rename = "publisherInputs", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_inputs: Option<serde_json::Value>, - #[serde( - rename = "resourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_version: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<subscription::Status>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subscriber: Option<IdentityRef>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[serde( + rename = "actionDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_description: Option<String>, + #[serde( + rename = "consumerActionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_action_id: Option<String>, + #[serde( + rename = "consumerId", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_id: Option<String>, + #[doc = "Consumer input values"] + #[serde( + rename = "consumerInputs", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_inputs: Option<serde_json::Value>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[serde( + rename = "eventDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub event_description: Option<String>, + #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] + pub event_type: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde( + rename = "lastProbationRetryDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_probation_retry_date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[serde( + rename = "modifiedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_date: Option<time::OffsetDateTime>, + #[serde( + rename = "probationRetries", + default, + skip_serializing_if = "Option::is_none" + )] + pub probation_retries: Option<i32>, + #[serde( + rename = "publisherId", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_id: Option<String>, + #[doc = "Publisher input values"] + #[serde( + rename = "publisherInputs", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_inputs: Option<serde_json::Value>, + #[serde( + rename = "resourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_version: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<subscription::Status>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subscriber: Option<IdentityRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Subscription { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod subscription { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "enabled")] - Enabled, - #[serde(rename = "onProbation")] - OnProbation, - #[serde(rename = "disabledByUser")] - DisabledByUser, - #[serde(rename = "disabledBySystem")] - DisabledBySystem, - #[serde(rename = "disabledByInactiveIdentity")] - DisabledByInactiveIdentity, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "enabled")] + Enabled, + #[serde(rename = "onProbation")] + OnProbation, + #[serde(rename = "disabledByUser")] + DisabledByUser, + #[serde(rename = "disabledBySystem")] + DisabledBySystem, + #[serde(rename = "disabledByInactiveIdentity")] + DisabledByInactiveIdentity, + } } #[doc = "Contains all the diagnostics settings for a subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SubscriptionDiagnostics { - #[doc = "Data controlling a single diagnostic setting for a subscription."] - #[serde( - rename = "deliveryResults", - default, - skip_serializing_if = "Option::is_none" - )] - pub delivery_results: Option<SubscriptionTracing>, - #[doc = "Data controlling a single diagnostic setting for a subscription."] - #[serde( - rename = "deliveryTracing", - default, - skip_serializing_if = "Option::is_none" - )] - pub delivery_tracing: Option<SubscriptionTracing>, - #[doc = "Data controlling a single diagnostic setting for a subscription."] - #[serde( - rename = "evaluationTracing", - default, - skip_serializing_if = "Option::is_none" - )] - pub evaluation_tracing: Option<SubscriptionTracing>, + #[doc = "Data controlling a single diagnostic setting for a subscription."] + #[serde( + rename = "deliveryResults", + default, + skip_serializing_if = "Option::is_none" + )] + pub delivery_results: Option<SubscriptionTracing>, + #[doc = "Data controlling a single diagnostic setting for a subscription."] + #[serde( + rename = "deliveryTracing", + default, + skip_serializing_if = "Option::is_none" + )] + pub delivery_tracing: Option<SubscriptionTracing>, + #[doc = "Data controlling a single diagnostic setting for a subscription."] + #[serde( + rename = "evaluationTracing", + default, + skip_serializing_if = "Option::is_none" + )] + pub evaluation_tracing: Option<SubscriptionTracing>, } impl SubscriptionDiagnostics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Query for obtaining information about the possible/allowed values for one or more subscription inputs"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SubscriptionInputValuesQuery { - #[doc = "The input values to return on input, and the result from the consumer on output."] - #[serde( - rename = "inputValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_values: Vec<InputValues>, - #[doc = "The scope at which the properties to query belong"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<subscription_input_values_query::Scope>, - #[doc = "Encapsulates an event subscription."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subscription: Option<Subscription>, + #[doc = "The input values to return on input, and the result from the consumer on output."] + #[serde( + rename = "inputValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_values: Vec<InputValues>, + #[doc = "The scope at which the properties to query belong"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<subscription_input_values_query::Scope>, + #[doc = "Encapsulates an event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subscription: Option<Subscription>, } impl SubscriptionInputValuesQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod subscription_input_values_query { - use super::*; - #[doc = "The scope at which the properties to query belong"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Scope { - #[serde(rename = "publisher")] - Publisher, - #[serde(rename = "consumer")] - Consumer, - } + use super::*; + #[doc = "The scope at which the properties to query belong"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Scope { + #[serde(rename = "publisher")] + Publisher, + #[serde(rename = "consumer")] + Consumer, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SubscriptionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Subscription>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Subscription>, } impl SubscriptionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data controlling a single diagnostic setting for a subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SubscriptionTracing { - #[doc = "Indicates whether the diagnostic tracing is enabled or not."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[doc = "Trace until the specified end date."] - #[serde( - rename = "endDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub end_date: Option<time::OffsetDateTime>, - #[doc = "The maximum number of result details to trace."] - #[serde( - rename = "maxTracedEntries", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_traced_entries: Option<i32>, - #[doc = "The date and time tracing started."] - #[serde( - rename = "startDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_date: Option<time::OffsetDateTime>, - #[doc = "Trace until remaining count reaches 0."] - #[serde( - rename = "tracedEntries", - default, - skip_serializing_if = "Option::is_none" - )] - pub traced_entries: Option<i32>, + #[doc = "Indicates whether the diagnostic tracing is enabled or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[doc = "Trace until the specified end date."] + #[serde( + rename = "endDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub end_date: Option<time::OffsetDateTime>, + #[doc = "The maximum number of result details to trace."] + #[serde( + rename = "maxTracedEntries", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_traced_entries: Option<i32>, + #[doc = "The date and time tracing started."] + #[serde( + rename = "startDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_date: Option<time::OffsetDateTime>, + #[doc = "Trace until remaining count reaches 0."] + #[serde( + rename = "tracedEntries", + default, + skip_serializing_if = "Option::is_none" + )] + pub traced_entries: Option<i32>, } impl SubscriptionTracing { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a query for service hook subscriptions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SubscriptionsQuery { - #[doc = "Optional consumer action id to restrict the results to (null for any)"] - #[serde( - rename = "consumerActionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_action_id: Option<String>, - #[doc = "Optional consumer id to restrict the results to (null for any)"] - #[serde( - rename = "consumerId", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_id: Option<String>, - #[doc = "Filter for subscription consumer inputs"] - #[serde( - rename = "consumerInputFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub consumer_input_filters: Vec<InputFilter>, - #[doc = "Optional event type id to restrict the results to (null for any)"] - #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] - pub event_type: Option<String>, - #[doc = "Optional publisher id to restrict the results to (null for any)"] - #[serde( - rename = "publisherId", - default, - skip_serializing_if = "Option::is_none" - )] - pub publisher_id: Option<String>, - #[doc = "Filter for subscription publisher inputs"] - #[serde( - rename = "publisherInputFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub publisher_input_filters: Vec<InputFilter>, - #[doc = "Results from the query"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<Subscription>, - #[doc = "Optional subscriber filter."] - #[serde( - rename = "subscriberId", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscriber_id: Option<String>, + #[doc = "Optional consumer action id to restrict the results to (null for any)"] + #[serde( + rename = "consumerActionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_action_id: Option<String>, + #[doc = "Optional consumer id to restrict the results to (null for any)"] + #[serde( + rename = "consumerId", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_id: Option<String>, + #[doc = "Filter for subscription consumer inputs"] + #[serde( + rename = "consumerInputFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub consumer_input_filters: Vec<InputFilter>, + #[doc = "Optional event type id to restrict the results to (null for any)"] + #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] + pub event_type: Option<String>, + #[doc = "Optional publisher id to restrict the results to (null for any)"] + #[serde( + rename = "publisherId", + default, + skip_serializing_if = "Option::is_none" + )] + pub publisher_id: Option<String>, + #[doc = "Filter for subscription publisher inputs"] + #[serde( + rename = "publisherInputFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub publisher_input_filters: Vec<InputFilter>, + #[doc = "Results from the query"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<Subscription>, + #[doc = "Optional subscriber filter."] + #[serde( + rename = "subscriberId", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscriber_id: Option<String>, } impl SubscriptionsQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Parameters to update diagnostics settings for a subscription."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateSubscripitonDiagnosticsParameters { - #[doc = "Parameters to update a specific diagnostic setting."] - #[serde( - rename = "deliveryResults", - default, - skip_serializing_if = "Option::is_none" - )] - pub delivery_results: Option<UpdateSubscripitonTracingParameters>, - #[doc = "Parameters to update a specific diagnostic setting."] - #[serde( - rename = "deliveryTracing", - default, - skip_serializing_if = "Option::is_none" - )] - pub delivery_tracing: Option<UpdateSubscripitonTracingParameters>, - #[doc = "Parameters to update a specific diagnostic setting."] - #[serde( - rename = "evaluationTracing", - default, - skip_serializing_if = "Option::is_none" - )] - pub evaluation_tracing: Option<UpdateSubscripitonTracingParameters>, + #[doc = "Parameters to update a specific diagnostic setting."] + #[serde( + rename = "deliveryResults", + default, + skip_serializing_if = "Option::is_none" + )] + pub delivery_results: Option<UpdateSubscripitonTracingParameters>, + #[doc = "Parameters to update a specific diagnostic setting."] + #[serde( + rename = "deliveryTracing", + default, + skip_serializing_if = "Option::is_none" + )] + pub delivery_tracing: Option<UpdateSubscripitonTracingParameters>, + #[doc = "Parameters to update a specific diagnostic setting."] + #[serde( + rename = "evaluationTracing", + default, + skip_serializing_if = "Option::is_none" + )] + pub evaluation_tracing: Option<UpdateSubscripitonTracingParameters>, } impl UpdateSubscripitonDiagnosticsParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Parameters to update a specific diagnostic setting."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateSubscripitonTracingParameters { - #[doc = "Indicates whether to enable to disable the diagnostic tracing."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, + #[doc = "Indicates whether to enable to disable the diagnostic tracing."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, } impl UpdateSubscripitonTracingParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Encapsulates the resource version and its data or reference to the compatible version. Only one of the two last fields should be not null."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VersionedResource { - #[doc = "Gets or sets the reference to the compatible version."] - #[serde( - rename = "compatibleWith", - default, - skip_serializing_if = "Option::is_none" - )] - pub compatible_with: Option<String>, - #[doc = "Gets or sets the resource data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option<serde_json::Value>, - #[doc = "Gets or sets the version of the resource data."] - #[serde( - rename = "resourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_version: Option<String>, + #[doc = "Gets or sets the reference to the compatible version."] + #[serde( + rename = "compatibleWith", + default, + skip_serializing_if = "Option::is_none" + )] + pub compatible_with: Option<String>, + #[doc = "Gets or sets the resource data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option<serde_json::Value>, + #[doc = "Gets or sets the version of the resource data."] + #[serde( + rename = "resourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_version: Option<String>, } impl VersionedResource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/ims/mod.rs b/azure_devops_rust_api/src/ims/mod.rs index 65c061b1..7c0733b6 100644 --- a/azure_devops_rust_api/src/ims/mod.rs +++ b/azure_devops_rust_api/src/ims/mod.rs @@ -9,312 +9,319 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://vssps.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self - } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self - } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self - } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self - } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } } impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await + } + pub fn identities_client(&self) -> identities::Client { + identities::Client(self.clone()) + } +} +pub mod identities { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn read_identities( + &self, + organization: impl Into<String>, + ) -> 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, + } } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) + } + pub mod read_identities { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::IdentityList> { + let bytes = self.0.into_body().collect().await?; + let body: models::IdentityList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn identities_client(&self) -> identities::Client { - identities::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } -} -pub mod identities { - use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn read_identities( - &self, - organization: impl Into<String>, - ) -> 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, - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) descriptors: Option<String>, + pub(crate) identity_ids: Option<String>, + pub(crate) subject_descriptors: Option<String>, + pub(crate) search_filter: Option<String>, + pub(crate) filter_value: Option<String>, + pub(crate) query_membership: Option<String>, } - pub mod read_identities { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::IdentityList> { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) descriptors: Option<String>, - pub(crate) identity_ids: Option<String>, - pub(crate) subject_descriptors: Option<String>, - pub(crate) search_filter: Option<String>, - pub(crate) filter_value: Option<String>, - pub(crate) query_membership: Option<String>, - } - impl RequestBuilder { - #[doc = "A comma separated list of identity descriptors to resolve"] - pub fn descriptors(mut self, descriptors: impl Into<String>) -> Self { - self.descriptors = Some(descriptors.into()); - self - } - #[doc = "A comma seperated list of storage keys to resolve"] - pub fn identity_ids(mut self, identity_ids: impl Into<String>) -> Self { - self.identity_ids = Some(identity_ids.into()); - self + impl RequestBuilder { + #[doc = "A comma separated list of identity descriptors to resolve"] + pub fn descriptors(mut self, descriptors: impl Into<String>) -> Self { + self.descriptors = Some(descriptors.into()); + self + } + #[doc = "A comma seperated list of storage keys to resolve"] + pub fn identity_ids(mut self, identity_ids: impl Into<String>) -> Self { + self.identity_ids = Some(identity_ids.into()); + self + } + #[doc = "A comma seperated list of subject descriptors to resolve"] + pub fn subject_descriptors(mut self, subject_descriptors: impl Into<String>) -> Self { + self.subject_descriptors = Some(subject_descriptors.into()); + self + } + #[doc = "The type of search to perform. Values can be AccountName (domain\\alias), DisplayName, MailAddress, General (display name, account name, or unique name), or LocalGroupName (only search Azure Devops groups)."] + pub fn search_filter(mut self, search_filter: impl Into<String>) -> Self { + self.search_filter = Some(search_filter.into()); + self + } + #[doc = "The search value, as specified by the searchFilter."] + pub fn filter_value(mut self, filter_value: impl Into<String>) -> Self { + self.filter_value = Some(filter_value.into()); + self + } + #[doc = "The membership information to include with the identities. Values can be None for no membership data or Direct to include the groups that the identity is a member of and the identities that are a member of this identity (groups only)"] + pub fn query_membership(mut self, query_membership: impl Into<String>) -> Self { + self.query_membership = Some(query_membership.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/identities", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); } - #[doc = "A comma seperated list of subject descriptors to resolve"] - pub fn subject_descriptors(mut self, subject_descriptors: impl Into<String>) -> Self { - self.subject_descriptors = Some(subject_descriptors.into()); - self + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(descriptors) = &this.descriptors { + req + .url_mut() + .query_pairs_mut() + .append_pair("descriptors", descriptors); } - #[doc = "The type of search to perform. Values can be AccountName (domain\\alias), DisplayName, MailAddress, General (display name, account name, or unique name), or LocalGroupName (only search Azure Devops groups)."] - pub fn search_filter(mut self, search_filter: impl Into<String>) -> Self { - self.search_filter = Some(search_filter.into()); - self + if let Some(identity_ids) = &this.identity_ids { + req + .url_mut() + .query_pairs_mut() + .append_pair("identityIds", identity_ids); } - #[doc = "The search value, as specified by the searchFilter."] - pub fn filter_value(mut self, filter_value: impl Into<String>) -> Self { - self.filter_value = Some(filter_value.into()); - self + if let Some(subject_descriptors) = &this.subject_descriptors { + req + .url_mut() + .query_pairs_mut() + .append_pair("subjectDescriptors", subject_descriptors); } - #[doc = "The membership information to include with the identities. Values can be None for no membership data or Direct to include the groups that the identity is a member of and the identities that are a member of this identity (groups only)"] - pub fn query_membership(mut self, query_membership: impl Into<String>) -> Self { - self.query_membership = Some(query_membership.into()); - self + if let Some(search_filter) = &this.search_filter { + req + .url_mut() + .query_pairs_mut() + .append_pair("searchFilter", search_filter); } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/identities", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + if let Some(filter_value) = &this.filter_value { + req + .url_mut() + .query_pairs_mut() + .append_pair("filterValue", filter_value); } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::IdentityList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::IdentityList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + if let Some(query_membership) = &this.query_membership { + req + .url_mut() + .query_pairs_mut() + .append_pair("queryMembership", query_membership); } - } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::IdentityList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::IdentityList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/ims/models.rs b/azure_devops_rust_api/src/ims/models.rs index 237cdd1c..4e0a9b56 100644 --- a/azure_devops_rust_api/src/ims/models.rs +++ b/azure_devops_rust_api/src/ims/models.rs @@ -8,921 +8,919 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessTokenResult { - #[doc = ""] - #[serde( - rename = "accessToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub access_token: Option<JsonWebToken>, - #[serde( - rename = "accessTokenError", - default, - skip_serializing_if = "Option::is_none" - )] - pub access_token_error: Option<access_token_result::AccessTokenError>, - #[serde( - rename = "authorizationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_id: Option<String>, - #[serde( - rename = "errorDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_description: Option<String>, - #[serde(rename = "hasError", default, skip_serializing_if = "Option::is_none")] - pub has_error: Option<bool>, - #[serde( - rename = "isFirstPartyClient", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_first_party_client: Option<bool>, - #[doc = ""] - #[serde( - rename = "refreshToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub refresh_token: Option<RefreshTokenGrant>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, - #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] - pub token_type: Option<String>, - #[serde( - rename = "validTo", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub valid_to: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "accessToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub access_token: Option<JsonWebToken>, + #[serde( + rename = "accessTokenError", + default, + skip_serializing_if = "Option::is_none" + )] + pub access_token_error: Option<access_token_result::AccessTokenError>, + #[serde( + rename = "authorizationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorization_id: Option<String>, + #[serde( + rename = "errorDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_description: Option<String>, + #[serde(rename = "hasError", default, skip_serializing_if = "Option::is_none")] + pub has_error: Option<bool>, + #[serde( + rename = "isFirstPartyClient", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_first_party_client: Option<bool>, + #[doc = ""] + #[serde( + rename = "refreshToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub refresh_token: Option<RefreshTokenGrant>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, + #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] + pub token_type: Option<String>, + #[serde( + rename = "validTo", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub valid_to: Option<time::OffsetDateTime>, } impl AccessTokenResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod access_token_result { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AccessTokenError { - #[serde(rename = "none")] - None, - #[serde(rename = "grantTypeRequired")] - GrantTypeRequired, - #[serde(rename = "authorizationGrantRequired")] - AuthorizationGrantRequired, - #[serde(rename = "clientSecretRequired")] - ClientSecretRequired, - #[serde(rename = "redirectUriRequired")] - RedirectUriRequired, - #[serde(rename = "invalidAuthorizationGrant")] - InvalidAuthorizationGrant, - #[serde(rename = "invalidAuthorizationScopes")] - InvalidAuthorizationScopes, - #[serde(rename = "invalidRefreshToken")] - InvalidRefreshToken, - #[serde(rename = "authorizationNotFound")] - AuthorizationNotFound, - #[serde(rename = "authorizationGrantExpired")] - AuthorizationGrantExpired, - #[serde(rename = "accessAlreadyIssued")] - AccessAlreadyIssued, - #[serde(rename = "invalidRedirectUri")] - InvalidRedirectUri, - #[serde(rename = "accessTokenNotFound")] - AccessTokenNotFound, - #[serde(rename = "invalidAccessToken")] - InvalidAccessToken, - #[serde(rename = "accessTokenAlreadyRefreshed")] - AccessTokenAlreadyRefreshed, - #[serde(rename = "invalidClientSecret")] - InvalidClientSecret, - #[serde(rename = "clientSecretExpired")] - ClientSecretExpired, - #[serde(rename = "serverError")] - ServerError, - #[serde(rename = "accessDenied")] - AccessDenied, - #[serde(rename = "accessTokenKeyRequired")] - AccessTokenKeyRequired, - #[serde(rename = "invalidAccessTokenKey")] - InvalidAccessTokenKey, - #[serde(rename = "failedToGetAccessToken")] - FailedToGetAccessToken, - #[serde(rename = "invalidClientId")] - InvalidClientId, - #[serde(rename = "invalidClient")] - InvalidClient, - #[serde(rename = "invalidValidTo")] - InvalidValidTo, - #[serde(rename = "invalidUserId")] - InvalidUserId, - #[serde(rename = "failedToIssueAccessToken")] - FailedToIssueAccessToken, - #[serde(rename = "authorizationGrantScopeMissing")] - AuthorizationGrantScopeMissing, - #[serde(rename = "invalidPublicAccessTokenKey")] - InvalidPublicAccessTokenKey, - #[serde(rename = "invalidPublicAccessToken")] - InvalidPublicAccessToken, - #[serde(rename = "publicFeatureFlagNotEnabled")] - PublicFeatureFlagNotEnabled, - #[serde(rename = "sshPolicyDisabled")] - SshPolicyDisabled, - #[serde(rename = "hostAuthorizationNotFound")] - HostAuthorizationNotFound, - #[serde(rename = "hostAuthorizationIsNotValid")] - HostAuthorizationIsNotValid, - #[serde(rename = "invalidScope")] - InvalidScope, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AccessTokenError { + #[serde(rename = "none")] + None, + #[serde(rename = "grantTypeRequired")] + GrantTypeRequired, + #[serde(rename = "authorizationGrantRequired")] + AuthorizationGrantRequired, + #[serde(rename = "clientSecretRequired")] + ClientSecretRequired, + #[serde(rename = "redirectUriRequired")] + RedirectUriRequired, + #[serde(rename = "invalidAuthorizationGrant")] + InvalidAuthorizationGrant, + #[serde(rename = "invalidAuthorizationScopes")] + InvalidAuthorizationScopes, + #[serde(rename = "invalidRefreshToken")] + InvalidRefreshToken, + #[serde(rename = "authorizationNotFound")] + AuthorizationNotFound, + #[serde(rename = "authorizationGrantExpired")] + AuthorizationGrantExpired, + #[serde(rename = "accessAlreadyIssued")] + AccessAlreadyIssued, + #[serde(rename = "invalidRedirectUri")] + InvalidRedirectUri, + #[serde(rename = "accessTokenNotFound")] + AccessTokenNotFound, + #[serde(rename = "invalidAccessToken")] + InvalidAccessToken, + #[serde(rename = "accessTokenAlreadyRefreshed")] + AccessTokenAlreadyRefreshed, + #[serde(rename = "invalidClientSecret")] + InvalidClientSecret, + #[serde(rename = "clientSecretExpired")] + ClientSecretExpired, + #[serde(rename = "serverError")] + ServerError, + #[serde(rename = "accessDenied")] + AccessDenied, + #[serde(rename = "accessTokenKeyRequired")] + AccessTokenKeyRequired, + #[serde(rename = "invalidAccessTokenKey")] + InvalidAccessTokenKey, + #[serde(rename = "failedToGetAccessToken")] + FailedToGetAccessToken, + #[serde(rename = "invalidClientId")] + InvalidClientId, + #[serde(rename = "invalidClient")] + InvalidClient, + #[serde(rename = "invalidValidTo")] + InvalidValidTo, + #[serde(rename = "invalidUserId")] + InvalidUserId, + #[serde(rename = "failedToIssueAccessToken")] + FailedToIssueAccessToken, + #[serde(rename = "authorizationGrantScopeMissing")] + AuthorizationGrantScopeMissing, + #[serde(rename = "invalidPublicAccessTokenKey")] + InvalidPublicAccessTokenKey, + #[serde(rename = "invalidPublicAccessToken")] + InvalidPublicAccessToken, + #[serde(rename = "publicFeatureFlagNotEnabled")] + PublicFeatureFlagNotEnabled, + #[serde(rename = "sshPolicyDisabled")] + SshPolicyDisabled, + #[serde(rename = "hostAuthorizationNotFound")] + HostAuthorizationNotFound, + #[serde(rename = "hostAuthorizationIsNotValid")] + HostAuthorizationIsNotValid, + #[serde(rename = "invalidScope")] + InvalidScope, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuthorizationGrant { - #[serde(rename = "grantType", default, skip_serializing_if = "Option::is_none")] - pub grant_type: Option<authorization_grant::GrantType>, + #[serde(rename = "grantType", default, skip_serializing_if = "Option::is_none")] + pub grant_type: Option<authorization_grant::GrantType>, } impl AuthorizationGrant { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod authorization_grant { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum GrantType { - #[serde(rename = "none")] - None, - #[serde(rename = "jwtBearer")] - JwtBearer, - #[serde(rename = "refreshToken")] - RefreshToken, - #[serde(rename = "implicit")] - Implicit, - #[serde(rename = "clientCredentials")] - ClientCredentials, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum GrantType { + #[serde(rename = "none")] + None, + #[serde(rename = "jwtBearer")] + JwtBearer, + #[serde(rename = "refreshToken")] + RefreshToken, + #[serde(rename = "implicit")] + Implicit, + #[serde(rename = "clientCredentials")] + ClientCredentials, + } } #[doc = "Container class for changed identities"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChangedIdentities { - #[doc = "Changed Identities"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub identities: Vec<Identity>, - #[doc = "More data available, set to true if pagesize is specified."] - #[serde(rename = "moreData", default, skip_serializing_if = "Option::is_none")] - pub more_data: Option<bool>, - #[doc = "Context class for changed identities"] - #[serde( - rename = "sequenceContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub sequence_context: Option<ChangedIdentitiesContext>, + #[doc = "Changed Identities"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub identities: Vec<Identity>, + #[doc = "More data available, set to true if pagesize is specified."] + #[serde(rename = "moreData", default, skip_serializing_if = "Option::is_none")] + pub more_data: Option<bool>, + #[doc = "Context class for changed identities"] + #[serde( + rename = "sequenceContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub sequence_context: Option<ChangedIdentitiesContext>, } impl ChangedIdentities { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Context class for changed identities"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ChangedIdentitiesContext { - #[doc = "Last Group SequenceId"] - #[serde( - rename = "groupSequenceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_sequence_id: Option<i32>, - #[doc = "Last Identity SequenceId"] - #[serde( - rename = "identitySequenceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_sequence_id: Option<i32>, - #[doc = "Last Group OrganizationIdentitySequenceId"] - #[serde( - rename = "organizationIdentitySequenceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub organization_identity_sequence_id: Option<i32>, - #[doc = "Page size"] - #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")] - pub page_size: Option<i32>, + #[doc = "Last Group SequenceId"] + #[serde( + rename = "groupSequenceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_sequence_id: Option<i32>, + #[doc = "Last Identity SequenceId"] + #[serde( + rename = "identitySequenceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_sequence_id: Option<i32>, + #[doc = "Last Group OrganizationIdentitySequenceId"] + #[serde( + rename = "organizationIdentitySequenceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub organization_identity_sequence_id: Option<i32>, + #[doc = "Page size"] + #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")] + pub page_size: Option<i32>, } impl ChangedIdentitiesContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreateScopeInfo { - #[serde( - rename = "adminGroupDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub admin_group_description: Option<String>, - #[serde( - rename = "adminGroupName", - default, - skip_serializing_if = "Option::is_none" - )] - pub admin_group_name: Option<String>, - #[serde(rename = "creatorId", default, skip_serializing_if = "Option::is_none")] - pub creator_id: Option<String>, - #[serde( - rename = "parentScopeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_scope_id: Option<String>, - #[serde(rename = "scopeName", default, skip_serializing_if = "Option::is_none")] - pub scope_name: Option<String>, - #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] - pub scope_type: Option<create_scope_info::ScopeType>, + #[serde( + rename = "adminGroupDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub admin_group_description: Option<String>, + #[serde( + rename = "adminGroupName", + default, + skip_serializing_if = "Option::is_none" + )] + pub admin_group_name: Option<String>, + #[serde(rename = "creatorId", default, skip_serializing_if = "Option::is_none")] + pub creator_id: Option<String>, + #[serde( + rename = "parentScopeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_scope_id: Option<String>, + #[serde(rename = "scopeName", default, skip_serializing_if = "Option::is_none")] + pub scope_name: Option<String>, + #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] + pub scope_type: Option<create_scope_info::ScopeType>, } impl CreateScopeInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod create_scope_info { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ScopeType { - #[serde(rename = "generic")] - Generic, - #[serde(rename = "serviceHost")] - ServiceHost, - #[serde(rename = "teamProject")] - TeamProject, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ScopeType { + #[serde(rename = "generic")] + Generic, + #[serde(rename = "serviceHost")] + ServiceHost, + #[serde(rename = "teamProject")] + TeamProject, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FrameworkIdentityInfo { - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, - #[serde( - rename = "identityType", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_type: Option<framework_identity_info::IdentityType>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub role: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, + #[serde( + rename = "identityType", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_type: Option<framework_identity_info::IdentityType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub role: Option<String>, } impl FrameworkIdentityInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod framework_identity_info { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum IdentityType { - #[serde(rename = "none")] - None, - #[serde(rename = "serviceIdentity")] - ServiceIdentity, - #[serde(rename = "aggregateIdentity")] - AggregateIdentity, - #[serde(rename = "importedIdentity")] - ImportedIdentity, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum IdentityType { + #[serde(rename = "none")] + None, + #[serde(rename = "serviceIdentity")] + ServiceIdentity, + #[serde(rename = "aggregateIdentity")] + AggregateIdentity, + #[serde(rename = "importedIdentity")] + ImportedIdentity, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GroupMembership { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub active: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(rename = "queriedId", default, skip_serializing_if = "Option::is_none")] - pub queried_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub active: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(rename = "queriedId", default, skip_serializing_if = "Option::is_none")] + pub queried_id: Option<String>, } impl GroupMembership { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Identity { - #[serde(flatten)] - pub identity_base: IdentityBase, + #[serde(flatten)] + pub identity_base: IdentityBase, } impl Identity { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Base Identity class to allow \"trimmed\" identity class in the GetConnectionData API Makes sure that on-the-wire representations of the derived classes are compatible with each other (e.g. Server responds with PublicIdentity object while client deserializes it as Identity object) Derived classes should not have additional \\[DataMember\\] properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityBase { - #[doc = "The custom display name for the identity (if any). Setting this property to an empty string will clear the existing custom display name. Setting this property to null will not affect the existing persisted value (since null values do not get sent over the wire or to the database)"] - #[serde( - rename = "customDisplayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub custom_display_name: Option<String>, - #[doc = "Identity descriptor"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "Identity Identifier. Also called Storage Key, or VSID"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "True if the identity has a membership in any Azure Devops group in the organization."] - #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")] - pub is_active: Option<bool>, - #[doc = "True if the identity is a group."] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde(rename = "masterId", default, skip_serializing_if = "Option::is_none")] - pub master_id: Option<String>, - #[doc = "Id of the members of the identity (groups only)."] - #[serde( - rename = "memberIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub member_ids: Vec<String>, - #[serde( - rename = "memberOf", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub member_of: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub members: Vec<String>, - #[serde( - rename = "metaTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub meta_type_id: Option<i32>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "The display name for the identity as specified by the source identity provider."] - #[serde( - rename = "providerDisplayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub provider_display_name: Option<String>, - #[serde( - rename = "resourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_version: Option<i32>, - #[serde( - rename = "socialDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub social_descriptor: Option<String>, - #[doc = "Subject descriptor of a Graph entity."] - #[serde( - rename = "subjectDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub subject_descriptor: Option<String>, - #[serde( - rename = "uniqueUserId", - default, - skip_serializing_if = "Option::is_none" - )] - pub unique_user_id: Option<i32>, + #[doc = "The custom display name for the identity (if any). Setting this property to an empty string will clear the existing custom display name. Setting this property to null will not affect the existing persisted value (since null values do not get sent over the wire or to the database)"] + #[serde( + rename = "customDisplayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub custom_display_name: Option<String>, + #[doc = "Identity descriptor"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "Identity Identifier. Also called Storage Key, or VSID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "True if the identity has a membership in any Azure Devops group in the organization."] + #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")] + pub is_active: Option<bool>, + #[doc = "True if the identity is a group."] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde(rename = "masterId", default, skip_serializing_if = "Option::is_none")] + pub master_id: Option<String>, + #[doc = "Id of the members of the identity (groups only)."] + #[serde( + rename = "memberIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub member_ids: Vec<String>, + #[serde( + rename = "memberOf", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub member_of: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub members: Vec<String>, + #[serde( + rename = "metaTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub meta_type_id: Option<i32>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "The display name for the identity as specified by the source identity provider."] + #[serde( + rename = "providerDisplayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub provider_display_name: Option<String>, + #[serde( + rename = "resourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_version: Option<i32>, + #[serde( + rename = "socialDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub social_descriptor: Option<String>, + #[doc = "Subject descriptor of a Graph entity."] + #[serde( + rename = "subjectDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub subject_descriptor: Option<String>, + #[serde( + rename = "uniqueUserId", + default, + skip_serializing_if = "Option::is_none" + )] + pub unique_user_id: Option<i32>, } impl IdentityBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityBatchInfo { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub descriptors: Vec<String>, - #[serde( - rename = "identityIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub identity_ids: Vec<String>, - #[serde( - rename = "includeRestrictedVisibility", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_restricted_visibility: Option<bool>, - #[serde( - rename = "propertyNames", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub property_names: Vec<String>, - #[serde( - rename = "queryMembership", - default, - skip_serializing_if = "Option::is_none" - )] - pub query_membership: Option<identity_batch_info::QueryMembership>, - #[serde( - rename = "socialDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub social_descriptors: Vec<String>, - #[serde( - rename = "subjectDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub subject_descriptors: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub descriptors: Vec<String>, + #[serde( + rename = "identityIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub identity_ids: Vec<String>, + #[serde( + rename = "includeRestrictedVisibility", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_restricted_visibility: Option<bool>, + #[serde( + rename = "propertyNames", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub property_names: Vec<String>, + #[serde( + rename = "queryMembership", + default, + skip_serializing_if = "Option::is_none" + )] + pub query_membership: Option<identity_batch_info::QueryMembership>, + #[serde( + rename = "socialDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub social_descriptors: Vec<String>, + #[serde( + rename = "subjectDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub subject_descriptors: Vec<String>, } impl IdentityBatchInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod identity_batch_info { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum QueryMembership { - #[serde(rename = "none")] - None, - #[serde(rename = "direct")] - Direct, - #[serde(rename = "expanded")] - Expanded, - #[serde(rename = "expandedUp")] - ExpandedUp, - #[serde(rename = "expandedDown")] - ExpandedDown, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum QueryMembership { + #[serde(rename = "none")] + None, + #[serde(rename = "direct")] + Direct, + #[serde(rename = "expanded")] + Expanded, + #[serde(rename = "expandedUp")] + ExpandedUp, + #[serde(rename = "expandedDown")] + ExpandedDown, + } } #[doc = "An Identity descriptor is a wrapper for the identity type (Windows SID, Passport) along with a unique identifier such as the SID or PUID."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityDescriptor { - #[doc = "The unique identifier for this identity, not exceeding 256 chars, which will be persisted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, - #[doc = "Type of descriptor (for example, Windows, Passport, etc.)."] - #[serde( - rename = "identityType", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_type: Option<String>, + #[doc = "The unique identifier for this identity, not exceeding 256 chars, which will be persisted."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, + #[doc = "Type of descriptor (for example, Windows, Passport, etc.)."] + #[serde( + rename = "identityType", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_type: Option<String>, } impl IdentityDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Identity>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Identity>, } impl IdentityList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityRightsTransferData { - #[serde( - rename = "userPrincipalNameMappings", - default, - skip_serializing_if = "Option::is_none" - )] - pub user_principal_name_mappings: Option<serde_json::Value>, + #[serde( + rename = "userPrincipalNameMappings", + default, + skip_serializing_if = "Option::is_none" + )] + pub user_principal_name_mappings: Option<serde_json::Value>, } impl IdentityRightsTransferData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityScope { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub administrators: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")] - pub is_active: Option<bool>, - #[serde(rename = "isGlobal", default, skip_serializing_if = "Option::is_none")] - pub is_global: Option<bool>, - #[serde( - rename = "localScopeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub local_scope_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option<String>, - #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] - pub scope_type: Option<identity_scope::ScopeType>, - #[serde( - rename = "securingHostId", - default, - skip_serializing_if = "Option::is_none" - )] - pub securing_host_id: Option<String>, - #[serde( - rename = "subjectDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub subject_descriptor: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub administrators: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")] + pub is_active: Option<bool>, + #[serde(rename = "isGlobal", default, skip_serializing_if = "Option::is_none")] + pub is_global: Option<bool>, + #[serde( + rename = "localScopeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub local_scope_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option<String>, + #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] + pub scope_type: Option<identity_scope::ScopeType>, + #[serde( + rename = "securingHostId", + default, + skip_serializing_if = "Option::is_none" + )] + pub securing_host_id: Option<String>, + #[serde( + rename = "subjectDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub subject_descriptor: Option<String>, } impl IdentityScope { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod identity_scope { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ScopeType { - #[serde(rename = "generic")] - Generic, - #[serde(rename = "serviceHost")] - ServiceHost, - #[serde(rename = "teamProject")] - TeamProject, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ScopeType { + #[serde(rename = "generic")] + Generic, + #[serde(rename = "serviceHost")] + ServiceHost, + #[serde(rename = "teamProject")] + TeamProject, + } } #[doc = "Identity information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentitySelf { - #[doc = "The UserPrincipalName (UPN) of the account. This value comes from the source provider."] - #[serde( - rename = "accountName", - default, - skip_serializing_if = "Option::is_none" - )] - pub account_name: Option<String>, - #[doc = "The display name. For AAD accounts with multiple tenants this is the display name of the profile in the home tenant."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This represents the name of the container of origin. For AAD accounts this is the tenantID of the home tenant. For MSA accounts this is the string \"Windows Live ID\"."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub domain: Option<String>, - #[doc = "This is the VSID of the home tenant profile. If the profile is signed into the home tenant or if the profile has no tenants then this Id is the same as the Id returned by the profile/profiles/me endpoint. Going forward it is recommended that you use the combined values of Origin, OriginId and Domain to uniquely identify a user rather than this Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The type of source provider for the origin identifier. For MSA accounts this is \"msa\". For AAD accounts this is \"aad\"."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub origin: Option<String>, - #[doc = "The unique identifier from the system of origin. If there are multiple tenants this is the unique identifier of the account in the home tenant. (For MSA this is the PUID in hex notation, for AAD this is the object id.)"] - #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] - pub origin_id: Option<String>, - #[doc = "For AAD accounts this is all of the tenants that this account is a member of."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tenants: Vec<TenantInfo>, + #[doc = "The UserPrincipalName (UPN) of the account. This value comes from the source provider."] + #[serde( + rename = "accountName", + default, + skip_serializing_if = "Option::is_none" + )] + pub account_name: Option<String>, + #[doc = "The display name. For AAD accounts with multiple tenants this is the display name of the profile in the home tenant."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This represents the name of the container of origin. For AAD accounts this is the tenantID of the home tenant. For MSA accounts this is the string \"Windows Live ID\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub domain: Option<String>, + #[doc = "This is the VSID of the home tenant profile. If the profile is signed into the home tenant or if the profile has no tenants then this Id is the same as the Id returned by the profile/profiles/me endpoint. Going forward it is recommended that you use the combined values of Origin, OriginId and Domain to uniquely identify a user rather than this Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The type of source provider for the origin identifier. For MSA accounts this is \"msa\". For AAD accounts this is \"aad\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option<String>, + #[doc = "The unique identifier from the system of origin. If there are multiple tenants this is the unique identifier of the account in the home tenant. (For MSA this is the PUID in hex notation, for AAD this is the object id.)"] + #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] + pub origin_id: Option<String>, + #[doc = "For AAD accounts this is all of the tenants that this account is a member of."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tenants: Vec<TenantInfo>, } impl IdentitySelf { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentitySnapshot { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub groups: Vec<Identity>, - #[serde( - rename = "identityIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub identity_ids: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub memberships: Vec<GroupMembership>, - #[serde(rename = "scopeId", default, skip_serializing_if = "Option::is_none")] - pub scope_id: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub scopes: Vec<IdentityScope>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub groups: Vec<Identity>, + #[serde( + rename = "identityIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub identity_ids: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub memberships: Vec<GroupMembership>, + #[serde(rename = "scopeId", default, skip_serializing_if = "Option::is_none")] + pub scope_id: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub scopes: Vec<IdentityScope>, } impl IdentitySnapshot { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityUpdateData { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub index: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub updated: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub index: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub updated: Option<bool>, } impl IdentityUpdateData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IssuedToken { - #[serde( - rename = "isAuthenticated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_authenticated: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, + #[serde( + rename = "isAuthenticated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_authenticated: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, } impl IssuedToken { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a JSON object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JObject { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<String>, - #[doc = "Gets the node type for this JToken."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<String>, + #[doc = "Gets the node type for this JToken."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl JObject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for JSON Patch Operations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchDocument {} impl JsonPatchDocument { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for a JSON Patch operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchOperation { - #[doc = "The path to copy from for the Move/Copy operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub from: Option<String>, - #[doc = "The patch operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub op: Option<json_patch_operation::Op>, - #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "The value for the operation. This is either a primitive or a JToken."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = "The path to copy from for the Move/Copy operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub from: Option<String>, + #[doc = "The patch operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub op: Option<json_patch_operation::Op>, + #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "The value for the operation. This is either a primitive or a JToken."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl JsonPatchOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod json_patch_operation { - use super::*; - #[doc = "The patch operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Op { - #[serde(rename = "add")] - Add, - #[serde(rename = "remove")] - Remove, - #[serde(rename = "replace")] - Replace, - #[serde(rename = "move")] - Move, - #[serde(rename = "copy")] - Copy, - #[serde(rename = "test")] - Test, - } + use super::*; + #[doc = "The patch operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Op { + #[serde(rename = "add")] + Add, + #[serde(rename = "remove")] + Remove, + #[serde(rename = "replace")] + Replace, + #[serde(rename = "move")] + Move, + #[serde(rename = "copy")] + Copy, + #[serde(rename = "test")] + Test, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonWebToken { - #[serde(flatten)] - pub issued_token: IssuedToken, + #[serde(flatten)] + pub issued_token: IssuedToken, } impl JsonWebToken { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PagedIdentities { - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub continuation_token: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub identities: Vec<Identity>, + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub continuation_token: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub identities: Vec<Identity>, } impl PagedIdentities { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PropertiesCollection { - #[doc = "The count of properties in the collection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<serde_json::Value>, - #[doc = "The set of keys in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub keys: Vec<String>, - #[doc = "The set of values in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<String>, + #[doc = "The count of properties in the collection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<serde_json::Value>, + #[doc = "The set of keys in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub keys: Vec<String>, + #[doc = "The set of values in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<String>, } impl PropertiesCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RefreshTokenGrant { - #[serde(flatten)] - pub authorization_grant: AuthorizationGrant, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub jwt: Option<JsonWebToken>, + #[serde(flatten)] + pub authorization_grant: AuthorizationGrant, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub jwt: Option<JsonWebToken>, } impl RefreshTokenGrant { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SwapIdentityInfo { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id1: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id2: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id1: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id2: Option<String>, } impl SwapIdentityInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TenantInfo { - #[serde( - rename = "homeTenant", - default, - skip_serializing_if = "Option::is_none" - )] - pub home_tenant: Option<bool>, - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option<String>, - #[serde( - rename = "tenantName", - default, - skip_serializing_if = "Option::is_none" - )] - pub tenant_name: Option<String>, - #[serde( - rename = "verifiedDomains", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub verified_domains: Vec<String>, + #[serde( + rename = "homeTenant", + default, + skip_serializing_if = "Option::is_none" + )] + pub home_tenant: Option<bool>, + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option<String>, + #[serde( + rename = "tenantName", + default, + skip_serializing_if = "Option::is_none" + )] + pub tenant_name: Option<String>, + #[serde( + rename = "verifiedDomains", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub verified_domains: Vec<String>, } impl TenantInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } 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 aba43f98..e2a5b8a1 100644 --- a/azure_devops_rust_api/src/member_entitlement_management/mod.rs +++ b/azure_devops_rust_api/src/member_entitlement_management/mod.rs @@ -9,2805 +9,2047 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://vsaex.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + pub fn group_entitlements_client(&self) -> group_entitlements::Client { + group_entitlements::Client(self.clone()) + } + pub fn members_client(&self) -> members::Client { + members::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()) + } +} +pub mod group_entitlements { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the group entitlements for an account."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Create a group entitlement with license rule, extension rule."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: GroupEntitlement object specifying License Rule, Extensions Rule for the group. Based on the rules the members of the group will be given licenses and extensions. The Group Entitlement can be used to add the group to another project level groups"] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::GroupEntitlement>, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + rule_option: None, + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + #[doc = "Get a group entitlement.\n\nIf the group entitlement does not exist, returns null."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `group_id`: ID of the group."] + pub fn get( + &self, + organization: impl Into<String>, + group_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: JsonPatchDocument containing the operations to perform on the group."] + #[doc = "* `group_id`: ID of the group."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::JsonPatchDocument>, + group_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `group_id`: ID of the group to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + group_id: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GroupEntitlementList> { + let bytes = self.0.into_body().collect().await?; + let body: models::GroupEntitlementList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/groupentitlements", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GroupEntitlementList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GroupEntitlementList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::GroupEntitlementOperationReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::GroupEntitlementOperationReference = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GroupEntitlement, + pub(crate) rule_option: Option<String>, + } + 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<String>) -> Self { + self.rule_option = Some(rule_option.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/groupentitlements", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + if let Some(rule_option) = &this.rule_option { + req + .url_mut() + .query_pairs_mut() + .append_pair("ruleOption", rule_option); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GroupEntitlementOperationReference>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::GroupEntitlementOperationReference>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::GroupEntitlement> { + let bytes = self.0.into_body().collect().await?; + let body: models::GroupEntitlement = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod group_entitlements { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) group_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/groupentitlements/{}", + this.client.endpoint(), + &this.organization, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GroupEntitlement>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::GroupEntitlement>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get the group entitlements for an account."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - #[doc = "Create a group entitlement with license rule, extension rule."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: GroupEntitlement object specifying License Rule, Extensions Rule for the group. Based on the rules the members of the group will be given licenses and extensions. The Group Entitlement can be used to add the group to another project level groups"] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::GroupEntitlement>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `group_id`: ID of the group."] - pub fn get( - &self, - organization: impl Into<String>, - group_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: JsonPatchDocument containing the operations to perform on the group."] - #[doc = "* `group_id`: ID of the group."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - group_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `group_id`: ID of the group to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - group_id: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GroupEntitlementList> { - let bytes = self.0.into_body().collect().await?; - let body: models::GroupEntitlementList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/groupentitlements", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GroupEntitlementList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GroupEntitlementList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::GroupEntitlementOperationReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::GroupEntitlementOperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GroupEntitlement, - pub(crate) rule_option: Option<String>, - } - 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<String>) -> Self { - self.rule_option = Some(rule_option.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/groupentitlements", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(rule_option) = &this.rule_option { - req.url_mut() - .query_pairs_mut() - .append_pair("ruleOption", rule_option); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GroupEntitlementOperationReference>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GroupEntitlementOperationReference>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::GroupEntitlement> { - let bytes = self.0.into_body().collect().await?; - let body: models::GroupEntitlement = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) group_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/groupentitlements/{}", - this.client.endpoint(), - &this.organization, - &this.group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GroupEntitlement>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::GroupEntitlement>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::GroupEntitlementOperationReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::GroupEntitlementOperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::JsonPatchDocument, - pub(crate) group_id: String, - pub(crate) rule_option: Option<String>, - } - 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<String>) -> Self { - self.rule_option = Some(rule_option.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/groupentitlements/{}", - this.client.endpoint(), - &this.organization, - &this.group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(rule_option) = &this.rule_option { - req.url_mut() - .query_pairs_mut() - .append_pair("ruleOption", rule_option); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GroupEntitlementOperationReference>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GroupEntitlementOperationReference>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::GroupEntitlementOperationReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::GroupEntitlementOperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) group_id: String, - pub(crate) rule_option: Option<String>, - pub(crate) remove_group_membership: Option<bool>, - } - 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<String>) -> Self { - self.rule_option = Some(rule_option.into()); - self - } - #[doc = "Optional parameter that specifies whether the group with the given ID should be removed from all other groups"] - pub fn remove_group_membership(mut self, remove_group_membership: bool) -> Self { - self.remove_group_membership = Some(remove_group_membership); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/groupentitlements/{}", - this.client.endpoint(), - &this.organization, - &this.group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(rule_option) = &this.rule_option { - req.url_mut() - .query_pairs_mut() - .append_pair("ruleOption", rule_option); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::GroupEntitlementOperationReference>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::GroupEntitlementOperationReference>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::GroupEntitlementOperationReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::GroupEntitlementOperationReference = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::JsonPatchDocument, + pub(crate) group_id: String, + pub(crate) rule_option: Option<String>, + } + 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<String>) -> Self { + self.rule_option = Some(rule_option.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/groupentitlements/{}", + this.client.endpoint(), + &this.organization, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::to_json(&this.body)?; + if let Some(rule_option) = &this.rule_option { + req + .url_mut() + .query_pairs_mut() + .append_pair("ruleOption", rule_option); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GroupEntitlementOperationReference>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::GroupEntitlementOperationReference>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::GroupEntitlementOperationReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::GroupEntitlementOperationReference = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) group_id: String, + pub(crate) rule_option: Option<String>, + pub(crate) remove_group_membership: Option<bool>, + } + 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<String>) -> Self { + self.rule_option = Some(rule_option.into()); + self + } + #[doc = "Optional parameter that specifies whether the group with the given ID should be removed from all other groups"] + pub fn remove_group_membership(mut self, remove_group_membership: bool) -> Self { + self.remove_group_membership = Some(remove_group_membership); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/groupentitlements/{}", + this.client.endpoint(), + &this.organization, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(rule_option) = &this.rule_option { + req + .url_mut() + .query_pairs_mut() + .append_pair("ruleOption", rule_option); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::GroupEntitlementOperationReference>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::GroupEntitlementOperationReference>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod members { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get direct members of a Group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `group_id`: Id of the Group."] + pub fn get( + &self, + organization: impl Into<String>, + group_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `group_id`: Id of the Group."] + #[doc = "* `member_id`: Id of the member to add."] + pub fn add( + &self, + organization: impl Into<String>, + group_id: impl Into<String>, + member_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `group_id`: Id of the group."] + #[doc = "* `member_id`: Id of the member to remove."] + pub fn remove_member_from_group( + &self, + organization: impl Into<String>, + group_id: impl Into<String>, + member_id: impl Into<String>, + ) -> 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 get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get direct members of a Group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `group_id`: Id of the Group."] - pub fn get( - &self, - organization: impl Into<String>, - group_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `group_id`: Id of the Group."] - #[doc = "* `member_id`: Id of the member to add."] - pub fn add( - &self, - organization: impl Into<String>, - group_id: impl Into<String>, - member_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `group_id`: Id of the group."] - #[doc = "* `member_id`: Id of the member to remove."] - pub fn remove_member_from_group( - &self, - organization: impl Into<String>, - group_id: impl Into<String>, - member_id: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PagedGraphMemberList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PagedGraphMemberList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) group_id: String, - pub(crate) max_results: Option<i32>, - pub(crate) paging_token: Option<String>, - } - 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); - self - } - #[doc = "Paging Token from the previous page fetched. If the 'pagingToken' is null, the results would be fetched from the beginning of the Members List."] - pub fn paging_token(mut self, paging_token: impl Into<String>) -> Self { - self.paging_token = Some(paging_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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/GroupEntitlements/{}/members", - this.client.endpoint(), - &this.organization, - &this.group_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PagedGraphMemberList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PagedGraphMemberList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/GroupEntitlements/{}/members/{}", - this.client.endpoint(), - &this.organization, - &this.group_id, - &this.member_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod remove_member_from_group { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/GroupEntitlements/{}/members/{}", - this.client.endpoint(), - &this.organization, - &this.group_id, - &this.member_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PagedGraphMemberList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PagedGraphMemberList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod member_entitlements { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) group_id: String, + pub(crate) max_results: Option<i32>, + pub(crate) paging_token: Option<String>, + } + 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); + self + } + #[doc = "Paging Token from the previous page fetched. If the 'pagingToken' is null, the results would be fetched from the beginning of the Members List."] + pub fn paging_token(mut self, paging_token: impl Into<String>) -> Self { + self.paging_token = Some(paging_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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/GroupEntitlements/{}/members", + this.client.endpoint(), + &this.organization, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PagedGraphMemberList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PagedGraphMemberList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn search_member_entitlements( - &self, - organization: impl Into<String>, - ) -> 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 search_member_entitlements { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<serde_json::Value>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<serde_json::Value> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) continuation_token: Option<String>, - pub(crate) select: Option<String>, - pub(crate) filter: Option<String>, - pub(crate) order_by: Option<String>, - } - impl RequestBuilder { - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - pub fn select(mut self, select: impl Into<String>) -> Self { - self.select = Some(select.into()); - self - } - pub fn filter(mut self, filter: impl Into<String>) -> Self { - self.filter = Some(filter.into()); - self - } - pub fn order_by(mut self, order_by: impl Into<String>) -> Self { - self.order_by = Some(order_by.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/memberentitlements", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<serde_json::Value>>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<Vec<serde_json::Value>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) group_id: String, + pub(crate) member_id: String, } -} -pub mod service_principal_entitlements { + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/GroupEntitlements/{}/members/{}", + this.client.endpoint(), + &this.organization, + &this.group_id, + &this.member_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod remove_member_from_group { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: ServicePrincipalEntitlement object specifying License, Extensions and Project/Team groups the service principal should be added to."] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::ServicePrincipalEntitlement>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: JsonPatchDocument containing the operations to perform."] - pub fn update_service_principal_entitlements( - &self, - organization: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `service_principal_id`: ID of the service principal."] - pub fn get( - &self, - organization: impl Into<String>, - service_principal_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: JsonPatchDocument containing the operations to perform on the service principal."] - #[doc = "* `service_principal_id`: ID of the service principal."] - pub fn update_service_principal_entitlement( - &self, - organization: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - service_principal_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `service_principal_id`: ID of the service principal."] - pub fn delete( - &self, - organization: impl Into<String>, - service_principal_id: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - service_principal_id: service_principal_id.into(), - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ServicePrincipalEntitlementsPostResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServicePrincipalEntitlementsPostResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ServicePrincipalEntitlement, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/serviceprincipalentitlements", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServicePrincipalEntitlementsPostResponse>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ServicePrincipalEntitlementsPostResponse>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_service_principal_entitlements { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ServicePrincipalEntitlementOperationReference> + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/GroupEntitlements/{}/members/{}", + this.client.endpoint(), + &this.organization, + &this.group_id, + &this.member_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? { - let bytes = self.0.into_body().collect().await?; - let body: models::ServicePrincipalEntitlementOperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::JsonPatchDocument, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/serviceprincipalentitlements", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServicePrincipalEntitlementOperationReference>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ServicePrincipalEntitlementOperationReference>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ServicePrincipalEntitlement> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServicePrincipalEntitlement = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) service_principal_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/serviceprincipalentitlements/{}", - this.client.endpoint(), - &this.organization, - &this.service_principal_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServicePrincipalEntitlement>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ServicePrincipalEntitlement>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_service_principal_entitlement { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ServicePrincipalEntitlementsPatchResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServicePrincipalEntitlementsPatchResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::JsonPatchDocument, - pub(crate) service_principal_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/serviceprincipalentitlements/{}", - this.client.endpoint(), - &this.organization, - &this.service_principal_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServicePrincipalEntitlementsPatchResponse>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ServicePrincipalEntitlementsPatchResponse>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) service_principal_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/serviceprincipalentitlements/{}", - this.client.endpoint(), - &this.organization, - &this.service_principal_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } pub mod user_entitlements { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn search_user_entitlements( + &self, + organization: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: UserEntitlement object specifying License, Extensions and Project/Team groups the user should be added to."] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::UserEntitlement>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: JsonPatchDocument containing the operations to perform."] + pub fn update_user_entitlements( + &self, + organization: impl Into<String>, + body: impl Into<models::JsonPatchDocument>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `user_id`: ID of the user."] + pub fn get( + &self, + organization: impl Into<String>, + user_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: JsonPatchDocument containing the operations to perform on the user."] + #[doc = "* `user_id`: ID of the user."] + pub fn update_user_entitlement( + &self, + organization: impl Into<String>, + body: impl Into<models::JsonPatchDocument>, + user_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `user_id`: ID of the user."] + pub fn delete( + &self, + organization: impl Into<String>, + user_id: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + user_id: user_id.into(), + } + } + } + pub mod search_user_entitlements { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn search_user_entitlements( - &self, - organization: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: UserEntitlement object specifying License, Extensions and Project/Team groups the user should be added to."] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::UserEntitlement>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: JsonPatchDocument containing the operations to perform."] - pub fn update_user_entitlements( - &self, - organization: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `user_id`: ID of the user."] - pub fn get( - &self, - organization: impl Into<String>, - user_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: JsonPatchDocument containing the operations to perform on the user."] - #[doc = "* `user_id`: ID of the user."] - pub fn update_user_entitlement( - &self, - organization: impl Into<String>, - body: impl Into<models::JsonPatchDocument>, - user_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `user_id`: ID of the user."] - pub fn delete( - &self, - organization: impl Into<String>, - user_id: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - user_id: user_id.into(), - } - } - } - pub mod search_user_entitlements { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PagedGraphMemberList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PagedGraphMemberList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) continuation_token: Option<String>, - pub(crate) select: Option<String>, - pub(crate) filter: Option<String>, - pub(crate) order_by: Option<String>, - } - 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<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Comma (\",\") separated list of properties to select in the result entitlements. names of the properties are - 'Projects, 'Extensions' and 'Grouprules'."] - pub fn select(mut self, select: impl Into<String>) -> Self { - self.select = Some(select.into()); - self - } - #[doc = "Equality operators relating to searching user entitlements seperated by and clauses. Valid filters include: licenseId, licenseStatus, userType, and name. licenseId: filters based on license assignment using license names. i.e. licenseId eq 'Account-Stakeholder' or licenseId eq 'Account-Express'. licenseStatus: filters based on license status. currently only supports disabled. i.e. licenseStatus eq 'Disabled'. To get disabled basic licenses, you would pass (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled') userType: filters off identity type. Suppored types are member or guest i.e. userType eq 'member'. name: filters on if the user's display name or email contians given input. i.e. get all users with \"test\" in email or displayname is \"name eq 'test'\". A valid query could be: (licenseId eq 'Account-Stakeholder' or (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled')) and name eq 'test' and userType eq 'guest'."] - pub fn filter(mut self, filter: impl Into<String>) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "PropertyName and Order (separated by a space ( )) to sort on (e.g. lastAccessed desc). Order defaults to ascending. valid properties to order by are dateCreated, lastAccessed, and name"] - pub fn order_by(mut self, order_by: impl Into<String>) -> Self { - self.order_by = Some(order_by.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/userentitlements", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PagedGraphMemberList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PagedGraphMemberList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::UserEntitlementsPostResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::UserEntitlementsPostResponse = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::UserEntitlement, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/userentitlements", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::UserEntitlementsPostResponse>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::UserEntitlementsPostResponse>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_user_entitlements { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::UserEntitlementOperationReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::UserEntitlementOperationReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::JsonPatchDocument, - pub(crate) do_not_send_invite_for_new_users: Option<bool>, - } - impl RequestBuilder { - #[doc = "Whether to send email invites to new users or not"] - pub fn do_not_send_invite_for_new_users( - mut self, - do_not_send_invite_for_new_users: bool, - ) -> Self { - self.do_not_send_invite_for_new_users = Some(do_not_send_invite_for_new_users); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/userentitlements", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::UserEntitlementOperationReference>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::UserEntitlementOperationReference>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::UserEntitlement> { - let bytes = self.0.into_body().collect().await?; - let body: models::UserEntitlement = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) user_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/userentitlements/{}", - this.client.endpoint(), - &this.organization, - &this.user_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::UserEntitlement>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::UserEntitlement>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_user_entitlement { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::UserEntitlementsPatchResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::UserEntitlementsPatchResponse = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::JsonPatchDocument, - pub(crate) user_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/userentitlements/{}", - this.client.endpoint(), - &this.organization, - &this.user_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::UserEntitlementsPatchResponse>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::UserEntitlementsPatchResponse>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) user_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/userentitlements/{}", - this.client.endpoint(), - &this.organization, - &this.user_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PagedGraphMemberList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PagedGraphMemberList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) continuation_token: Option<String>, + pub(crate) select: Option<String>, + pub(crate) filter: Option<String>, + pub(crate) order_by: Option<String>, + } + 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<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "Comma (\",\") separated list of properties to select in the result entitlements. names of the properties are - 'Projects, 'Extensions' and 'Grouprules'."] + pub fn select(mut self, select: impl Into<String>) -> Self { + self.select = Some(select.into()); + self + } + #[doc = "Equality operators relating to searching user entitlements seperated by and clauses. Valid filters include: licenseId, licenseStatus, userType, and name. licenseId: filters based on license assignment using license names. i.e. licenseId eq 'Account-Stakeholder' or licenseId eq 'Account-Express'. licenseStatus: filters based on license status. currently only supports disabled. i.e. licenseStatus eq 'Disabled'. To get disabled basic licenses, you would pass (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled') userType: filters off identity type. Suppored types are member or guest i.e. userType eq 'member'. name: filters on if the user's display name or email contians given input. i.e. get all users with \"test\" in email or displayname is \"name eq 'test'\". A valid query could be: (licenseId eq 'Account-Stakeholder' or (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled')) and name eq 'test' and userType eq 'guest'."] + pub fn filter(mut self, filter: impl Into<String>) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "PropertyName and Order (separated by a space ( )) to sort on (e.g. lastAccessed desc). Order defaults to ascending. valid properties to order by are dateCreated, lastAccessed, and name"] + pub fn order_by(mut self, order_by: impl Into<String>) -> Self { + self.order_by = Some(order_by.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/userentitlements", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PagedGraphMemberList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PagedGraphMemberList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::UserEntitlementsPostResponse> { + let bytes = self.0.into_body().collect().await?; + let body: models::UserEntitlementsPostResponse = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UserEntitlement, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/userentitlements", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::UserEntitlementsPostResponse>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::UserEntitlementsPostResponse>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_user_entitlements { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::UserEntitlementOperationReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::UserEntitlementOperationReference = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::JsonPatchDocument, + pub(crate) do_not_send_invite_for_new_users: Option<bool>, + } + impl RequestBuilder { + #[doc = "Whether to send email invites to new users or not"] + pub fn do_not_send_invite_for_new_users( + mut self, + do_not_send_invite_for_new_users: bool, + ) -> Self { + self.do_not_send_invite_for_new_users = Some(do_not_send_invite_for_new_users); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/userentitlements", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::UserEntitlementOperationReference>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::UserEntitlementOperationReference>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::UserEntitlement> { + let bytes = self.0.into_body().collect().await?; + let body: models::UserEntitlement = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) user_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/userentitlements/{}", + this.client.endpoint(), + &this.organization, + &this.user_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::UserEntitlement>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::UserEntitlement>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_user_entitlement { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::UserEntitlementsPatchResponse> { + let bytes = self.0.into_body().collect().await?; + let body: models::UserEntitlementsPatchResponse = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::JsonPatchDocument, + pub(crate) user_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/userentitlements/{}", + this.client.endpoint(), + &this.organization, + &this.user_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::UserEntitlementsPatchResponse>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::UserEntitlementsPatchResponse>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) user_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/userentitlements/{}", + this.client.endpoint(), + &this.organization, + &this.user_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod user_entitlement_summary { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get(&self, organization: impl Into<String>) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + select: None, + } + } + } + pub mod get { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get(&self, organization: impl Into<String>) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - select: None, - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::UsersSummary> { - let bytes = self.0.into_body().collect().await?; - let body: models::UsersSummary = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) select: Option<String>, - } - 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<String>) -> Self { - self.select = Some(select.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/userentitlementsummary", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(select) = &this.select { - req.url_mut() - .query_pairs_mut() - .append_pair("select", select); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::UsersSummary>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::UsersSummary>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::UsersSummary> { + let bytes = self.0.into_body().collect().await?; + let body: models::UsersSummary = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) select: Option<String>, + } + 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<String>) -> Self { + self.select = Some(select.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/userentitlementsummary", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(select) = &this.select { + req + .url_mut() + .query_pairs_mut() + .append_pair("select", select); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::UsersSummary>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::UsersSummary>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/member_entitlement_management/models.rs b/azure_devops_rust_api/src/member_entitlement_management/models.rs index 9f0c36fe..7a5aec80 100644 --- a/azure_devops_rust_api/src/member_entitlement_management/models.rs +++ b/azure_devops_rust_api/src/member_entitlement_management/models.rs @@ -5,1585 +5,1303 @@ use serde::de::{value, Deserializer, IntoDeserializer}; use serde::{Deserialize, Serialize, Serializer}; use std::str::FromStr; -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AadGraphMember { - #[serde(flatten)] - pub graph_member: GraphMember, - #[doc = "The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle."] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - #[doc = "When true, the group has been deleted in the identity provider"] - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "The meta type of the user in the origin, such as \"member\", \"guest\", etc. See UserMetaType for the set of possible values."] - #[serde(rename = "metaType", default, skip_serializing_if = "Option::is_none")] - pub meta_type: Option<String>, -} -impl AadGraphMember { - pub fn new() -> Self { - Self::default() - } -} #[doc = "License assigned to a user"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessLevel { - #[doc = "Type of Account License (e.g. Express, Stakeholder etc.). To use the AccountLicenseType, LicensingSource should be defined as 'account' in the request body."] - #[serde( - rename = "accountLicenseType", - default, - skip_serializing_if = "Option::is_none" - )] - pub account_license_type: Option<access_level::AccountLicenseType>, - #[doc = "Assignment Source of the License (e.g. Group, Unknown etc."] - #[serde( - rename = "assignmentSource", - default, - skip_serializing_if = "Option::is_none" - )] - pub assignment_source: Option<access_level::AssignmentSource>, - #[doc = "Display name of the License"] - #[serde( - rename = "licenseDisplayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub license_display_name: Option<String>, - #[doc = "Licensing Source (e.g. Account. MSDN etc.)"] - #[serde( - rename = "licensingSource", - default, - skip_serializing_if = "Option::is_none" - )] - pub licensing_source: Option<access_level::LicensingSource>, - #[doc = "Type of MSDN License (e.g. Visual Studio Professional, Visual Studio Enterprise etc.). To use the MsdnLicenseType, LicensingSource should be defined as 'msdn' in the request body."] - #[serde( - rename = "msdnLicenseType", - default, - skip_serializing_if = "Option::is_none" - )] - pub msdn_license_type: Option<access_level::MsdnLicenseType>, - #[doc = "User status in the account"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<access_level::Status>, - #[doc = "Status message."] - #[serde( - rename = "statusMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_message: Option<String>, + #[doc = "Type of Account License (e.g. Express, Stakeholder etc.)"] + #[serde( + rename = "accountLicenseType", + default, + skip_serializing_if = "Option::is_none" + )] + pub account_license_type: Option<access_level::AccountLicenseType>, + #[doc = "Assignment Source of the License (e.g. Group, Unknown etc."] + #[serde( + rename = "assignmentSource", + default, + skip_serializing_if = "Option::is_none" + )] + pub assignment_source: Option<access_level::AssignmentSource>, + #[doc = "Display name of the License"] + #[serde( + rename = "licenseDisplayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub license_display_name: Option<String>, + #[doc = "Licensing Source (e.g. Account. MSDN etc.)"] + #[serde( + rename = "licensingSource", + default, + skip_serializing_if = "Option::is_none" + )] + pub licensing_source: Option<access_level::LicensingSource>, + #[doc = "Type of MSDN License (e.g. Visual Studio Professional, Visual Studio Enterprise etc.)"] + #[serde( + rename = "msdnLicenseType", + default, + skip_serializing_if = "Option::is_none" + )] + pub msdn_license_type: Option<access_level::MsdnLicenseType>, + #[doc = "User status in the account"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<access_level::Status>, + #[doc = "Status message."] + #[serde( + rename = "statusMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_message: Option<String>, } impl AccessLevel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod access_level { - use super::*; - #[doc = "Type of Account License (e.g. Express, Stakeholder etc.). To use the AccountLicenseType, LicensingSource should be defined as 'account' in the request body."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AccountLicenseType { - #[serde(rename = "none")] - None, - #[serde(rename = "earlyAdopter")] - EarlyAdopter, - #[serde(rename = "express")] - Express, - #[serde(rename = "professional")] - Professional, - #[serde(rename = "advanced")] - Advanced, - #[serde(rename = "stakeholder")] - Stakeholder, - } - #[doc = "Assignment Source of the License (e.g. Group, Unknown etc."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AssignmentSource { - #[serde(rename = "none")] - None, - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "groupRule")] - GroupRule, - } - #[doc = "Licensing Source (e.g. Account. MSDN etc.)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum LicensingSource { - #[serde(rename = "none")] - None, - #[serde(rename = "account")] - Account, - #[serde(rename = "msdn")] - Msdn, - #[serde(rename = "profile")] - Profile, - #[serde(rename = "auto")] - Auto, - #[serde(rename = "trial")] - Trial, - } - #[doc = "Type of MSDN License (e.g. Visual Studio Professional, Visual Studio Enterprise etc.). To use the MsdnLicenseType, LicensingSource should be defined as 'msdn' in the request body."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum MsdnLicenseType { - #[serde(rename = "none")] - None, - #[serde(rename = "eligible")] - Eligible, - #[serde(rename = "professional")] - Professional, - #[serde(rename = "platforms")] - Platforms, - #[serde(rename = "testProfessional")] - TestProfessional, - #[serde(rename = "premium")] - Premium, - #[serde(rename = "ultimate")] - Ultimate, - #[serde(rename = "enterprise")] - Enterprise, - } - #[doc = "User status in the account"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "none")] - None, - #[serde(rename = "active")] - Active, - #[serde(rename = "disabled")] - Disabled, - #[serde(rename = "deleted")] - Deleted, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "expired")] - Expired, - #[serde(rename = "pendingDisabled")] - PendingDisabled, - } + use super::*; + #[doc = "Type of Account License (e.g. Express, Stakeholder etc.)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AccountLicenseType { + #[serde(rename = "none")] + None, + #[serde(rename = "earlyAdopter")] + EarlyAdopter, + #[serde(rename = "express")] + Express, + #[serde(rename = "professional")] + Professional, + #[serde(rename = "advanced")] + Advanced, + #[serde(rename = "stakeholder")] + Stakeholder, + } + #[doc = "Assignment Source of the License (e.g. Group, Unknown etc."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AssignmentSource { + #[serde(rename = "none")] + None, + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "groupRule")] + GroupRule, + } + #[doc = "Licensing Source (e.g. Account. MSDN etc.)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum LicensingSource { + #[serde(rename = "none")] + None, + #[serde(rename = "account")] + Account, + #[serde(rename = "msdn")] + Msdn, + #[serde(rename = "profile")] + Profile, + #[serde(rename = "auto")] + Auto, + #[serde(rename = "trial")] + Trial, + } + #[doc = "Type of MSDN License (e.g. Visual Studio Professional, Visual Studio Enterprise etc.)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum MsdnLicenseType { + #[serde(rename = "none")] + None, + #[serde(rename = "eligible")] + Eligible, + #[serde(rename = "professional")] + Professional, + #[serde(rename = "platforms")] + Platforms, + #[serde(rename = "testProfessional")] + TestProfessional, + #[serde(rename = "premium")] + Premium, + #[serde(rename = "ultimate")] + Ultimate, + #[serde(rename = "enterprise")] + Enterprise, + } + #[doc = "User status in the account"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "none")] + None, + #[serde(rename = "active")] + Active, + #[serde(rename = "disabled")] + Disabled, + #[serde(rename = "deleted")] + Deleted, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "expired")] + Expired, + #[serde(rename = "pendingDisabled")] + PendingDisabled, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BaseOperationResult { - #[doc = "List of error codes paired with their corresponding error messages"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub errors: Vec<serde_json::Value>, - #[doc = "Success status of the operation"] - #[serde(rename = "isSuccess", default, skip_serializing_if = "Option::is_none")] - pub is_success: Option<bool>, + #[doc = "List of error codes paired with their corresponding error messages"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub errors: Vec<serde_json::Value>, + #[doc = "Success status of the operation"] + #[serde(rename = "isSuccess", default, skip_serializing_if = "Option::is_none")] + pub is_success: Option<bool>, } impl BaseOperationResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EntitlementBase { - #[doc = "License assigned to a user"] - #[serde( - rename = "accessLevel", - default, - skip_serializing_if = "Option::is_none" - )] - pub access_level: Option<AccessLevel>, - #[doc = "\\[Readonly\\] Date the member was added to the collection."] - #[serde( - rename = "dateCreated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_created: Option<time::OffsetDateTime>, - #[doc = "\\[Readonly\\] GroupEntitlements that this member belongs to."] - #[serde( - rename = "groupAssignments", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub group_assignments: Vec<GroupEntitlement>, - #[doc = "The unique identifier which matches the Id of the Identity associated with the GraphMember."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "\\[Readonly\\] Date the member last accessed the collection."] - #[serde( - rename = "lastAccessedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_accessed_date: Option<time::OffsetDateTime>, - #[doc = "Relation between a project and the member's effective permissions in that project."] - #[serde( - rename = "projectEntitlements", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub project_entitlements: Vec<ProjectEntitlement>, -} -impl EntitlementBase { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EntitlementOperationResultBase { - #[doc = "List of error codes paired with their corresponding error messages."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub errors: Vec<serde_json::Value>, - #[doc = "Success status of the operation."] - #[serde(rename = "isSuccess", default, skip_serializing_if = "Option::is_none")] - pub is_success: Option<bool>, - #[doc = "Resulting entitlement property. For specific implementations, see also: <seealso cref=\"T:Microsoft.VisualStudio.Services.MemberEntitlementManagement.WebApi.ServicePrincipalEntitlementOperationResult\" /><seealso cref=\"T:Microsoft.VisualStudio.Services.MemberEntitlementManagement.WebApi.UserEntitlementOperationResult\" />"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<String>, -} -impl EntitlementOperationResultBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An extension assigned to a user"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Extension { - #[doc = "Assignment source for this extension. I.e. explicitly assigned or from a group rule."] - #[serde( - rename = "assignmentSource", - default, - skip_serializing_if = "Option::is_none" - )] - pub assignment_source: Option<extension::AssignmentSource>, - #[doc = "Gallery Id of the Extension."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Friendly name of this extension."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Source of this extension assignment. Ex: msdn, account, none, etc."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<extension::Source>, + #[doc = "Assignment source for this extension. I.e. explicitly assigned or from a group rule."] + #[serde( + rename = "assignmentSource", + default, + skip_serializing_if = "Option::is_none" + )] + pub assignment_source: Option<extension::AssignmentSource>, + #[doc = "Gallery Id of the Extension."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Friendly name of this extension."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Source of this extension assignment. Ex: msdn, account, none, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<extension::Source>, } impl Extension { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod extension { - use super::*; - #[doc = "Assignment source for this extension. I.e. explicitly assigned or from a group rule."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AssignmentSource { - #[serde(rename = "none")] - None, - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "groupRule")] - GroupRule, - } - #[doc = "Source of this extension assignment. Ex: msdn, account, none, etc."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Source { - #[serde(rename = "none")] - None, - #[serde(rename = "account")] - Account, - #[serde(rename = "msdn")] - Msdn, - #[serde(rename = "profile")] - Profile, - #[serde(rename = "auto")] - Auto, - #[serde(rename = "trial")] - Trial, - } + use super::*; + #[doc = "Assignment source for this extension. I.e. explicitly assigned or from a group rule."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AssignmentSource { + #[serde(rename = "none")] + None, + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "groupRule")] + GroupRule, + } + #[doc = "Source of this extension assignment. Ex: msdn, account, none, etc."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Source { + #[serde(rename = "none")] + None, + #[serde(rename = "account")] + Account, + #[serde(rename = "msdn")] + Msdn, + #[serde(rename = "profile")] + Profile, + #[serde(rename = "auto")] + Auto, + #[serde(rename = "trial")] + Trial, + } } #[doc = "Summary of Extensions in the organization."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExtensionSummaryData { - #[serde(flatten)] - pub summary_data: SummaryData, - #[doc = "Count of Extension Licenses assigned to users through msdn."] - #[serde( - rename = "assignedThroughSubscription", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_through_subscription: Option<i32>, - #[doc = "Gallery Id of the Extension"] - #[serde( - rename = "extensionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_id: Option<String>, - #[doc = "Friendly name of this extension"] - #[serde( - rename = "extensionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_name: Option<String>, - #[doc = "Whether its a Trial Version."] - #[serde( - rename = "isTrialVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_trial_version: Option<bool>, - #[doc = "Minimum License Required for the Extension."] - #[serde( - rename = "minimumLicenseRequired", - default, - skip_serializing_if = "Option::is_none" - )] - pub minimum_license_required: Option<extension_summary_data::MinimumLicenseRequired>, - #[doc = "Days remaining for the Trial to expire."] - #[serde( - rename = "remainingTrialDays", - default, - skip_serializing_if = "Option::is_none" - )] - pub remaining_trial_days: Option<i32>, - #[doc = "Date on which the Trial expires."] - #[serde( - rename = "trialExpiryDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub trial_expiry_date: Option<time::OffsetDateTime>, + #[serde(flatten)] + pub summary_data: SummaryData, + #[doc = "Count of Extension Licenses assigned to users through msdn."] + #[serde( + rename = "assignedThroughSubscription", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_through_subscription: Option<i32>, + #[doc = "Gallery Id of the Extension"] + #[serde( + rename = "extensionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_id: Option<String>, + #[doc = "Friendly name of this extension"] + #[serde( + rename = "extensionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_name: Option<String>, + #[doc = "Whether its a Trial Version."] + #[serde( + rename = "isTrialVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_trial_version: Option<bool>, + #[doc = "Minimum License Required for the Extension."] + #[serde( + rename = "minimumLicenseRequired", + default, + skip_serializing_if = "Option::is_none" + )] + pub minimum_license_required: Option<extension_summary_data::MinimumLicenseRequired>, + #[doc = "Days remaining for the Trial to expire."] + #[serde( + rename = "remainingTrialDays", + default, + skip_serializing_if = "Option::is_none" + )] + pub remaining_trial_days: Option<i32>, + #[doc = "Date on which the Trial expires."] + #[serde( + rename = "trialExpiryDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub trial_expiry_date: Option<time::OffsetDateTime>, } impl ExtensionSummaryData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod extension_summary_data { - use super::*; - #[doc = "Minimum License Required for the Extension."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum MinimumLicenseRequired { - #[serde(rename = "none")] - None, - #[serde(rename = "express")] - Express, - #[serde(rename = "advanced")] - Advanced, - #[serde(rename = "advancedPlus")] - AdvancedPlus, - #[serde(rename = "stakeholder")] - Stakeholder, - } + use super::*; + #[doc = "Minimum License Required for the Extension."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum MinimumLicenseRequired { + #[serde(rename = "none")] + None, + #[serde(rename = "express")] + Express, + #[serde(rename = "advanced")] + Advanced, + #[serde(rename = "advancedPlus")] + AdvancedPlus, + #[serde(rename = "stakeholder")] + Stakeholder, + } } #[doc = "Graph group entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphGroup { - #[serde(flatten)] - pub graph_member: GraphMember, - #[doc = "A short phrase to help human readers disambiguate groups with similar names"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, + #[serde(flatten)] + pub graph_member: GraphMember, + #[doc = "A short phrase to help human readers disambiguate groups with similar names"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, } impl GraphGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphMember { - #[serde(flatten)] - pub graph_subject: GraphSubject, - #[doc = "This represents the name of the container of origin for a graph member. (For MSA this is \"Windows Live ID\", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub domain: Option<String>, - #[doc = "The email address of record for a given graph member. This may be different than the principal name."] - #[serde( - rename = "mailAddress", - default, - skip_serializing_if = "Option::is_none" - )] - pub mail_address: Option<String>, - #[doc = "This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS."] - #[serde( - rename = "principalName", - default, - skip_serializing_if = "Option::is_none" - )] - pub principal_name: Option<String>, + #[serde(flatten)] + pub graph_subject: GraphSubject, + #[doc = "This represents the name of the container of origin for a graph member. (For MSA this is \"Windows Live ID\", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub domain: Option<String>, + #[doc = "The email address of record for a given graph member. This may be different than the principal name."] + #[serde( + rename = "mailAddress", + default, + skip_serializing_if = "Option::is_none" + )] + pub mail_address: Option<String>, + #[doc = "This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS."] + #[serde( + rename = "principalName", + default, + skip_serializing_if = "Option::is_none" + )] + pub principal_name: Option<String>, } impl GraphMember { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GraphServicePrincipal { - #[serde(flatten)] - pub aad_graph_member: AadGraphMember, - #[serde( - rename = "applicationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub application_id: Option<String>, -} -impl GraphServicePrincipal { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Top-level graph entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubject { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "[Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor."] - #[serde( - rename = "legacyDescriptor", - default, - skip_serializing_if = "Option::is_none" - )] - pub legacy_descriptor: Option<String>, - #[doc = "The type of source provider for the origin identifier (ex:AD, AAD, MSA)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub origin: Option<String>, - #[doc = "The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider."] - #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] - pub origin_id: Option<String>, - #[doc = "This field identifies the type of the graph subject (ex: Group, Scope, User)."] - #[serde( - rename = "subjectKind", - default, - skip_serializing_if = "Option::is_none" - )] - pub subject_kind: Option<String>, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "[Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor."] + #[serde( + rename = "legacyDescriptor", + default, + skip_serializing_if = "Option::is_none" + )] + pub legacy_descriptor: Option<String>, + #[doc = "The type of source provider for the origin identifier (ex:AD, AAD, MSA)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option<String>, + #[doc = "The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider."] + #[serde(rename = "originId", default, skip_serializing_if = "Option::is_none")] + pub origin_id: Option<String>, + #[doc = "This field identifies the type of the graph subject (ex: Group, Scope, User)."] + #[serde( + rename = "subjectKind", + default, + skip_serializing_if = "Option::is_none" + )] + pub subject_kind: Option<String>, } impl GraphSubject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = ""] +#[doc = "Graph user entity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphUser { - #[serde(flatten)] - pub aad_graph_member: AadGraphMember, + #[serde(flatten)] + pub graph_member: GraphMember, + #[doc = "The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle."] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + #[doc = "When true, the group has been deleted in the identity provider"] + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "The meta type of the user in the origin, such as \"member\", \"guest\", etc. See UserMetaType for the set of possible values."] + #[serde(rename = "metaType", default, skip_serializing_if = "Option::is_none")] + pub meta_type: Option<String>, } impl GraphUser { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Project Group (e.g. Contributor, Reader etc.)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Group { - #[doc = "Display Name of the Group"] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Group Type"] - #[serde(rename = "groupType", default, skip_serializing_if = "Option::is_none")] - pub group_type: Option<group::GroupType>, + #[doc = "Display Name of the Group"] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Group Type"] + #[serde(rename = "groupType", default, skip_serializing_if = "Option::is_none")] + pub group_type: Option<group::GroupType>, } impl Group { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod group { - use super::*; - #[doc = "Group Type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum GroupType { - #[serde(rename = "projectStakeholder")] - ProjectStakeholder, - #[serde(rename = "projectReader")] - ProjectReader, - #[serde(rename = "projectContributor")] - ProjectContributor, - #[serde(rename = "projectAdministrator")] - ProjectAdministrator, - #[serde(rename = "custom")] - Custom, - } + use super::*; + #[doc = "Group Type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum GroupType { + #[serde(rename = "projectStakeholder")] + ProjectStakeholder, + #[serde(rename = "projectReader")] + ProjectReader, + #[serde(rename = "projectContributor")] + ProjectContributor, + #[serde(rename = "projectAdministrator")] + ProjectAdministrator, + #[serde(rename = "custom")] + Custom, + } } #[doc = "A group entity with additional properties including its license, extensions, and project membership"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GroupEntitlement { - #[doc = "Graph group entity"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub group: Option<GraphGroup>, - #[doc = "The unique identifier which matches the Id of the GraphMember."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "\\[Readonly\\] The last time the group licensing rule was executed (regardless of whether any changes were made)."] - #[serde( - rename = "lastExecuted", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_executed: Option<time::OffsetDateTime>, - #[doc = "License assigned to a user"] - #[serde( - rename = "licenseRule", - default, - skip_serializing_if = "Option::is_none" - )] - pub license_rule: Option<AccessLevel>, - #[doc = "Group members. Only used when creating a new group."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub members: Vec<UserEntitlement>, - #[doc = "Relation between a project and the member's effective permissions in that project."] - #[serde( - rename = "projectEntitlements", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub project_entitlements: Vec<ProjectEntitlement>, - #[doc = "The status of the group rule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<group_entitlement::Status>, + #[doc = "Graph group entity"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option<GraphGroup>, + #[doc = "The unique identifier which matches the Id of the GraphMember."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "\\[Readonly\\] The last time the group licensing rule was executed (regardless of whether any changes were made)."] + #[serde( + rename = "lastExecuted", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_executed: Option<time::OffsetDateTime>, + #[doc = "License assigned to a user"] + #[serde( + rename = "licenseRule", + default, + skip_serializing_if = "Option::is_none" + )] + pub license_rule: Option<AccessLevel>, + #[doc = "Group members. Only used when creating a new group."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub members: Vec<UserEntitlement>, + #[doc = "Relation between a project and the member's effective permissions in that project."] + #[serde( + rename = "projectEntitlements", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub project_entitlements: Vec<ProjectEntitlement>, + #[doc = "The status of the group rule."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<group_entitlement::Status>, } impl GroupEntitlement { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod group_entitlement { - use super::*; - #[doc = "The status of the group rule."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "applyPending")] - ApplyPending, - #[serde(rename = "applied")] - Applied, - #[serde(rename = "incompatible")] - Incompatible, - #[serde(rename = "unableToApply")] - UnableToApply, - } + use super::*; + #[doc = "The status of the group rule."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "applyPending")] + ApplyPending, + #[serde(rename = "applied")] + Applied, + #[serde(rename = "incompatible")] + Incompatible, + #[serde(rename = "unableToApply")] + UnableToApply, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GroupEntitlementList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<GroupEntitlement>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<GroupEntitlement>, } impl GroupEntitlementList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GroupEntitlementOperationReference { - #[serde(flatten)] - pub operation_reference: OperationReference, - #[doc = "Operation completed with success or failure."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub completed: Option<bool>, - #[doc = "True if all operations were successful."] - #[serde( - rename = "haveResultsSucceeded", - default, - skip_serializing_if = "Option::is_none" - )] - pub have_results_succeeded: Option<bool>, - #[doc = "List of results for each operation."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<GroupOperationResult>, + #[serde(flatten)] + pub operation_reference: OperationReference, + #[doc = "Operation completed with success or failure."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub completed: Option<bool>, + #[doc = "True if all operations were successful."] + #[serde( + rename = "haveResultsSucceeded", + default, + skip_serializing_if = "Option::is_none" + )] + pub have_results_succeeded: Option<bool>, + #[doc = "List of results for each operation."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<GroupOperationResult>, } impl GroupEntitlementOperationReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GroupOperationResult { - #[serde(flatten)] - pub base_operation_result: BaseOperationResult, - #[doc = "Identifier of the Group being acted upon"] - #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] - pub group_id: Option<String>, - #[doc = "A group entity with additional properties including its license, extensions, and project membership"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<GroupEntitlement>, + #[serde(flatten)] + pub base_operation_result: BaseOperationResult, + #[doc = "Identifier of the Group being acted upon"] + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option<String>, + #[doc = "A group entity with additional properties including its license, extensions, and project membership"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<GroupEntitlement>, } impl GroupOperationResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Group option to add a user to"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GroupOption { - #[doc = "License assigned to a user"] - #[serde( - rename = "accessLevel", - default, - skip_serializing_if = "Option::is_none" - )] - pub access_level: Option<AccessLevel>, - #[doc = "Project Group (e.g. Contributor, Reader etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub group: Option<Group>, + #[doc = "License assigned to a user"] + #[serde( + rename = "accessLevel", + default, + skip_serializing_if = "Option::is_none" + )] + pub access_level: Option<AccessLevel>, + #[doc = "Project Group (e.g. Contributor, Reader etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option<Group>, } impl GroupOption { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for JSON Patch Operations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchDocument {} impl JsonPatchDocument { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for a JSON Patch operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchOperation { - #[doc = "The path to copy from for the Move/Copy operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub from: Option<String>, - #[doc = "The patch operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub op: Option<json_patch_operation::Op>, - #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "The value for the operation. This is either a primitive or a JToken."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = "The path to copy from for the Move/Copy operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub from: Option<String>, + #[doc = "The patch operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub op: Option<json_patch_operation::Op>, + #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "The value for the operation. This is either a primitive or a JToken."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl JsonPatchOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod json_patch_operation { - use super::*; - #[doc = "The patch operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Op { - #[serde(rename = "add")] - Add, - #[serde(rename = "remove")] - Remove, - #[serde(rename = "replace")] - Replace, - #[serde(rename = "move")] - Move, - #[serde(rename = "copy")] - Copy, - #[serde(rename = "test")] - Test, - } + use super::*; + #[doc = "The patch operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Op { + #[serde(rename = "add")] + Add, + #[serde(rename = "remove")] + Remove, + #[serde(rename = "replace")] + Replace, + #[serde(rename = "move")] + Move, + #[serde(rename = "copy")] + Copy, + #[serde(rename = "test")] + Test, + } } #[doc = "Summary of Licenses in the organization."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LicenseSummaryData { - #[serde(flatten)] - pub summary_data: SummaryData, - #[doc = "Type of Account License. To use the AccountLicenseType, LicensingSource should be defined as 'account' in the request body."] - #[serde( - rename = "accountLicenseType", - default, - skip_serializing_if = "Option::is_none" - )] - pub account_license_type: Option<license_summary_data::AccountLicenseType>, - #[doc = "Count of Disabled Licenses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub disabled: Option<i32>, - #[doc = "Designates if this license quantity can be changed through purchase"] - #[serde( - rename = "isPurchasable", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_purchasable: Option<bool>, - #[doc = "Name of the License."] - #[serde( - rename = "licenseName", - default, - skip_serializing_if = "Option::is_none" - )] - pub license_name: Option<String>, - #[doc = "Type of MSDN License. To use the MsdnLicenseType, LicensingSource should be defined as 'msdn' in the request body."] - #[serde( - rename = "msdnLicenseType", - default, - skip_serializing_if = "Option::is_none" - )] - pub msdn_license_type: Option<license_summary_data::MsdnLicenseType>, - #[doc = "Specifies the date when billing will charge for paid licenses"] - #[serde( - rename = "nextBillingDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub next_billing_date: Option<time::OffsetDateTime>, - #[doc = "Source of the License."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<license_summary_data::Source>, - #[doc = "Total license count after next billing cycle"] - #[serde( - rename = "totalAfterNextBillingDate", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_after_next_billing_date: Option<i32>, + #[serde(flatten)] + pub summary_data: SummaryData, + #[doc = "Type of Account License."] + #[serde( + rename = "accountLicenseType", + default, + skip_serializing_if = "Option::is_none" + )] + pub account_license_type: Option<license_summary_data::AccountLicenseType>, + #[doc = "Count of Disabled Licenses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub disabled: Option<i32>, + #[doc = "Designates if this license quantity can be changed through purchase"] + #[serde( + rename = "isPurchasable", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_purchasable: Option<bool>, + #[doc = "Name of the License."] + #[serde( + rename = "licenseName", + default, + skip_serializing_if = "Option::is_none" + )] + pub license_name: Option<String>, + #[doc = "Type of MSDN License."] + #[serde( + rename = "msdnLicenseType", + default, + skip_serializing_if = "Option::is_none" + )] + pub msdn_license_type: Option<license_summary_data::MsdnLicenseType>, + #[doc = "Specifies the date when billing will charge for paid licenses"] + #[serde( + rename = "nextBillingDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub next_billing_date: Option<time::OffsetDateTime>, + #[doc = "Source of the License."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<license_summary_data::Source>, + #[doc = "Total license count after next billing cycle"] + #[serde( + rename = "totalAfterNextBillingDate", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_after_next_billing_date: Option<i32>, } impl LicenseSummaryData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod license_summary_data { - use super::*; - #[doc = "Type of Account License. To use the AccountLicenseType, LicensingSource should be defined as 'account' in the request body."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AccountLicenseType { - #[serde(rename = "none")] - None, - #[serde(rename = "earlyAdopter")] - EarlyAdopter, - #[serde(rename = "express")] - Express, - #[serde(rename = "professional")] - Professional, - #[serde(rename = "advanced")] - Advanced, - #[serde(rename = "stakeholder")] - Stakeholder, - } - #[doc = "Type of MSDN License. To use the MsdnLicenseType, LicensingSource should be defined as 'msdn' in the request body."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum MsdnLicenseType { - #[serde(rename = "none")] - None, - #[serde(rename = "eligible")] - Eligible, - #[serde(rename = "professional")] - Professional, - #[serde(rename = "platforms")] - Platforms, - #[serde(rename = "testProfessional")] - TestProfessional, - #[serde(rename = "premium")] - Premium, - #[serde(rename = "ultimate")] - Ultimate, - #[serde(rename = "enterprise")] - Enterprise, - } - #[doc = "Source of the License."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Source { - #[serde(rename = "none")] - None, - #[serde(rename = "account")] - Account, - #[serde(rename = "msdn")] - Msdn, - #[serde(rename = "profile")] - Profile, - #[serde(rename = "auto")] - Auto, - #[serde(rename = "trial")] - Trial, - } + use super::*; + #[doc = "Type of Account License."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AccountLicenseType { + #[serde(rename = "none")] + None, + #[serde(rename = "earlyAdopter")] + EarlyAdopter, + #[serde(rename = "express")] + Express, + #[serde(rename = "professional")] + Professional, + #[serde(rename = "advanced")] + Advanced, + #[serde(rename = "stakeholder")] + Stakeholder, + } + #[doc = "Type of MSDN License."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum MsdnLicenseType { + #[serde(rename = "none")] + None, + #[serde(rename = "eligible")] + Eligible, + #[serde(rename = "professional")] + Professional, + #[serde(rename = "platforms")] + Platforms, + #[serde(rename = "testProfessional")] + TestProfessional, + #[serde(rename = "premium")] + Premium, + #[serde(rename = "ultimate")] + Ultimate, + #[serde(rename = "enterprise")] + Enterprise, + } + #[doc = "Source of the License."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Source { + #[serde(rename = "none")] + None, + #[serde(rename = "account")] + Account, + #[serde(rename = "msdn")] + Msdn, + #[serde(rename = "profile")] + Profile, + #[serde(rename = "auto")] + Auto, + #[serde(rename = "trial")] + Trial, + } } #[doc = "Deprecated: Use UserEntitlement instead"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MemberEntitlement { - #[serde(flatten)] - pub user_entitlement: UserEntitlement, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub member: Option<GraphMember>, + #[serde(flatten)] + pub user_entitlement: UserEntitlement, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub member: Option<GraphMember>, } impl MemberEntitlement { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An AAD member entity"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MemberEntitlement2 { - #[serde(flatten)] - pub entitlement_base: EntitlementBase, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub member: Option<AadGraphMember>, -} -impl MemberEntitlement2 { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MemberEntitlement2OperationReference { - #[serde(flatten)] - pub operation_reference: OperationReference, - #[doc = "Operation completed with success or failure."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub completed: Option<bool>, - #[doc = "True if all operations were successful."] - #[serde( - rename = "haveResultsSucceeded", - default, - skip_serializing_if = "Option::is_none" - )] - pub have_results_succeeded: Option<bool>, - #[doc = "List of results for each operation."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<MemberEntitlement2OperationResult>, -} -impl MemberEntitlement2OperationReference { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MemberEntitlement2OperationResult { - #[serde(flatten)] - pub entitlement_operation_result_base: EntitlementOperationResultBase, - #[doc = "Identifier of the Member being acted upon."] - #[serde(rename = "memberId", default, skip_serializing_if = "Option::is_none")] - pub member_id: Option<String>, -} -impl MemberEntitlement2OperationResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MemberEntitlement2PatchResponse { - #[serde(flatten)] - pub member_entitlement2_response_base: MemberEntitlement2ResponseBase, - #[doc = "List of results for each operation"] - #[serde( - rename = "operationResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub operation_results: Vec<MemberEntitlement2OperationResult>, -} -impl MemberEntitlement2PatchResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MemberEntitlement2PostResponse { - #[serde(flatten)] - pub member_entitlement2_response_base: MemberEntitlement2ResponseBase, - #[doc = ""] - #[serde( - rename = "operationResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_result: Option<MemberEntitlement2OperationResult>, -} -impl MemberEntitlement2PostResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MemberEntitlement2ResponseBase { - #[doc = "True if all operations were successful."] - #[serde(rename = "isSuccess", default, skip_serializing_if = "Option::is_none")] - pub is_success: Option<bool>, - #[doc = "An AAD member entity"] - #[serde( - rename = "memberEntitlement", - default, - skip_serializing_if = "Option::is_none" - )] - pub member_entitlement: Option<MemberEntitlement2>, -} -impl MemberEntitlement2ResponseBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MemberEntitlementOperationReference { - #[serde(flatten)] - pub operation_reference: OperationReference, - #[doc = "Operation completed with success or failure"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub completed: Option<bool>, - #[doc = "True if all operations were successful"] - #[serde( - rename = "haveResultsSucceeded", - default, - skip_serializing_if = "Option::is_none" - )] - pub have_results_succeeded: Option<bool>, - #[doc = "List of results for each operation"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<OperationResult>, + #[serde(flatten)] + pub operation_reference: OperationReference, + #[doc = "Operation completed with success or failure"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub completed: Option<bool>, + #[doc = "True if all operations were successful"] + #[serde( + rename = "haveResultsSucceeded", + default, + skip_serializing_if = "Option::is_none" + )] + pub have_results_succeeded: Option<bool>, + #[doc = "List of results for each operation"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<OperationResult>, } impl MemberEntitlementOperationReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MemberEntitlementsPatchResponse { - #[serde(flatten)] - pub member_entitlements_response_base: MemberEntitlementsResponseBase, - #[doc = "List of results for each operation"] - #[serde( - rename = "operationResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub operation_results: Vec<OperationResult>, + #[serde(flatten)] + pub member_entitlements_response_base: MemberEntitlementsResponseBase, + #[doc = "List of results for each operation"] + #[serde( + rename = "operationResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub operation_results: Vec<OperationResult>, } impl MemberEntitlementsPatchResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MemberEntitlementsPostResponse { - #[serde(flatten)] - pub member_entitlements_response_base: MemberEntitlementsResponseBase, - #[doc = ""] - #[serde( - rename = "operationResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_result: Option<OperationResult>, + #[serde(flatten)] + pub member_entitlements_response_base: MemberEntitlementsResponseBase, + #[doc = ""] + #[serde( + rename = "operationResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_result: Option<OperationResult>, } impl MemberEntitlementsPostResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MemberEntitlementsResponseBase { - #[doc = "True if all operations were successful."] - #[serde(rename = "isSuccess", default, skip_serializing_if = "Option::is_none")] - pub is_success: Option<bool>, - #[doc = "Deprecated: Use UserEntitlement instead"] - #[serde( - rename = "memberEntitlement", - default, - skip_serializing_if = "Option::is_none" - )] - pub member_entitlement: Option<MemberEntitlement>, + #[doc = "True if all operations were successful."] + #[serde(rename = "isSuccess", default, skip_serializing_if = "Option::is_none")] + pub is_success: Option<bool>, + #[doc = "Deprecated: Use UserEntitlement instead"] + #[serde( + rename = "memberEntitlement", + default, + skip_serializing_if = "Option::is_none" + )] + pub member_entitlement: Option<MemberEntitlement>, } impl MemberEntitlementsResponseBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference for an async operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationReference { - #[doc = "Unique identifier for the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Unique identifier for the plugin."] - #[serde(rename = "pluginId", default, skip_serializing_if = "Option::is_none")] - pub plugin_id: Option<String>, - #[doc = "The current status of the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<operation_reference::Status>, - #[doc = "URL to get the full operation object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Unique identifier for the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Unique identifier for the plugin."] + #[serde(rename = "pluginId", default, skip_serializing_if = "Option::is_none")] + pub plugin_id: Option<String>, + #[doc = "The current status of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<operation_reference::Status>, + #[doc = "URL to get the full operation object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl OperationReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod operation_reference { - use super::*; - #[doc = "The current status of the operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "notSet")] - NotSet, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "cancelled")] - Cancelled, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - } + use super::*; + #[doc = "The current status of the operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "notSet")] + NotSet, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "cancelled")] + Cancelled, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationResult { - #[doc = "List of error codes paired with their corresponding error messages."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub errors: Vec<serde_json::Value>, - #[doc = "Success status of the operation."] - #[serde(rename = "isSuccess", default, skip_serializing_if = "Option::is_none")] - pub is_success: Option<bool>, - #[doc = "Identifier of the Member being acted upon."] - #[serde(rename = "memberId", default, skip_serializing_if = "Option::is_none")] - pub member_id: Option<String>, - #[doc = "Deprecated: Use UserEntitlement instead"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<MemberEntitlement>, + #[doc = "List of error codes paired with their corresponding error messages."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub errors: Vec<serde_json::Value>, + #[doc = "Success status of the operation."] + #[serde(rename = "isSuccess", default, skip_serializing_if = "Option::is_none")] + pub is_success: Option<bool>, + #[doc = "Identifier of the Member being acted upon."] + #[serde(rename = "memberId", default, skip_serializing_if = "Option::is_none")] + pub member_id: Option<String>, + #[doc = "Deprecated: Use UserEntitlement instead"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<MemberEntitlement>, } impl OperationResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A page of users"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PagedGraphMemberList { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub members: Vec<UserEntitlement>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub members: Vec<UserEntitlement>, } impl PagedGraphMemberList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Relation between a project and the user's effective permissions in that project."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectEntitlement { - #[doc = "Assignment Source (e.g. Group or Unknown)."] - #[serde( - rename = "assignmentSource", - default, - skip_serializing_if = "Option::is_none" - )] - pub assignment_source: Option<project_entitlement::AssignmentSource>, - #[doc = "Project Group (e.g. Contributor, Reader etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub group: Option<Group>, - #[doc = "Whether the user is inheriting permissions to a project through a Azure DevOps or AAD group membership."] - #[serde( - rename = "projectPermissionInherited", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_permission_inherited: Option<project_entitlement::ProjectPermissionInherited>, - #[doc = "A reference to a project"] - #[serde( - rename = "projectRef", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_ref: Option<ProjectRef>, - #[doc = "Team Ref."] - #[serde( - rename = "teamRefs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub team_refs: Vec<TeamRef>, + #[doc = "Assignment Source (e.g. Group or Unknown)."] + #[serde( + rename = "assignmentSource", + default, + skip_serializing_if = "Option::is_none" + )] + pub assignment_source: Option<project_entitlement::AssignmentSource>, + #[doc = "Project Group (e.g. Contributor, Reader etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option<Group>, + #[doc = "Whether the user is inheriting permissions to a project through a Azure DevOps or AAD group membership."] + #[serde( + rename = "projectPermissionInherited", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_permission_inherited: Option<project_entitlement::ProjectPermissionInherited>, + #[doc = "A reference to a project"] + #[serde( + rename = "projectRef", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_ref: Option<ProjectRef>, + #[doc = "Team Ref."] + #[serde( + rename = "teamRefs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub team_refs: Vec<TeamRef>, } impl ProjectEntitlement { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod project_entitlement { - use super::*; - #[doc = "Assignment Source (e.g. Group or Unknown)."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AssignmentSource { - #[serde(rename = "none")] - None, - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "groupRule")] - GroupRule, - } - #[doc = "Whether the user is inheriting permissions to a project through a Azure DevOps or AAD group membership."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ProjectPermissionInherited { - #[serde(rename = "notSet")] - NotSet, - #[serde(rename = "notInherited")] - NotInherited, - #[serde(rename = "inherited")] - Inherited, - } + use super::*; + #[doc = "Assignment Source (e.g. Group or Unknown)."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AssignmentSource { + #[serde(rename = "none")] + None, + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "groupRule")] + GroupRule, + } + #[doc = "Whether the user is inheriting permissions to a project through a Azure DevOps or AAD group membership."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ProjectPermissionInherited { + #[serde(rename = "notSet")] + NotSet, + #[serde(rename = "notInherited")] + NotInherited, + #[serde(rename = "inherited")] + Inherited, + } } #[doc = "A reference to a project"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectRef { - #[doc = "Project ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Project Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Project ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Project Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ProjectRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServicePrincipalEntitlement { - #[serde(flatten)] - pub entitlement_base: EntitlementBase, - #[doc = ""] - #[serde( - rename = "servicePrincipal", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_principal: Option<GraphServicePrincipal>, -} -impl ServicePrincipalEntitlement { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServicePrincipalEntitlementOperationReference { - #[serde(flatten)] - pub operation_reference: OperationReference, - #[doc = "Operation completed with success or failure."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub completed: Option<bool>, - #[doc = "True if all operations were successful."] - #[serde( - rename = "haveResultsSucceeded", - default, - skip_serializing_if = "Option::is_none" - )] - pub have_results_succeeded: Option<bool>, - #[doc = "List of results for each operation."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<ServicePrincipalEntitlementOperationResult>, -} -impl ServicePrincipalEntitlementOperationReference { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServicePrincipalEntitlementOperationResult { - #[serde(flatten)] - pub entitlement_operation_result_base: EntitlementOperationResultBase, - #[doc = "Identifier of the ServicePrincipal being acted upon."] - #[serde( - rename = "servicePrincipalId", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_principal_id: Option<String>, -} -impl ServicePrincipalEntitlementOperationResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServicePrincipalEntitlementsPatchResponse { - #[serde(flatten)] - pub service_principal_entitlements_response_base: ServicePrincipalEntitlementsResponseBase, - #[serde( - rename = "operationResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub operation_results: Vec<ServicePrincipalEntitlementOperationResult>, -} -impl ServicePrincipalEntitlementsPatchResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServicePrincipalEntitlementsPostResponse { - #[serde(flatten)] - pub service_principal_entitlements_response_base: ServicePrincipalEntitlementsResponseBase, - #[doc = ""] - #[serde( - rename = "operationResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_result: Option<ServicePrincipalEntitlementOperationResult>, -} -impl ServicePrincipalEntitlementsPostResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServicePrincipalEntitlementsResponseBase { - #[serde(rename = "isSuccess", default, skip_serializing_if = "Option::is_none")] - pub is_success: Option<bool>, - #[doc = ""] - #[serde( - rename = "servicePrincipalEntitlement", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_principal_entitlement: Option<ServicePrincipalEntitlement>, -} -impl ServicePrincipalEntitlementsResponseBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SummaryData { - #[doc = "Count of Licenses already assigned."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub assigned: Option<i32>, - #[doc = "Available Count."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub available: Option<i32>, - #[doc = "Quantity"] - #[serde( - rename = "includedQuantity", - default, - skip_serializing_if = "Option::is_none" - )] - pub included_quantity: Option<i32>, - #[doc = "Total Count."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total: Option<i32>, + #[doc = "Count of Licenses already assigned."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub assigned: Option<i32>, + #[doc = "Available Count."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub available: Option<i32>, + #[doc = "Quantity"] + #[serde( + rename = "includedQuantity", + default, + skip_serializing_if = "Option::is_none" + )] + pub included_quantity: Option<i32>, + #[doc = "Total Count."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total: Option<i32>, } impl SummaryData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A reference to a team"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamRef { - #[doc = "Team ID"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Team Name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Team ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Team Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TeamRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A user entity with additional properties including their license, extensions, and project membership"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserEntitlement { - #[serde(flatten)] - pub entitlement_base: EntitlementBase, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub user: Option<GraphUser>, + #[doc = "License assigned to a user"] + #[serde( + rename = "accessLevel", + default, + skip_serializing_if = "Option::is_none" + )] + pub access_level: Option<AccessLevel>, + #[doc = "\\[Readonly\\] Date the user was added to the collection."] + #[serde( + rename = "dateCreated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_created: Option<time::OffsetDateTime>, + #[doc = "\\[Readonly\\] GroupEntitlements that this user belongs to."] + #[serde( + rename = "groupAssignments", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub group_assignments: Vec<GroupEntitlement>, + #[doc = "The unique identifier which matches the Id of the Identity associated with the GraphMember."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "\\[Readonly\\] Date the user last accessed the collection."] + #[serde( + rename = "lastAccessedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_accessed_date: Option<time::OffsetDateTime>, + #[doc = "Relation between a project and the user's effective permissions in that project."] + #[serde( + rename = "projectEntitlements", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub project_entitlements: Vec<ProjectEntitlement>, + #[doc = "Graph user entity"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub user: Option<GraphUser>, } impl UserEntitlement { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserEntitlementOperationReference { - #[serde(flatten)] - pub operation_reference: OperationReference, - #[doc = "Operation completed with success or failure."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub completed: Option<bool>, - #[doc = "True if all operations were successful."] - #[serde( - rename = "haveResultsSucceeded", - default, - skip_serializing_if = "Option::is_none" - )] - pub have_results_succeeded: Option<bool>, - #[doc = "List of results for each operation."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<UserEntitlementOperationResult>, + #[serde(flatten)] + pub operation_reference: OperationReference, + #[doc = "Operation completed with success or failure."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub completed: Option<bool>, + #[doc = "True if all operations were successful."] + #[serde( + rename = "haveResultsSucceeded", + default, + skip_serializing_if = "Option::is_none" + )] + pub have_results_succeeded: Option<bool>, + #[doc = "List of results for each operation."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<UserEntitlementOperationResult>, } impl UserEntitlementOperationReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserEntitlementOperationResult { - #[serde(flatten)] - pub entitlement_operation_result_base: EntitlementOperationResultBase, - #[doc = "Identifier of the Member being acted upon."] - #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] - pub user_id: Option<String>, + #[doc = "List of error codes paired with their corresponding error messages."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub errors: Vec<serde_json::Value>, + #[doc = "Success status of the operation."] + #[serde(rename = "isSuccess", default, skip_serializing_if = "Option::is_none")] + pub is_success: Option<bool>, + #[doc = "A user entity with additional properties including their license, extensions, and project membership"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<UserEntitlement>, + #[doc = "Identifier of the Member being acted upon."] + #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] + pub user_id: Option<String>, } impl UserEntitlementOperationResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserEntitlementsPatchResponse { - #[serde(flatten)] - pub user_entitlements_response_base: UserEntitlementsResponseBase, - #[doc = "List of results for each operation."] - #[serde( - rename = "operationResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub operation_results: Vec<UserEntitlementOperationResult>, + #[serde(flatten)] + pub user_entitlements_response_base: UserEntitlementsResponseBase, + #[doc = "List of results for each operation."] + #[serde( + rename = "operationResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub operation_results: Vec<UserEntitlementOperationResult>, } impl UserEntitlementsPatchResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserEntitlementsPostResponse { - #[serde(flatten)] - pub user_entitlements_response_base: UserEntitlementsResponseBase, - #[doc = ""] - #[serde( - rename = "operationResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_result: Option<UserEntitlementOperationResult>, + #[serde(flatten)] + pub user_entitlements_response_base: UserEntitlementsResponseBase, + #[doc = ""] + #[serde( + rename = "operationResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_result: Option<UserEntitlementOperationResult>, } impl UserEntitlementsPostResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserEntitlementsResponseBase { - #[doc = "True if all operations were successful."] - #[serde(rename = "isSuccess", default, skip_serializing_if = "Option::is_none")] - pub is_success: Option<bool>, - #[doc = "A user entity with additional properties including their license, extensions, and project membership"] - #[serde( - rename = "userEntitlement", - default, - skip_serializing_if = "Option::is_none" - )] - pub user_entitlement: Option<UserEntitlement>, + #[doc = "True if all operations were successful."] + #[serde(rename = "isSuccess", default, skip_serializing_if = "Option::is_none")] + pub is_success: Option<bool>, + #[doc = "A user entity with additional properties including their license, extensions, and project membership"] + #[serde( + rename = "userEntitlement", + default, + skip_serializing_if = "Option::is_none" + )] + pub user_entitlement: Option<UserEntitlement>, } impl UserEntitlementsResponseBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Summary of licenses and extensions assigned to users in the organization"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UsersSummary { - #[doc = "Available Access Levels"] - #[serde( - rename = "availableAccessLevels", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub available_access_levels: Vec<AccessLevel>, - #[doc = "License assigned to a user"] - #[serde( - rename = "defaultAccessLevel", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_access_level: Option<AccessLevel>, - #[doc = "Group Options"] - #[serde( - rename = "groupOptions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub group_options: Vec<GroupOption>, - #[doc = "Summary of Licenses in the organization"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub licenses: Vec<LicenseSummaryData>, - #[doc = "Summary of Projects in the organization"] - #[serde( - rename = "projectRefs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub project_refs: Vec<ProjectRef>, + #[doc = "Available Access Levels"] + #[serde( + rename = "availableAccessLevels", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub available_access_levels: Vec<AccessLevel>, + #[doc = "License assigned to a user"] + #[serde( + rename = "defaultAccessLevel", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_access_level: Option<AccessLevel>, + #[doc = "Group Options"] + #[serde( + rename = "groupOptions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub group_options: Vec<GroupOption>, + #[doc = "Summary of Licenses in the organization"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub licenses: Vec<LicenseSummaryData>, + #[doc = "Summary of Projects in the organization"] + #[serde( + rename = "projectRefs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub project_refs: Vec<ProjectRef>, } impl UsersSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/operations/mod.rs b/azure_devops_rust_api/src/operations/mod.rs index 28c235f8..860d34ff 100644 --- a/azure_devops_rust_api/src/operations/mod.rs +++ b/azure_devops_rust_api/src/operations/mod.rs @@ -9,257 +9,258 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self - } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self - } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self - } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self - } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } } impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets an operation from the 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 = "Arguments:"] + #[doc = "* `operation_id`: The ID for the operation."] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get( + &self, + operation_id: impl Into<String>, + organization: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + operation_id: operation_id.into(), + organization: organization.into(), + plugin_id: None, + } } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Operation> { + let bytes = self.0.into_body().collect().await?; + let body: models::Operation = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn operations_client(&self) -> operations::Client { - operations::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } -} -pub mod operations { - use super::models; - 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 = "Arguments:"] - #[doc = "* `operation_id`: The ID for the operation."] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get( - &self, - operation_id: impl Into<String>, - organization: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - operation_id: operation_id.into(), - organization: organization.into(), - plugin_id: None, - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) operation_id: String, + pub(crate) organization: String, + pub(crate) plugin_id: Option<String>, } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Operation> { - let bytes = self.0.into_body().collect().await?; - let body: models::Operation = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) operation_id: String, - pub(crate) organization: String, - pub(crate) plugin_id: Option<String>, - } - impl RequestBuilder { - #[doc = "The ID for the plugin."] - pub fn plugin_id(mut self, plugin_id: impl Into<String>) -> Self { - self.plugin_id = Some(plugin_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/operations/{}", - this.client.endpoint(), - &this.organization, - &this.operation_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(plugin_id) = &this.plugin_id { - req.url_mut() - .query_pairs_mut() - .append_pair("pluginId", plugin_id); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + impl RequestBuilder { + #[doc = "The ID for the plugin."] + pub fn plugin_id(mut self, plugin_id: impl Into<String>) -> Self { + self.plugin_id = Some(plugin_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/operations/{}", + this.client.endpoint(), + &this.organization, + &this.operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Operation>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Operation>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(plugin_id) = &this.plugin_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("pluginId", plugin_id); } - } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Operation>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Operation>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/operations/models.rs b/azure_devops_rust_api/src/operations/models.rs index 3d9a5891..9b804e72 100644 --- a/azure_devops_rust_api/src/operations/models.rs +++ b/azure_devops_rust_api/src/operations/models.rs @@ -8,95 +8,95 @@ use std::str::FromStr; #[doc = "Contains information about the progress or result of an async operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Operation { - #[serde(flatten)] - pub operation_reference: OperationReference, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Detailed messaged about the status of an operation."] - #[serde( - rename = "detailedMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub detailed_message: Option<String>, - #[doc = "Result message for an operation."] - #[serde( - rename = "resultMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_message: Option<String>, - #[doc = ""] - #[serde(rename = "resultUrl", default, skip_serializing_if = "Option::is_none")] - pub result_url: Option<OperationResultReference>, + #[serde(flatten)] + pub operation_reference: OperationReference, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Detailed messaged about the status of an operation."] + #[serde( + rename = "detailedMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub detailed_message: Option<String>, + #[doc = "Result message for an operation."] + #[serde( + rename = "resultMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_message: Option<String>, + #[doc = ""] + #[serde(rename = "resultUrl", default, skip_serializing_if = "Option::is_none")] + pub result_url: Option<OperationResultReference>, } impl Operation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference for an async operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationReference { - #[doc = "Unique identifier for the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Unique identifier for the plugin."] - #[serde(rename = "pluginId", default, skip_serializing_if = "Option::is_none")] - pub plugin_id: Option<String>, - #[doc = "The current status of the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<operation_reference::Status>, - #[doc = "URL to get the full operation object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Unique identifier for the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Unique identifier for the plugin."] + #[serde(rename = "pluginId", default, skip_serializing_if = "Option::is_none")] + pub plugin_id: Option<String>, + #[doc = "The current status of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<operation_reference::Status>, + #[doc = "URL to get the full operation object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl OperationReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod operation_reference { - use super::*; - #[doc = "The current status of the operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "notSet")] - NotSet, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "cancelled")] - Cancelled, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - } + use super::*; + #[doc = "The current status of the operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "notSet")] + NotSet, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "cancelled")] + Cancelled, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationResultReference { - #[doc = "URL to the operation result."] - #[serde(rename = "resultUrl", default, skip_serializing_if = "Option::is_none")] - pub result_url: Option<String>, + #[doc = "URL to the operation result."] + #[serde(rename = "resultUrl", default, skip_serializing_if = "Option::is_none")] + pub result_url: Option<String>, } impl OperationResultReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/permissions_report/mod.rs b/azure_devops_rust_api/src/permissions_report/mod.rs index 21e7f102..0e5ba301 100644 --- a/azure_devops_rust_api/src/permissions_report/mod.rs +++ b/azure_devops_rust_api/src/permissions_report/mod.rs @@ -9,606 +9,606 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + 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()) + } +} +pub mod permissions_report { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of permissions reports"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + #[doc = "Request a permissions report to be created asyncronously"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Request configuration to be included in the permissions report"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::PermissionsReportRequest>, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Get a specific permissions report"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: The ID (GUID) of the permissions report"] + pub fn get( + &self, + organization: impl Into<String>, + id: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id: id.into(), + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PermissionsReportList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PermissionsReportList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/permissionsreport", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PermissionsReportList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PermissionsReportList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReferenceLinks> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReferenceLinks = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn permissions_report_client(&self) -> permissions_report::Client { - permissions_report::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub fn permissions_report_download_client(&self) -> permissions_report_download::Client { - permissions_report_download::Client(self.clone()) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PermissionsReportRequest, } -} -pub mod permissions_report { + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/permissionsreport", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReferenceLinks>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReferenceLinks>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of permissions reports"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - #[doc = "Request a permissions report to be created asyncronously"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Request configuration to be included in the permissions report"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::PermissionsReportRequest>, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - #[doc = "Get a specific permissions report"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: The ID (GUID) of the permissions report"] - pub fn get( - &self, - organization: impl Into<String>, - id: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - id: id.into(), - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PermissionsReport> { + let bytes = self.0.into_body().collect().await?; + let body: models::PermissionsReport = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PermissionsReportList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PermissionsReportList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/permissionsreport", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PermissionsReportList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PermissionsReportList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReferenceLinks> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReferenceLinks = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PermissionsReportRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/permissionsreport", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReferenceLinks>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ReferenceLinks>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PermissionsReport> { - let bytes = self.0.into_body().collect().await?; - let body: models::PermissionsReport = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/permissionsreport/{}", - this.client.endpoint(), - &this.organization, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PermissionsReport>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PermissionsReport>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/permissionsreport/{}", + this.client.endpoint(), + &this.organization, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PermissionsReport>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PermissionsReport>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod permissions_report_download { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Download the json results of a permissions report"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: The ID (GUID) of the permissions report"] + pub fn download( + &self, + organization: impl Into<String>, + id: impl Into<String>, + ) -> download::RequestBuilder { + download::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id: id.into(), + } + } + } + pub mod download { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Download the json results of a permissions report"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: The ID (GUID) of the permissions report"] - pub fn download( - &self, - organization: impl Into<String>, - id: impl Into<String>, - ) -> download::RequestBuilder { - download::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - id: id.into(), - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub mod download { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/permissionsreport/{}/download", - this.client.endpoint(), - &this.organization, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/permissionsreport/{}/download", + this.client.endpoint(), + &this.organization, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/permissions_report/models.rs b/azure_devops_rust_api/src/permissions_report/models.rs index b85946c7..77165738 100644 --- a/azure_devops_rust_api/src/permissions_report/models.rs +++ b/azure_devops_rust_api/src/permissions_report/models.rs @@ -8,192 +8,190 @@ use std::str::FromStr; #[doc = "Detailed report of permissions for a set of groups and users over a set of security namespaces"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PermissionsReport { - #[doc = "Error if the report creation failed or empty if successful"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the report which typically includes the requestor's display name"] - #[serde( - rename = "reportName", - default, - skip_serializing_if = "Option::is_none" - )] - pub report_name: Option<String>, - #[serde( - rename = "reportStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub report_status: Option<permissions_report::ReportStatus>, - #[serde( - rename = "reportStatusLastUpdatedTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub report_status_last_updated_time: Option<time::OffsetDateTime>, - #[serde( - rename = "requestedTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub requested_time: Option<time::OffsetDateTime>, - #[doc = "User who requested the report be created"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub requestor: Option<String>, + #[doc = "Error if the report creation failed or empty if successful"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the report which typically includes the requestor's display name"] + #[serde( + rename = "reportName", + default, + skip_serializing_if = "Option::is_none" + )] + pub report_name: Option<String>, + #[serde( + rename = "reportStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub report_status: Option<permissions_report::ReportStatus>, + #[serde( + rename = "reportStatusLastUpdatedTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub report_status_last_updated_time: Option<time::OffsetDateTime>, + #[serde( + rename = "requestedTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub requested_time: Option<time::OffsetDateTime>, + #[doc = "User who requested the report be created"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub requestor: Option<String>, } impl PermissionsReport { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod permissions_report { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ReportStatus { - #[serde(rename = "created")] - Created, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completedWithErrors")] - CompletedWithErrors, - #[serde(rename = "completedSuccessfully")] - CompletedSuccessfully, - #[serde(rename = "deleted")] - Deleted, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ReportStatus { + #[serde(rename = "created")] + Created, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completedWithErrors")] + CompletedWithErrors, + #[serde(rename = "completedSuccessfully")] + CompletedSuccessfully, + #[serde(rename = "deleted")] + Deleted, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PermissionsReportList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<PermissionsReport>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<PermissionsReport>, } impl PermissionsReportList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Details for creating a permissions report"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PermissionsReportRequest { - #[doc = "List of groups and users to fetch permissions on. An empty list will fetch all groups and users in the organization"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub descriptors: Vec<String>, - #[doc = "Name of the report to create, make it unique"] - #[serde( - rename = "reportName", - default, - skip_serializing_if = "Option::is_none" - )] - pub report_name: Option<String>, - #[doc = "List of resources to fetch permisions on"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub resources: Vec<PermissionsReportResource>, + #[doc = "List of groups and users to fetch permissions on. An empty list will fetch all groups and users in the organization"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub descriptors: Vec<String>, + #[doc = "Name of the report to create, make it unique"] + #[serde( + rename = "reportName", + default, + skip_serializing_if = "Option::is_none" + )] + pub report_name: Option<String>, + #[doc = "List of resources to fetch permisions on"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub resources: Vec<PermissionsReportResource>, } impl PermissionsReportRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Specifics of the resource for the permissions report"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PermissionsReportResource { - #[doc = "GUID, Name, or ref for the specified resource type"] - #[serde( - rename = "resourceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_id: Option<String>, - #[doc = "For repo resource type, resource name is the repo name"] - #[serde( - rename = "resourceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_name: Option<String>, - #[doc = "Specify the type of resource to report permissions on"] - #[serde( - rename = "resourceType", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_type: Option<permissions_report_resource::ResourceType>, + #[doc = "GUID, Name, or ref for the specified resource type"] + #[serde( + rename = "resourceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_id: Option<String>, + #[doc = "For repo resource type, resource name is the repo name"] + #[serde( + rename = "resourceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_name: Option<String>, + #[doc = "Specify the type of resource to report permissions on"] + #[serde( + rename = "resourceType", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_type: Option<permissions_report_resource::ResourceType>, } impl PermissionsReportResource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod permissions_report_resource { - use super::*; - #[doc = "Specify the type of resource to report permissions on"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ResourceType { - #[serde(rename = "repo")] - Repo, - #[serde(rename = "ref")] - Ref, - #[serde(rename = "projectGit")] - ProjectGit, - #[serde(rename = "release")] - Release, - #[serde(rename = "tfvc")] - Tfvc, - } + use super::*; + #[doc = "Specify the type of resource to report permissions on"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ResourceType { + #[serde(rename = "repo")] + Repo, + #[serde(rename = "ref")] + Ref, + #[serde(rename = "projectGit")] + ProjectGit, + #[serde(rename = "release")] + Release, + #[serde(rename = "tfvc")] + Tfvc, + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/pipelines/mod.rs b/azure_devops_rust_api/src/pipelines/mod.rs index 75441265..d114e190 100644 --- a/azure_devops_rust_api/src/pipelines/mod.rs +++ b/azure_devops_rust_api/src/pipelines/mod.rs @@ -9,1545 +9,1560 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + 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()) + } +} +pub mod pipelines { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of pipelines."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + order_by: None, + top: None, + continuation_token: None, + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Create a pipeline."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Input parameters."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::CreatePipelineParameters>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `pipeline_id`: The pipeline ID"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + pipeline_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + pipeline_id, + pipeline_version: None, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PipelineList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PipelineList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) order_by: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + } + impl RequestBuilder { + #[doc = "A sort expression. Defaults to \"name asc\""] + pub fn order_by(mut self, order_by: impl Into<String>) -> Self { + self.order_by = Some(order_by.into()); + self + } + #[doc = "The maximum number of pipelines to return"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "A continuation token from a previous request, to retrieve the next page of results"] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PipelineList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PipelineList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Pipeline> { + let bytes = self.0.into_body().collect().await?; + let body: models::Pipeline = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod pipelines { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CreatePipelineParameters, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Pipeline>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Pipeline>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of pipelines."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Input parameters."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::CreatePipelineParameters>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `pipeline_id`: The pipeline ID"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - pipeline_id: i32, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - pipeline_id, - pipeline_version: None, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PipelineList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PipelineList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) order_by: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - } - impl RequestBuilder { - #[doc = "A sort expression. Defaults to \"name asc\""] - pub fn order_by(mut self, order_by: impl Into<String>) -> Self { - self.order_by = Some(order_by.into()); - self - } - #[doc = "The maximum number of pipelines to return"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "A continuation token from a previous request, to retrieve the next page of results"] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PipelineList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PipelineList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Pipeline> { - let bytes = self.0.into_body().collect().await?; - let body: models::Pipeline = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CreatePipelineParameters, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Pipeline>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Pipeline>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Pipeline> { - let bytes = self.0.into_body().collect().await?; - let body: models::Pipeline = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) pipeline_id: i32, - pub(crate) pipeline_version: Option<i32>, - } - impl RequestBuilder { - #[doc = "The pipeline version"] - pub fn pipeline_version(mut self, pipeline_version: i32) -> Self { - self.pipeline_version = Some(pipeline_version); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.pipeline_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(pipeline_version) = &this.pipeline_version { - req.url_mut() - .query_pairs_mut() - .append_pair("pipelineVersion", &pipeline_version.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Pipeline>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Pipeline>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Pipeline> { + let bytes = self.0.into_body().collect().await?; + let body: models::Pipeline = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) pipeline_id: i32, + pub(crate) pipeline_version: Option<i32>, } + impl RequestBuilder { + #[doc = "The pipeline version"] + pub fn pipeline_version(mut self, pipeline_version: i32) -> Self { + self.pipeline_version = Some(pipeline_version); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.pipeline_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(pipeline_version) = &this.pipeline_version { + req + .url_mut() + .query_pairs_mut() + .append_pair("pipelineVersion", &pipeline_version.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Pipeline>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Pipeline>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod preview { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Optional additional parameters for this run."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `pipeline_id`: The pipeline ID."] + pub fn preview( + &self, + organization: impl Into<String>, + body: impl Into<models::RunPipelineParameters>, + project: impl Into<String>, + 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 preview { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Optional additional parameters for this run."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `pipeline_id`: The pipeline ID."] - pub fn preview( - &self, - organization: impl Into<String>, - body: impl Into<models::RunPipelineParameters>, - project: impl Into<String>, - 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 preview { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PreviewRun> { - let bytes = self.0.into_body().collect().await?; - let body: models::PreviewRun = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::RunPipelineParameters, - pub(crate) project: String, - pub(crate) pipeline_id: i32, - pub(crate) pipeline_version: Option<i32>, - } - impl RequestBuilder { - #[doc = "The pipeline version."] - pub fn pipeline_version(mut self, pipeline_version: i32) -> Self { - self.pipeline_version = Some(pipeline_version); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/preview", - this.client.endpoint(), - &this.organization, - &this.project, - &this.pipeline_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PreviewRun>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PreviewRun>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PreviewRun> { + let bytes = self.0.into_body().collect().await?; + let body: models::PreviewRun = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::RunPipelineParameters, + pub(crate) project: String, + pub(crate) pipeline_id: i32, + pub(crate) pipeline_version: Option<i32>, } + impl RequestBuilder { + #[doc = "The pipeline version."] + pub fn pipeline_version(mut self, pipeline_version: i32) -> Self { + self.pipeline_version = Some(pipeline_version); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/preview", + this.client.endpoint(), + &this.organization, + &this.project, + &this.pipeline_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PreviewRun>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::PreviewRun>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod runs { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets top 10000 runs for a particular pipeline."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `pipeline_id`: The pipeline id"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Optional additional parameters for this run."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `pipeline_id`: The pipeline ID."] + pub fn run_pipeline( + &self, + organization: impl Into<String>, + body: impl Into<models::RunPipelineParameters>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `pipeline_id`: The pipeline id"] + #[doc = "* `run_id`: The run id"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets top 10000 runs for a particular pipeline."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `pipeline_id`: The pipeline id"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Optional additional parameters for this run."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `pipeline_id`: The pipeline ID."] - pub fn run_pipeline( - &self, - organization: impl Into<String>, - body: impl Into<models::RunPipelineParameters>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `pipeline_id`: The pipeline id"] - #[doc = "* `run_id`: The run id"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RunList> { - let bytes = self.0.into_body().collect().await?; - let body: models::RunList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) pipeline_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/runs", - this.client.endpoint(), - &this.organization, - &this.project, - &this.pipeline_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RunList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::RunList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod run_pipeline { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Run> { - let bytes = self.0.into_body().collect().await?; - let body: models::Run = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::RunPipelineParameters, - pub(crate) project: String, - pub(crate) pipeline_id: i32, - pub(crate) pipeline_version: Option<i32>, - } - impl RequestBuilder { - #[doc = "The pipeline version."] - pub fn pipeline_version(mut self, pipeline_version: i32) -> Self { - self.pipeline_version = Some(pipeline_version); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/runs", - this.client.endpoint(), - &this.organization, - &this.project, - &this.pipeline_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Run>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Run>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Run> { - let bytes = self.0.into_body().collect().await?; - let body: models::Run = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) pipeline_id: i32, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/runs/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.pipeline_id, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Run>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Run>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RunList> { + let bytes = self.0.into_body().collect().await?; + let body: models::RunList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) pipeline_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/runs", + this.client.endpoint(), + &this.organization, + &this.project, + &this.pipeline_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RunList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::RunList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod run_pipeline { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Run> { + let bytes = self.0.into_body().collect().await?; + let body: models::Run = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::RunPipelineParameters, + pub(crate) project: String, + pub(crate) pipeline_id: i32, + pub(crate) pipeline_version: Option<i32>, + } + impl RequestBuilder { + #[doc = "The pipeline version."] + pub fn pipeline_version(mut self, pipeline_version: i32) -> Self { + self.pipeline_version = Some(pipeline_version); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/runs", + this.client.endpoint(), + &this.organization, + &this.project, + &this.pipeline_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Run>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Run>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Run> { + let bytes = self.0.into_body().collect().await?; + let body: models::Run = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) pipeline_id: i32, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/runs/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.pipeline_id, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Run>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Run>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod artifacts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a specific artifact from a pipeline run"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `pipeline_id`: ID of the pipeline."] + #[doc = "* `run_id`: ID of the run of that pipeline."] + #[doc = "* `artifact_name`: Name of the artifact."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + pipeline_id: i32, + run_id: i32, + artifact_name: impl Into<String>, + ) -> 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 get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a specific artifact from a pipeline run"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `pipeline_id`: ID of the pipeline."] - #[doc = "* `run_id`: ID of the run of that pipeline."] - #[doc = "* `artifact_name`: Name of the artifact."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - pipeline_id: i32, - run_id: i32, - artifact_name: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Artifact> { - let bytes = self.0.into_body().collect().await?; - let body: models::Artifact = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) pipeline_id: i32, - pub(crate) run_id: i32, - pub(crate) artifact_name: String, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "Expand options. Default is None."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/runs/{}/artifacts", - this.client.endpoint(), - &this.organization, - &this.project, - &this.pipeline_id, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Artifact>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Artifact>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Artifact> { + let bytes = self.0.into_body().collect().await?; + let body: models::Artifact = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) pipeline_id: i32, + pub(crate) run_id: i32, + pub(crate) artifact_name: String, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "Expand options. Default is None."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/runs/{}/artifacts", + this.client.endpoint(), + &this.organization, + &this.project, + &this.pipeline_id, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Artifact>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Artifact>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod logs { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of logs from a pipeline run."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `pipeline_id`: ID of the pipeline."] + #[doc = "* `run_id`: ID of the run of that pipeline."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `pipeline_id`: ID of the pipeline."] + #[doc = "* `run_id`: ID of the run of that pipeline."] + #[doc = "* `log_id`: ID of the log."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of logs from a pipeline run."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `pipeline_id`: ID of the pipeline."] - #[doc = "* `run_id`: ID of the run of that pipeline."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `pipeline_id`: ID of the pipeline."] - #[doc = "* `run_id`: ID of the run of that pipeline."] - #[doc = "* `log_id`: ID of the log."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::LogCollection> { - let bytes = self.0.into_body().collect().await?; - let body: models::LogCollection = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) pipeline_id: i32, - pub(crate) run_id: i32, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "Expand options. Default is None."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/runs/{}/logs", - this.client.endpoint(), - &this.organization, - &this.project, - &this.pipeline_id, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::LogCollection>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::LogCollection>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Log> { - let bytes = self.0.into_body().collect().await?; - let body: models::Log = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) pipeline_id: i32, - pub(crate) run_id: i32, - pub(crate) log_id: i32, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "Expand options. Default is None."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/runs/{}/logs/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.pipeline_id, - &this.run_id, - &this.log_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Log>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Log>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::LogCollection> { + let bytes = self.0.into_body().collect().await?; + let body: models::LogCollection = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) pipeline_id: i32, + pub(crate) run_id: i32, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "Expand options. Default is None."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/runs/{}/logs", + this.client.endpoint(), + &this.organization, + &this.project, + &this.pipeline_id, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::LogCollection>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::LogCollection>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Log> { + let bytes = self.0.into_body().collect().await?; + let body: models::Log = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) pipeline_id: i32, + pub(crate) run_id: i32, + pub(crate) log_id: i32, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "Expand options. Default is None."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/runs/{}/logs/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.pipeline_id, + &this.run_id, + &this.log_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Log>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Log>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/pipelines/models.rs b/azure_devops_rust_api/src/pipelines/models.rs index 75c26bf5..c205d6ae 100644 --- a/azure_devops_rust_api/src/pipelines/models.rs +++ b/azure_devops_rust_api/src/pipelines/models.rs @@ -8,745 +8,673 @@ use std::str::FromStr; #[doc = "Artifacts are collections of files produced by a pipeline. Use artifacts to share files between stages in a pipeline or between different pipelines."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Artifact { - #[doc = "The name of the artifact."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "A signed url allowing limited-time anonymous access to private resources."] - #[serde( - rename = "signedContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub signed_content: Option<SignedUrl>, - #[doc = "Self-referential url"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The name of the artifact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "A signed url allowing limited-time anonymous access to private resources."] + #[serde( + rename = "signedContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub signed_content: Option<SignedUrl>, + #[doc = "Self-referential url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Artifact { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildResourceParameters { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl BuildResourceParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Container { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option<String>, - #[serde( - rename = "mapDockerSocket", - default, - skip_serializing_if = "Option::is_none" - )] - pub map_docker_socket: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub options: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ports: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub volumes: Vec<String>, -} -impl Container { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ContainerResource { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub container: Option<Container>, -} -impl ContainerResource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContainerResourceParameters { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl ContainerResourceParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Configuration parameters of the pipeline."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreatePipelineConfigurationParameters { - #[doc = "Type of configuration."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<create_pipeline_configuration_parameters::Type>, + #[doc = "Type of configuration."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<create_pipeline_configuration_parameters::Type>, } impl CreatePipelineConfigurationParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod create_pipeline_configuration_parameters { - use super::*; - #[doc = "Type of configuration."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "yaml")] - Yaml, - #[serde(rename = "designerJson")] - DesignerJson, - #[serde(rename = "justInTime")] - JustInTime, - #[serde(rename = "designerHyphenJson")] - DesignerHyphenJson, - } + use super::*; + #[doc = "Type of configuration."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "yaml")] + Yaml, + #[serde(rename = "designerJson")] + DesignerJson, + #[serde(rename = "justInTime")] + JustInTime, + #[serde(rename = "designerHyphenJson")] + DesignerHyphenJson, + } } #[doc = "Parameters to create a pipeline."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreatePipelineParameters { - #[doc = "Configuration parameters of the pipeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<CreatePipelineConfigurationParameters>, - #[doc = "Folder of the pipeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub folder: Option<String>, - #[doc = "Name of the pipeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Configuration parameters of the pipeline."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<CreatePipelineConfigurationParameters>, + #[doc = "Folder of the pipeline."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub folder: Option<String>, + #[doc = "Name of the pipeline."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl CreatePipelineParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Link URL"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Link { - pub href: String, + pub href: String, } impl Link { - pub fn new(href: String) -> Self { - Self { href } - } + pub fn new(href: String) -> Self { + Self { href } + } } #[doc = "Log for a pipeline."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Log { - #[doc = "The date and time the log was created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "The ID of the log."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "The date and time the log was last changed."] - #[serde( - rename = "lastChangedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_changed_on: Option<time::OffsetDateTime>, - #[doc = "The number of lines in the log."] - #[serde(rename = "lineCount", default, skip_serializing_if = "Option::is_none")] - pub line_count: Option<i64>, - #[doc = "A signed url allowing limited-time anonymous access to private resources."] - #[serde( - rename = "signedContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub signed_content: Option<SignedUrl>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The date and time the log was created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "The ID of the log."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "The date and time the log was last changed."] + #[serde( + rename = "lastChangedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_changed_on: Option<time::OffsetDateTime>, + #[doc = "The number of lines in the log."] + #[serde(rename = "lineCount", default, skip_serializing_if = "Option::is_none")] + pub line_count: Option<i64>, + #[doc = "A signed url allowing limited-time anonymous access to private resources."] + #[serde( + rename = "signedContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub signed_content: Option<SignedUrl>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Log { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A collection of logs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LogCollection { - #[doc = "The list of logs."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub logs: Vec<Log>, - #[doc = "A signed url allowing limited-time anonymous access to private resources."] - #[serde( - rename = "signedContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub signed_content: Option<SignedUrl>, - #[doc = "URL of the log."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The list of logs."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub logs: Vec<Log>, + #[doc = "A signed url allowing limited-time anonymous access to private resources."] + #[serde( + rename = "signedContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub signed_content: Option<SignedUrl>, + #[doc = "URL of the log."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl LogCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageResourceParameters { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl PackageResourceParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Definition of a pipeline."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Pipeline { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links")] - pub links: ReferenceLinks, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<PipelineConfiguration>, - #[doc = "URL of the pipeline"] - pub url: String, - #[doc = "Pipeline folder"] - pub folder: String, - #[doc = "Pipeline ID"] - pub id: i32, - #[doc = "Pipeline name"] - pub name: String, - #[doc = "Revision number"] - pub revision: i32, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links")] + pub links: ReferenceLinks, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<PipelineConfiguration>, + #[doc = "URL of the pipeline"] + pub url: String, + #[doc = "Pipeline folder"] + pub folder: String, + #[doc = "Pipeline ID"] + pub id: i32, + #[doc = "Pipeline name"] + pub name: String, + #[doc = "Revision number"] + pub revision: i32, } impl Pipeline { - pub fn new( - links: ReferenceLinks, - url: String, - folder: String, - id: i32, - name: String, - revision: i32, - ) -> Self { - Self { - links, - configuration: None, - url, - folder, - id, - name, - revision, - } - } + pub fn new( + links: ReferenceLinks, + url: String, + folder: String, + id: i32, + name: String, + revision: i32, + ) -> Self { + Self { + links, + configuration: None, + url, + folder, + id, + name, + revision, + } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PipelineBase { - #[doc = "Pipeline folder"] - pub folder: String, - #[doc = "Pipeline ID"] - pub id: i32, - #[doc = "Pipeline name"] - pub name: String, - #[doc = "Revision number"] - pub revision: i32, + #[doc = "Pipeline folder"] + pub folder: String, + #[doc = "Pipeline ID"] + pub id: i32, + #[doc = "Pipeline name"] + pub name: String, + #[doc = "Revision number"] + pub revision: i32, } impl PipelineBase { - pub fn new(folder: String, id: i32, name: String, revision: i32) -> Self { - Self { - folder, - id, - name, - revision, - } + pub fn new(folder: String, id: i32, name: String, revision: i32) -> Self { + Self { + folder, + id, + name, + revision, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PipelineConfiguration { - #[serde(rename = "type")] - pub type_: pipeline_configuration::Type, - pub path: String, - pub repository: pipeline_configuration::Repository, + #[serde(rename = "type")] + pub type_: pipeline_configuration::Type, + pub path: String, + pub repository: pipeline_configuration::Repository, } impl PipelineConfiguration { - pub fn new( - type_: pipeline_configuration::Type, - path: String, - repository: pipeline_configuration::Repository, - ) -> Self { - Self { - type_, - path, - repository, - } - } + pub fn new( + type_: pipeline_configuration::Type, + path: String, + repository: pipeline_configuration::Repository, + ) -> Self { + Self { + type_, + path, + repository, + } + } } pub mod pipeline_configuration { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "yaml")] - Yaml, - #[serde(rename = "designerJson")] - DesignerJson, - #[serde(rename = "justInTime")] - JustInTime, - #[serde(rename = "designerHyphenJson")] - DesignerHyphenJson, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Repository { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - } - impl Repository { - pub fn new() -> Self { - Self::default() - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "yaml")] + Yaml, + #[serde(rename = "designerJson")] + DesignerJson, + #[serde(rename = "justInTime")] + JustInTime, + #[serde(rename = "designerHyphenJson")] + DesignerHyphenJson, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Repository { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + } + impl Repository { + pub fn new() -> Self { + Self::default() } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelineList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Pipeline>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Pipeline>, } impl PipelineList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A reference to a Pipeline."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PipelineReference { - #[serde(flatten)] - pub pipeline_base: PipelineBase, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(flatten)] + pub pipeline_base: PipelineBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl PipelineReference { - pub fn new(pipeline_base: PipelineBase) -> Self { - Self { - pipeline_base, - url: None, - } - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PipelineResource { - #[doc = "A reference to a Pipeline."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pipeline: Option<PipelineReference>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, -} -impl PipelineResource { - pub fn new() -> Self { - Self::default() + pub fn new(pipeline_base: PipelineBase) -> Self { + Self { + pipeline_base, + url: None, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelineResourceParameters { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl PipelineResourceParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PreviewRun { - #[serde(rename = "finalYaml", default, skip_serializing_if = "Option::is_none")] - pub final_yaml: Option<String>, + #[serde(rename = "finalYaml", default, skip_serializing_if = "Option::is_none")] + pub final_yaml: Option<String>, } impl PreviewRun { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "Link URL"] - #[serde(rename = "self", default, skip_serializing_if = "Option::is_none")] - pub self_: Option<Link>, - #[doc = "Link URL"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub web: Option<Link>, + #[doc = "Link URL"] + #[serde(rename = "self", default, skip_serializing_if = "Option::is_none")] + pub self_: Option<Link>, + #[doc = "Link URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub web: Option<Link>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Repository { - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<repository::Type>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<repository::Type>, } impl Repository { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod repository { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "gitHub")] - GitHub, - #[serde(rename = "azureReposGit")] - AzureReposGit, - #[serde(rename = "gitHubEnterprise")] - GitHubEnterprise, - #[serde(rename = "azureReposGitHyphenated")] - AzureReposGitHyphenated, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "gitHub")] + GitHub, + #[serde(rename = "azureReposGit")] + AzureReposGit, + #[serde(rename = "gitHubEnterprise")] + GitHubEnterprise, + #[serde(rename = "azureReposGitHyphenated")] + AzureReposGitHyphenated, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RepositoryResource { - #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] - pub ref_name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<Repository>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] + pub ref_name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<Repository>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl RepositoryResource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RepositoryResourceParameters { - #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] - pub ref_name: Option<String>, - #[doc = "This is the security token to use when connecting to the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub token: Option<String>, - #[doc = "Optional. This is the type of the token given. If not provided, a type of \"Bearer\" is assumed. Note: Use \"Basic\" for a PAT token."] - #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] - pub token_type: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] + pub ref_name: Option<String>, + #[doc = "This is the security token to use when connecting to the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option<String>, + #[doc = "Optional. This is the type of the token given. If not provided, a type of \"Bearer\" is assumed. Note: Use \"Basic\" for a PAT token."] + #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] + pub token_type: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl RepositoryResourceParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Run { - #[serde(flatten)] - pub run_reference: RunReference, - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links")] - pub links: ReferenceLinks, - #[serde(rename = "createdDate", with = "crate::date_time::rfc3339")] - pub created_date: time::OffsetDateTime, - #[serde(rename = "finalYaml", default, skip_serializing_if = "Option::is_none")] - pub final_yaml: Option<String>, - #[serde( - rename = "finishedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finished_date: Option<time::OffsetDateTime>, - #[doc = "A reference to a Pipeline."] - pub pipeline: PipelineReference, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option<RunResources>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<run::Result>, - pub state: run::State, - #[serde( - rename = "templateParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub template_parameters: Option<serde_json::Value>, - pub url: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[serde(flatten)] + pub run_reference: RunReference, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links")] + pub links: ReferenceLinks, + #[serde(rename = "createdDate", with = "crate::date_time::rfc3339")] + pub created_date: time::OffsetDateTime, + #[serde(rename = "finalYaml", default, skip_serializing_if = "Option::is_none")] + pub final_yaml: Option<String>, + #[serde( + rename = "finishedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finished_date: Option<time::OffsetDateTime>, + #[doc = "A reference to a Pipeline."] + pub pipeline: PipelineReference, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resources: Option<RunResources>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<run::Result>, + pub state: run::State, + pub url: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl Run { - pub fn new( - run_reference: RunReference, - links: ReferenceLinks, - created_date: time::OffsetDateTime, - pipeline: PipelineReference, - state: run::State, - url: String, - ) -> Self { - Self { - run_reference, - links, - created_date, - final_yaml: None, - finished_date: None, - pipeline, - resources: None, - result: None, - state, - template_parameters: None, - url, - variables: None, - } - } + pub fn new( + run_reference: RunReference, + links: ReferenceLinks, + created_date: time::OffsetDateTime, + pipeline: PipelineReference, + state: run::State, + url: String, + ) -> Self { + Self { + run_reference, + links, + created_date, + final_yaml: None, + finished_date: None, + pipeline, + resources: None, + result: None, + state, + url, + variables: None, + } + } } pub mod run { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "canceling")] - Canceling, - #[serde(rename = "completed")] - Completed, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "canceling")] + Canceling, + #[serde(rename = "completed")] + Completed, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Run>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Run>, } impl RunList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Settings which influence pipeline runs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunPipelineParameters { - #[doc = "If true, don't actually create a new run. Instead, return the final YAML document after parsing templates."] - #[serde( - rename = "previewRun", - default, - skip_serializing_if = "Option::is_none" - )] - pub preview_run: Option<bool>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option<RunResourcesParameters>, - #[serde( - rename = "stagesToSkip", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub stages_to_skip: Vec<String>, - #[serde( - rename = "templateParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub template_parameters: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, - #[doc = "If you use the preview run option, you may optionally supply different YAML. This allows you to preview the final YAML document without committing a changed file."] - #[serde( - rename = "yamlOverride", - default, - skip_serializing_if = "Option::is_none" - )] - pub yaml_override: Option<String>, + #[doc = "If true, don't actually create a new run. Instead, return the final YAML document after parsing templates."] + #[serde( + rename = "previewRun", + default, + skip_serializing_if = "Option::is_none" + )] + pub preview_run: Option<bool>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resources: Option<RunResourcesParameters>, + #[serde( + rename = "stagesToSkip", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub stages_to_skip: Vec<String>, + #[serde( + rename = "templateParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub template_parameters: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, + #[doc = "If you use the preview run option, you may optionally supply different YAML. This allows you to preview the final YAML document without committing a changed file."] + #[serde( + rename = "yamlOverride", + default, + skip_serializing_if = "Option::is_none" + )] + pub yaml_override: Option<String>, } impl RunPipelineParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RunReference { - pub id: i32, - pub name: String, + pub id: i32, + pub name: String, } impl RunReference { - pub fn new(id: i32, name: String) -> Self { - Self { id, name } - } + pub fn new(id: i32, name: String) -> Self { + Self { id, name } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunResources { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub containers: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pipelines: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repositories: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repositories: Option<serde_json::Value>, } impl RunResources { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunResourcesParameters { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub builds: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub containers: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub packages: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pipelines: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repositories: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub builds: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub containers: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub packages: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pipelines: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repositories: Option<serde_json::Value>, } impl RunResourcesParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SignalRConnection { - #[doc = "A signed url allowing limited-time anonymous access to private resources."] - #[serde( - rename = "signedContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub signed_content: Option<SignedUrl>, + #[doc = "A signed url allowing limited-time anonymous access to private resources."] + #[serde( + rename = "signedContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub signed_content: Option<SignedUrl>, } impl SignalRConnection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A signed url allowing limited-time anonymous access to private resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SignedUrl { - #[doc = "Timestamp when access expires."] - #[serde( - rename = "signatureExpires", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub signature_expires: Option<time::OffsetDateTime>, - #[doc = "The URL to allow access to."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Timestamp when access expires."] + #[serde( + rename = "signatureExpires", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub signature_expires: Option<time::OffsetDateTime>, + #[doc = "The URL to allow access to."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl SignedUrl { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Variable { - #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] - pub is_secret: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] + pub is_secret: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl Variable { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/policy/mod.rs b/azure_devops_rust_api/src/policy/mod.rs index 0c0d2a2a..cd8b0bb1 100644 --- a/azure_devops_rust_api/src/policy/mod.rs +++ b/azure_devops_rust_api/src/policy/mod.rs @@ -9,1748 +9,1747 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + 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()) + } +} +pub mod configurations { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Get a policy configuration by its ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `configuration_id`: ID of the policy configuration"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + configuration_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + configuration_id, + } + } + #[doc = "Create a policy configuration of a given policy type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The policy configuration to create."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::PolicyConfiguration>, + project: impl Into<String>, + configuration_id: i32, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + configuration_id, + } + } + #[doc = "Update a policy configuration by its ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The policy configuration to update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `configuration_id`: ID of the existing policy configuration to be updated."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::PolicyConfiguration>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `configuration_id`: ID of the policy configuration to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + configuration_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + configuration_id, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PolicyConfigurationList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyConfigurationList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) scope: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + pub(crate) policy_type: Option<String>, + } + 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<String>) -> Self { + self.scope = Some(scope.into()); + self + } + #[doc = "Maximum number of policies to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "The continuation token used for pagination."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "Filter returned policies to only this type"] + pub fn policy_type(mut self, policy_type: impl Into<String>) -> Self { + self.policy_type = Some(policy_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PolicyConfigurationList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PolicyConfigurationList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PolicyConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyConfiguration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod configurations { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) configuration_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.configuration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PolicyConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PolicyConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The policy configuration to create."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::PolicyConfiguration>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `configuration_id`: ID of the policy configuration"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The policy configuration to update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `configuration_id`: ID of the existing policy configuration to be updated."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::PolicyConfiguration>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `configuration_id`: ID of the policy configuration to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - configuration_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - configuration_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PolicyConfigurationList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfigurationList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) scope: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - pub(crate) policy_type: Option<String>, - } - 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<String>) -> Self { - self.scope = Some(scope.into()); - self - } - #[doc = "Maximum number of policies to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "The continuation token used for pagination."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Filter returned policies to only this type"] - pub fn policy_type(mut self, policy_type: impl Into<String>) -> Self { - self.policy_type = Some(policy_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PolicyConfigurationList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PolicyConfigurationList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PolicyConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PolicyConfiguration, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PolicyConfiguration>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PolicyConfiguration>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PolicyConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) configuration_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.configuration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PolicyConfiguration>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PolicyConfiguration>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PolicyConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PolicyConfiguration, - pub(crate) project: String, - pub(crate) configuration_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.configuration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PolicyConfiguration>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PolicyConfiguration>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) configuration_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.configuration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PolicyConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyConfiguration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PolicyConfiguration, + pub(crate) project: String, + pub(crate) configuration_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.configuration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PolicyConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PolicyConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PolicyConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyConfiguration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PolicyConfiguration, + pub(crate) project: String, + pub(crate) configuration_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.configuration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PolicyConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PolicyConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) configuration_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.configuration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod revisions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve all revisions for a given policy."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `configuration_id`: The policy configuration ID."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `configuration_id`: The policy configuration ID."] + #[doc = "* `revision_id`: The revision ID."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve all revisions for a given policy."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `configuration_id`: The policy configuration ID."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `configuration_id`: The policy configuration ID."] - #[doc = "* `revision_id`: The revision ID."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PolicyConfigurationList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfigurationList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) configuration_id: i32, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - } - impl RequestBuilder { - #[doc = "The number of revisions to retrieve."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "The number of revisions to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations/{}/revisions", - this.client.endpoint(), - &this.organization, - &this.project, - &this.configuration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PolicyConfigurationList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PolicyConfigurationList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PolicyConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) configuration_id: i32, - pub(crate) revision_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations/{}/revisions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.configuration_id, - &this.revision_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PolicyConfiguration>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PolicyConfiguration>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PolicyConfigurationList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyConfigurationList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) configuration_id: i32, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + } + impl RequestBuilder { + #[doc = "The number of revisions to retrieve."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "The number of revisions to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations/{}/revisions", + this.client.endpoint(), + &this.organization, + &this.project, + &this.configuration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PolicyConfigurationList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PolicyConfigurationList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PolicyConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyConfiguration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) configuration_id: i32, + pub(crate) revision_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations/{}/revisions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.configuration_id, + &this.revision_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PolicyConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PolicyConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod evaluations { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `artifact_id`: A string which uniquely identifies the target of a policy evaluation."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + artifact_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `evaluation_id`: ID of the policy evaluation to be retrieved."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + evaluation_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `evaluation_id`: ID of the policy evaluation to be retrieved."] + pub fn requeue_policy_evaluation( + &self, + organization: impl Into<String>, + project: impl Into<String>, + evaluation_id: impl Into<String>, + ) -> 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 list { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `artifact_id`: A string which uniquely identifies the target of a policy evaluation."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - artifact_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `evaluation_id`: ID of the policy evaluation to be retrieved."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - evaluation_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `evaluation_id`: ID of the policy evaluation to be retrieved."] - pub fn requeue_policy_evaluation( - &self, - organization: impl Into<String>, - project: impl Into<String>, - evaluation_id: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PolicyEvaluationRecordList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyEvaluationRecordList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) artifact_id: String, - pub(crate) include_not_applicable: Option<bool>, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - } - 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); - self - } - #[doc = "The number of policy evaluation records to retrieve."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "The number of policy evaluation records to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/policy/evaluations", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PolicyEvaluationRecordList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PolicyEvaluationRecordList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PolicyEvaluationRecord> { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyEvaluationRecord = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) evaluation_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/policy/evaluations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.evaluation_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PolicyEvaluationRecord>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PolicyEvaluationRecord>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod requeue_policy_evaluation { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PolicyEvaluationRecord> { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyEvaluationRecord = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) evaluation_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/policy/evaluations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.evaluation_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PolicyEvaluationRecord>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PolicyEvaluationRecord>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PolicyEvaluationRecordList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyEvaluationRecordList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) artifact_id: String, + pub(crate) include_not_applicable: Option<bool>, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + } + 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); + self + } + #[doc = "The number of policy evaluation records to retrieve."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "The number of policy evaluation records to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/policy/evaluations", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PolicyEvaluationRecordList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PolicyEvaluationRecordList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PolicyEvaluationRecord> { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyEvaluationRecord = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) evaluation_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/policy/evaluations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.evaluation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PolicyEvaluationRecord>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PolicyEvaluationRecord>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod requeue_policy_evaluation { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PolicyEvaluationRecord> { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyEvaluationRecord = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) evaluation_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/policy/evaluations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.evaluation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PolicyEvaluationRecord>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PolicyEvaluationRecord>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod types { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve all available policy types."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Retrieve a specific policy type by ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `type_id`: The policy ID."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + type_id: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_id: type_id.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve all available policy types."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - #[doc = "Retrieve a specific policy type by ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `type_id`: The policy ID."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - type_id: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - type_id: type_id.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PolicyTypeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyTypeList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/policy/types", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PolicyTypeList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PolicyTypeList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PolicyType> { - let bytes = self.0.into_body().collect().await?; - let body: models::PolicyType = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) type_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/policy/types/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.type_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PolicyType>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PolicyType>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PolicyTypeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyTypeList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/policy/types", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PolicyTypeList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PolicyTypeList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PolicyType> { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyType = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) type_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/policy/types/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.type_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PolicyType>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::PolicyType>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/policy/models.rs b/azure_devops_rust_api/src/policy/models.rs index 3dc73dae..ddaacea4 100644 --- a/azure_devops_rust_api/src/policy/models.rs +++ b/azure_devops_rust_api/src/policy/models.rs @@ -8,388 +8,386 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, } + } } #[doc = "Represents a JSON object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JObject { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<String>, - #[doc = "Gets the node type for this JToken."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<String>, + #[doc = "Gets the node type for this JToken."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl JObject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The full policy configuration with settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyConfiguration { - #[serde(flatten)] - pub versioned_policy_configuration_ref: VersionedPolicyConfigurationRef, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "The date and time when the policy was created."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Indicates whether the policy is blocking."] - #[serde( - rename = "isBlocking", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_blocking: Option<bool>, - #[doc = "Indicates whether the policy has been (soft) deleted."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "Indicates whether the policy is enabled."] - #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_enabled: Option<bool>, - #[doc = "If set, this policy requires \"Manage Enterprise Policies\" permission to create, edit, or delete."] - #[serde( - rename = "isEnterpriseManaged", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_enterprise_managed: Option<bool>, - #[doc = "The policy configuration settings."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option<serde_json::Value>, + #[serde(flatten)] + pub versioned_policy_configuration_ref: VersionedPolicyConfigurationRef, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "The date and time when the policy was created."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Indicates whether the policy is blocking."] + #[serde( + rename = "isBlocking", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_blocking: Option<bool>, + #[doc = "Indicates whether the policy has been (soft) deleted."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "Indicates whether the policy is enabled."] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option<bool>, + #[doc = "If set, this policy requires \"Manage Enterprise Policies\" permission to create, edit, or delete."] + #[serde( + rename = "isEnterpriseManaged", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_enterprise_managed: Option<bool>, + #[doc = "The policy configuration settings."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub settings: Option<serde_json::Value>, } impl PolicyConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyConfigurationList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<PolicyConfiguration>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<PolicyConfiguration>, } impl PolicyConfigurationList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Policy configuration reference."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyConfigurationRef { - #[doc = "The policy configuration ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Policy type reference."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<PolicyTypeRef>, - #[doc = "The URL where the policy configuration can be retrieved."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The policy configuration ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Policy type reference."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<PolicyTypeRef>, + #[doc = "The URL where the policy configuration can be retrieved."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl PolicyConfigurationRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This record encapsulates the current state of a policy as it applies to one specific pull request. Each pull request has a unique PolicyEvaluationRecord for each pull request which the policy applies to."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyEvaluationRecord { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "A string which uniquely identifies the target of a policy evaluation."] - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<String>, - #[doc = "Time when this policy finished evaluating on this pull request."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "The full policy configuration with settings."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<PolicyConfiguration>, - #[doc = "Internal context data of this policy evaluation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub context: Option<serde_json::Value>, - #[doc = "Guid which uniquely identifies this evaluation record (one policy running on one pull request)."] - #[serde( - rename = "evaluationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub evaluation_id: Option<String>, - #[doc = "Time when this policy was first evaluated on this pull request."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_date: Option<time::OffsetDateTime>, - #[doc = "Status of the policy (Running, Approved, Failed, etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<policy_evaluation_record::Status>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "A string which uniquely identifies the target of a policy evaluation."] + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<String>, + #[doc = "Time when this policy finished evaluating on this pull request."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "The full policy configuration with settings."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<PolicyConfiguration>, + #[doc = "Internal context data of this policy evaluation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub context: Option<serde_json::Value>, + #[doc = "Guid which uniquely identifies this evaluation record (one policy running on one pull request)."] + #[serde( + rename = "evaluationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub evaluation_id: Option<String>, + #[doc = "Time when this policy was first evaluated on this pull request."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_date: Option<time::OffsetDateTime>, + #[doc = "Status of the policy (Running, Approved, Failed, etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<policy_evaluation_record::Status>, } impl PolicyEvaluationRecord { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod policy_evaluation_record { - use super::*; - #[doc = "Status of the policy (Running, Approved, Failed, etc.)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "queued")] - Queued, - #[serde(rename = "running")] - Running, - #[serde(rename = "approved")] - Approved, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "notApplicable")] - NotApplicable, - #[serde(rename = "broken")] - Broken, - } + use super::*; + #[doc = "Status of the policy (Running, Approved, Failed, etc.)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "queued")] + Queued, + #[serde(rename = "running")] + Running, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "notApplicable")] + NotApplicable, + #[serde(rename = "broken")] + Broken, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyEvaluationRecordList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<PolicyEvaluationRecord>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<PolicyEvaluationRecord>, } impl PolicyEvaluationRecordList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "User-friendly policy type with description (used for querying policy types)."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PolicyType { - #[serde(flatten)] - pub policy_type_ref: PolicyTypeRef, - #[doc = "Links"] - #[serde(rename = "_links")] - pub links: serde_json::Value, - #[doc = "Detailed description of the policy type."] - pub description: String, + #[serde(flatten)] + pub policy_type_ref: PolicyTypeRef, + #[doc = "Links"] + #[serde(rename = "_links")] + pub links: serde_json::Value, + #[doc = "Detailed description of the policy type."] + pub description: String, } impl PolicyType { - pub fn new( - policy_type_ref: PolicyTypeRef, - links: serde_json::Value, - description: String, - ) -> Self { - Self { - policy_type_ref, - links, - description, - } + pub fn new( + policy_type_ref: PolicyTypeRef, + links: serde_json::Value, + description: String, + ) -> Self { + Self { + policy_type_ref, + links, + description, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyTypeList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<PolicyType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<PolicyType>, } impl PolicyTypeList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Policy type reference."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PolicyTypeRef { - #[doc = "Display name of the policy type."] - #[serde(rename = "displayName")] - pub display_name: String, - #[doc = "The policy type ID."] - pub id: String, - #[doc = "The URL where the policy type can be retrieved."] - pub url: String, + #[doc = "Display name of the policy type."] + #[serde(rename = "displayName")] + pub display_name: String, + #[doc = "The policy type ID."] + pub id: String, + #[doc = "The URL where the policy type can be retrieved."] + pub url: String, } impl PolicyTypeRef { - pub fn new(display_name: String, id: String, url: String) -> Self { - Self { - display_name, - id, - url, - } + pub fn new(display_name: String, id: String, url: String) -> Self { + Self { + display_name, + id, + url, } + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A particular revision for a policy configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VersionedPolicyConfigurationRef { - #[serde(flatten)] - pub policy_configuration_ref: PolicyConfigurationRef, - #[doc = "The policy configuration revision ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[serde(flatten)] + pub policy_configuration_ref: PolicyConfigurationRef, + #[doc = "The policy configuration revision ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl VersionedPolicyConfigurationRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/processadmin/mod.rs b/azure_devops_rust_api/src/processadmin/mod.rs index eda1c222..4912d719 100644 --- a/azure_devops_rust_api/src/processadmin/mod.rs +++ b/azure_devops_rust_api/src/processadmin/mod.rs @@ -9,770 +9,770 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + pub fn behaviors_client(&self) -> behaviors::Client { + behaviors::Client(self.clone()) + } + pub fn processes_client(&self) -> processes::Client { + processes::Client(self.clone()) + } +} +pub mod behaviors { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a behavior for the process."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `behavior_ref_name`: The reference name of the behavior"] + pub fn get( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + behavior_ref_name: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + behavior_ref_name: behavior_ref_name.into(), + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Returns a list of behaviors for the process."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + pub fn list( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AdminBehavior> { + let bytes = self.0.into_body().collect().await?; + let body: models::AdminBehavior = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - pub fn behaviors_client(&self) -> behaviors::Client { - behaviors::Client(self.clone()) - } - pub fn processes_client(&self) -> processes::Client { - processes::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } -} -pub mod behaviors { + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) behavior_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processadmin/{}/behaviors?behaviorRefName={}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.behavior_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let behavior_ref_name = &this.behavior_ref_name; + req + .url_mut() + .query_pairs_mut() + .append_pair("behaviorRefName", behavior_ref_name); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AdminBehavior>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AdminBehavior>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns a behavior for the process."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `behavior_ref_name`: The reference name of the behavior"] - pub fn get( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - behavior_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - pub fn list( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - process_id: process_id.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AdminBehavior> { - let bytes = self.0.into_body().collect().await?; - let body: models::AdminBehavior = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) behavior_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processadmin/{}/behaviors?behaviorRefName={}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.behavior_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let behavior_ref_name = &this.behavior_ref_name; - req.url_mut() - .query_pairs_mut() - .append_pair("behaviorRefName", behavior_ref_name); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AdminBehavior>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::AdminBehavior>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AdminBehaviorList> { - let bytes = self.0.into_body().collect().await?; - let body: models::AdminBehaviorList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processadmin/{}/behaviors", - this.client.endpoint(), - &this.organization, - &this.process_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AdminBehaviorList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::AdminBehaviorList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AdminBehaviorList> { + let bytes = self.0.into_body().collect().await?; + let body: models::AdminBehaviorList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processadmin/{}/behaviors", + this.client.endpoint(), + &this.organization, + &this.process_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AdminBehaviorList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AdminBehaviorList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod processes { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns requested process template."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: The ID of the process"] + pub fn export_process_template( + &self, + organization: impl Into<String>, + id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Stream to upload"] + pub fn import_process_template( + &self, + organization: impl Into<String>, + body: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: The ID of the promote job operation"] + pub fn import_process_template_status( + &self, + organization: impl Into<String>, + id: impl Into<String>, + ) -> import_process_template_status::RequestBuilder { + import_process_template_status::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id: id.into(), + } + } + } + pub mod export_process_template { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns requested process template."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: The ID of the process"] - pub fn export_process_template( - &self, - organization: impl Into<String>, - id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Stream to upload"] - pub fn import_process_template( - &self, - organization: impl Into<String>, - body: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: The ID of the promote job operation"] - pub fn import_process_template_status( - &self, - organization: impl Into<String>, - id: impl Into<String>, - ) -> import_process_template_status::RequestBuilder { - import_process_template_status::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - id: id.into(), - } - } - } - pub mod export_process_template { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processadmin/processes/export/{}", - this.client.endpoint(), - &this.organization, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod import_process_template { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessImportResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessImportResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: String, - pub(crate) ignore_warnings: Option<bool>, - pub(crate) replace_existing_template: Option<bool>, - } - 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); - self - } - #[doc = "Replaces the existing template. Default value is true."] - pub fn replace_existing_template(mut self, replace_existing_template: bool) -> Self { - self.replace_existing_template = Some(replace_existing_template); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processadmin/processes/import", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessImportResult>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessImportResult>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod import_process_template_status { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessPromoteStatus> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessPromoteStatus = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processadmin/processes/status/{}", - this.client.endpoint(), - &this.organization, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessPromoteStatus>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessPromoteStatus>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processadmin/processes/export/{}", + this.client.endpoint(), + &this.organization, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod import_process_template { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessImportResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessImportResult = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: String, + pub(crate) ignore_warnings: Option<bool>, + pub(crate) replace_existing_template: Option<bool>, + } + 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); + self + } + #[doc = "Replaces the existing template. Default value is true."] + pub fn replace_existing_template(mut self, replace_existing_template: bool) -> Self { + self.replace_existing_template = Some(replace_existing_template); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processadmin/processes/import", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/octet-stream"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessImportResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessImportResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod import_process_template_status { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessPromoteStatus> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessPromoteStatus = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processadmin/processes/status/{}", + this.client.endpoint(), + &this.organization, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessPromoteStatus>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessPromoteStatus>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/processadmin/models.rs b/azure_devops_rust_api/src/processadmin/models.rs index aee73eae..f76bbe38 100644 --- a/azure_devops_rust_api/src/processadmin/models.rs +++ b/azure_devops_rust_api/src/processadmin/models.rs @@ -8,245 +8,243 @@ use std::str::FromStr; #[doc = "Describes an admin behavior for a process."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AdminBehavior { - #[doc = "Is the behavior abstract (i.e. can not be associated with any work item type)."] - #[serde(rename = "abstract", default, skip_serializing_if = "Option::is_none")] - pub abstract_: Option<bool>, - #[doc = "The color associated with the behavior."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "Indicates if the behavior is custom."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub custom: Option<bool>, - #[doc = "The description of the behavior."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "List of behavior fields."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub fields: Vec<AdminBehaviorField>, - #[doc = "Behavior ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Parent behavior reference."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inherits: Option<String>, - #[doc = "The behavior name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Is the behavior overrides a behavior from system process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub overriden: Option<bool>, - #[doc = "The rank."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option<i32>, + #[doc = "Is the behavior abstract (i.e. can not be associated with any work item type)."] + #[serde(rename = "abstract", default, skip_serializing_if = "Option::is_none")] + pub abstract_: Option<bool>, + #[doc = "The color associated with the behavior."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "Indicates if the behavior is custom."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub custom: Option<bool>, + #[doc = "The description of the behavior."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "List of behavior fields."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub fields: Vec<AdminBehaviorField>, + #[doc = "Behavior ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Parent behavior reference."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inherits: Option<String>, + #[doc = "The behavior name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Is the behavior overrides a behavior from system process."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overriden: Option<bool>, + #[doc = "The rank."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option<i32>, } impl AdminBehavior { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes an admin behavior field."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AdminBehaviorField { - #[doc = "The behavior field identifier."] - #[serde( - rename = "behaviorFieldId", - default, - skip_serializing_if = "Option::is_none" - )] - pub behavior_field_id: Option<String>, - #[doc = "The behavior ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The behavior name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "The behavior field identifier."] + #[serde( + rename = "behaviorFieldId", + default, + skip_serializing_if = "Option::is_none" + )] + pub behavior_field_id: Option<String>, + #[doc = "The behavior ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The behavior name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl AdminBehaviorField { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AdminBehaviorList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<AdminBehavior>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<AdminBehavior>, } impl AdminBehaviorList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes result of a check template existence request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckTemplateExistenceResult { - #[doc = "Indicates whether a template exists."] - #[serde( - rename = "doesTemplateExist", - default, - skip_serializing_if = "Option::is_none" - )] - pub does_template_exist: Option<bool>, - #[doc = "The name of the existing template."] - #[serde( - rename = "existingTemplateName", - default, - skip_serializing_if = "Option::is_none" - )] - pub existing_template_name: Option<String>, - #[doc = "The existing template type identifier."] - #[serde( - rename = "existingTemplateTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub existing_template_type_id: Option<String>, - #[doc = "The name of the requested template."] - #[serde( - rename = "requestedTemplateName", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_template_name: Option<String>, + #[doc = "Indicates whether a template exists."] + #[serde( + rename = "doesTemplateExist", + default, + skip_serializing_if = "Option::is_none" + )] + pub does_template_exist: Option<bool>, + #[doc = "The name of the existing template."] + #[serde( + rename = "existingTemplateName", + default, + skip_serializing_if = "Option::is_none" + )] + pub existing_template_name: Option<String>, + #[doc = "The existing template type identifier."] + #[serde( + rename = "existingTemplateTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub existing_template_type_id: Option<String>, + #[doc = "The name of the requested template."] + #[serde( + rename = "requestedTemplateName", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_template_name: Option<String>, } impl CheckTemplateExistenceResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes the result of a Process Import request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessImportResult { - #[doc = "Describes result of a check template existence request."] - #[serde( - rename = "checkExistenceResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub check_existence_result: Option<CheckTemplateExistenceResult>, - #[doc = "Help URL."] - #[serde(rename = "helpUrl", default, skip_serializing_if = "Option::is_none")] - pub help_url: Option<String>, - #[doc = "ID of the import operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Whether this imported process is new."] - #[serde(rename = "isNew", default, skip_serializing_if = "Option::is_none")] - pub is_new: Option<bool>, - #[doc = "The promote job identifier."] - #[serde( - rename = "promoteJobId", - default, - skip_serializing_if = "Option::is_none" - )] - pub promote_job_id: Option<String>, - #[doc = "The list of validation results."] - #[serde( - rename = "validationResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub validation_results: Vec<ValidationIssue>, + #[doc = "Describes result of a check template existence request."] + #[serde( + rename = "checkExistenceResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub check_existence_result: Option<CheckTemplateExistenceResult>, + #[doc = "Help URL."] + #[serde(rename = "helpUrl", default, skip_serializing_if = "Option::is_none")] + pub help_url: Option<String>, + #[doc = "ID of the import operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Whether this imported process is new."] + #[serde(rename = "isNew", default, skip_serializing_if = "Option::is_none")] + pub is_new: Option<bool>, + #[doc = "The promote job identifier."] + #[serde( + rename = "promoteJobId", + default, + skip_serializing_if = "Option::is_none" + )] + pub promote_job_id: Option<String>, + #[doc = "The list of validation results."] + #[serde( + rename = "validationResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub validation_results: Vec<ValidationIssue>, } impl ProcessImportResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes result of process operation promote."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessPromoteStatus { - #[doc = "Number of projects for which promote is complete."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub complete: Option<i32>, - #[doc = "ID of the promote operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The error message associated with the promote operation. The string will be empty if there are no errors."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "Number of projects for which promote is pending."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pending: Option<i32>, - #[doc = "The remaining retries."] - #[serde( - rename = "remainingRetries", - default, - skip_serializing_if = "Option::is_none" - )] - pub remaining_retries: Option<i32>, - #[doc = "True if promote finished all the projects successfully. False if still in progress or any project promote failed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub successful: Option<bool>, + #[doc = "Number of projects for which promote is complete."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub complete: Option<i32>, + #[doc = "ID of the promote operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The error message associated with the promote operation. The string will be empty if there are no errors."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "Number of projects for which promote is pending."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pending: Option<i32>, + #[doc = "The remaining retries."] + #[serde( + rename = "remainingRetries", + default, + skip_serializing_if = "Option::is_none" + )] + pub remaining_retries: Option<i32>, + #[doc = "True if promote finished all the projects successfully. False if still in progress or any project promote failed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub successful: Option<bool>, } impl ProcessPromoteStatus { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ValidationIssue { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub file: Option<String>, - #[serde(rename = "helpLink", default, skip_serializing_if = "Option::is_none")] - pub help_link: Option<String>, - #[serde(rename = "issueType", default, skip_serializing_if = "Option::is_none")] - pub issue_type: Option<validation_issue::IssueType>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub line: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub file: Option<String>, + #[serde(rename = "helpLink", default, skip_serializing_if = "Option::is_none")] + pub help_link: Option<String>, + #[serde(rename = "issueType", default, skip_serializing_if = "Option::is_none")] + pub issue_type: Option<validation_issue::IssueType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub line: Option<i32>, } impl ValidationIssue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod validation_issue { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum IssueType { - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - } -} -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum IssueType { + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + } +} +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/processes/mod.rs b/azure_devops_rust_api/src/processes/mod.rs index 7a5f5342..c4630c89 100644 --- a/azure_devops_rust_api/src/processes/mod.rs +++ b/azure_devops_rust_api/src/processes/mod.rs @@ -9,7262 +9,7320 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + 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()) + } +} +pub mod groups { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Moves a group to a different page and section."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The updated group."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `page_id`: The ID of the page the group is in."] + #[doc = "* `section_id`: The ID of the section the group is i.n"] + #[doc = "* `group_id`: The ID of the group."] + #[doc = "* `remove_from_page_id`: ID of the page to remove the group from."] + #[doc = "* `remove_from_section_id`: ID of the section to remove the group from."] + pub fn move_group_to_page( + &self, + organization: impl Into<String>, + body: impl Into<models::Group>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + page_id: impl Into<String>, + section_id: impl Into<String>, + group_id: impl Into<String>, + remove_from_page_id: impl Into<String>, + remove_from_section_id: impl Into<String>, + ) -> 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 = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Adds a group to the work item form."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The group."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `page_id`: The ID of the page to add the group to."] + #[doc = "* `section_id`: The ID of the section to add the group to."] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::Group>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + page_id: impl Into<String>, + section_id: impl Into<String>, + ) -> 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 = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self + #[doc = "Moves a group to a different section."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The updated group."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `page_id`: The ID of the page the group is in."] + #[doc = "* `section_id`: The ID of the section the group is in."] + #[doc = "* `group_id`: The ID of the group."] + #[doc = "* `remove_from_section_id`: ID of the section to remove the group from."] + pub fn move_group_to_section( + &self, + organization: impl Into<String>, + body: impl Into<models::Group>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + page_id: impl Into<String>, + section_id: impl Into<String>, + group_id: impl Into<String>, + remove_from_section_id: impl Into<String>, + ) -> 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 = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + #[doc = "Updates a group in the work item form."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The updated group."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `page_id`: The ID of the page the group is in."] + #[doc = "* `section_id`: The ID of the section the group is in."] + #[doc = "* `group_id`: The ID of the group."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::Group>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + page_id: impl Into<String>, + section_id: impl Into<String>, + group_id: impl Into<String>, + ) -> 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(), + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) + #[doc = "Removes a group from the work item form."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + #[doc = "* `page_id`: The ID of the page the group is in"] + #[doc = "* `section_id`: The ID of the section to the group is in"] + #[doc = "* `group_id`: The ID of the group"] + pub fn remove_group( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + page_id: impl Into<String>, + section_id: impl Into<String>, + group_id: impl Into<String>, + ) -> 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 groups { + } + pub mod move_group_to_page { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Moves a group to a different page and section."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The updated group."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `page_id`: The ID of the page the group is in."] - #[doc = "* `section_id`: The ID of the section the group is i.n"] - #[doc = "* `group_id`: The ID of the group."] - #[doc = "* `remove_from_page_id`: ID of the page to remove the group from."] - #[doc = "* `remove_from_section_id`: ID of the section to remove the group from."] - pub fn move_group_to_page( - &self, - organization: impl Into<String>, - body: impl Into<models::Group>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - page_id: impl Into<String>, - section_id: impl Into<String>, - group_id: impl Into<String>, - remove_from_page_id: impl Into<String>, - remove_from_section_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The group."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `page_id`: The ID of the page to add the group to."] - #[doc = "* `section_id`: The ID of the section to add the group to."] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::Group>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - page_id: impl Into<String>, - section_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The updated group."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `page_id`: The ID of the page the group is in."] - #[doc = "* `section_id`: The ID of the section the group is in."] - #[doc = "* `group_id`: The ID of the group."] - #[doc = "* `remove_from_section_id`: ID of the section to remove the group from."] - pub fn move_group_to_section( - &self, - organization: impl Into<String>, - body: impl Into<models::Group>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - page_id: impl Into<String>, - section_id: impl Into<String>, - group_id: impl Into<String>, - remove_from_section_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The updated group."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `page_id`: The ID of the page the group is in."] - #[doc = "* `section_id`: The ID of the section the group is in."] - #[doc = "* `group_id`: The ID of the group."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::Group>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - page_id: impl Into<String>, - section_id: impl Into<String>, - group_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - #[doc = "* `page_id`: The ID of the page the group is in"] - #[doc = "* `section_id`: The ID of the section to the group is in"] - #[doc = "* `group_id`: The ID of the group"] - pub fn remove_group( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - page_id: impl Into<String>, - section_id: impl Into<String>, - group_id: impl Into<String>, - ) -> 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 move_group_to_page { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Group> { - let bytes = self.0.into_body().collect().await?; - let body: models::Group = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Group, - pub(crate) process_id: String, - pub(crate) wit_ref_name: String, - pub(crate) page_id: String, - pub(crate) section_id: String, - pub(crate) group_id: String, - pub(crate) remove_from_page_id: String, - pub(crate) remove_from_section_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}?removeFromPageId={}&removeFromSectionId={}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . page_id , & this . section_id , & this . group_id , & this . remove_from_page_id , & this . remove_from_section_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Group>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Group>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Group> { - let bytes = self.0.into_body().collect().await?; - let body: models::Group = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Group, - pub(crate) process_id: String, - pub(crate) wit_ref_name: String, - pub(crate) page_id: String, - pub(crate) section_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . page_id , & this . section_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Group>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Group>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod move_group_to_section { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Group> { - let bytes = self.0.into_body().collect().await?; - let body: models::Group = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Group, - pub(crate) process_id: String, - pub(crate) wit_ref_name: String, - pub(crate) page_id: String, - pub(crate) section_id: String, - pub(crate) group_id: String, - pub(crate) remove_from_section_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . page_id , & this . section_id , & this . group_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Group>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Group>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Group> { - let bytes = self.0.into_body().collect().await?; - let body: models::Group = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Group, - pub(crate) process_id: String, - pub(crate) wit_ref_name: String, - pub(crate) page_id: String, - pub(crate) section_id: String, - pub(crate) group_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . page_id , & this . section_id , & this . group_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Group>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Group>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove_group { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) wit_ref_name: String, - pub(crate) page_id: String, - pub(crate) section_id: String, - pub(crate) group_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . page_id , & this . section_id , & this . group_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Group> { + let bytes = self.0.into_body().collect().await?; + let body: models::Group = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod processes { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Group, + pub(crate) process_id: String, + pub(crate) wit_ref_name: String, + pub(crate) page_id: String, + pub(crate) section_id: String, + pub(crate) group_id: String, + pub(crate) remove_from_page_id: String, + pub(crate) remove_from_section_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}?removeFromPageId={}&removeFromSectionId={}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . page_id , & this . section_id , & this . group_id , & this . remove_from_page_id , & this . remove_from_section_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Group>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Group>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get list of all processes including system and inherited."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - expand: None, - } - } - #[doc = "Creates a process."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: CreateProcessModel."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::CreateProcessModel>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get( - &self, - organization: impl Into<String>, - process_type_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn edit_process( - &self, - organization: impl Into<String>, - body: impl Into<models::UpdateProcessModel>, - process_type_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn delete( - &self, - organization: impl Into<String>, - process_type_id: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - process_type_id: process_type_id.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessInfoList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessInfoList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessInfoList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ProcessInfoList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessInfo> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessInfo = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CreateProcessModel, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessInfo>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ProcessInfo>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessInfo> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessInfo = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_type_id: String, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}", - this.client.endpoint(), - &this.organization, - &this.process_type_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessInfo>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ProcessInfo>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod edit_process { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessInfo> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessInfo = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::UpdateProcessModel, - pub(crate) process_type_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}", - this.client.endpoint(), - &this.organization, - &this.process_type_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessInfo>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ProcessInfo>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_type_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}", - this.client.endpoint(), - &this.organization, - &this.process_type_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Group> { + let bytes = self.0.into_body().collect().await?; + let body: models::Group = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod behaviors { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Group, + pub(crate) process_id: String, + pub(crate) wit_ref_name: String, + pub(crate) page_id: String, + pub(crate) section_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.page_id, + &this.section_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Group>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Group>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod move_group_to_section { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns a list of all behaviors in the process."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - pub fn list( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::ProcessBehaviorCreateRequest>, - process_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `behavior_ref_name`: The reference name of the behavior"] - pub fn get( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - behavior_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `behavior_ref_name`: The reference name of the behavior"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::ProcessBehaviorUpdateRequest>, - process_id: impl Into<String>, - behavior_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `behavior_ref_name`: The reference name of the behavior"] - pub fn delete( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - behavior_ref_name: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessBehaviorList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessBehaviorList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/behaviors", - this.client.endpoint(), - &this.organization, - &this.process_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessBehaviorList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessBehaviorList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessBehavior> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ProcessBehaviorCreateRequest, - pub(crate) process_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/behaviors", - this.client.endpoint(), - &this.organization, - &this.process_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessBehavior>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ProcessBehavior>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessBehavior> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) behavior_ref_name: String, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/behaviors/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.behavior_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessBehavior>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ProcessBehavior>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessBehavior> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ProcessBehaviorUpdateRequest, - pub(crate) process_id: String, - pub(crate) behavior_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/behaviors/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.behavior_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessBehavior>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ProcessBehavior>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) behavior_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/behaviors/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.behavior_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Group> { + let bytes = self.0.into_body().collect().await?; + let body: models::Group = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod work_item_types { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Group, + pub(crate) process_id: String, + pub(crate) wit_ref_name: String, + pub(crate) page_id: String, + pub(crate) section_id: String, + pub(crate) group_id: String, + pub(crate) remove_from_section_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . page_id , & this . section_id , & this . group_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Group>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Group>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns a list of all work item types in a process."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - pub fn list( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process on which to create work item type."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::CreateProcessWorkItemTypeRequest>, - process_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - pub fn get( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::UpdateProcessWorkItemTypeRequest>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - pub fn delete( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemTypeList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "Flag to determine what properties of work item type to return"] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypes", - this.client.endpoint(), - &this.organization, - &this.process_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessWorkItemTypeList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessWorkItemTypeList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemType> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemType = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CreateProcessWorkItemTypeRequest, - pub(crate) process_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypes", - this.client.endpoint(), - &this.organization, - &this.process_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessWorkItemType>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessWorkItemType>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemType> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemType = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) wit_ref_name: String, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "Flag to determine what properties of work item type to return"] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypes/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessWorkItemType>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessWorkItemType>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemType> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemType = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::UpdateProcessWorkItemTypeRequest, - pub(crate) process_id: String, - pub(crate) wit_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypes/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessWorkItemType>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessWorkItemType>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) wit_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypes/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Group> { + let bytes = self.0.into_body().collect().await?; + let body: models::Group = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod fields { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Group, + pub(crate) process_id: String, + pub(crate) wit_ref_name: String, + pub(crate) page_id: String, + pub(crate) section_id: String, + pub(crate) group_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . page_id , & this . section_id , & this . group_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Group>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Group>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod remove_group { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - pub fn list( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::AddProcessWorkItemTypeFieldRequest>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `field_ref_name`: The reference name of the field."] - pub fn get( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - field_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `field_ref_name`: The reference name of the field."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::UpdateProcessWorkItemTypeFieldRequest>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - field_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `field_ref_name`: The reference name of the field."] - pub fn remove_work_item_type_field( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - field_ref_name: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ProcessWorkItemTypeFieldList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemTypeFieldList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) wit_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessWorkItemTypeFieldList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessWorkItemTypeFieldList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeField> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemTypeField = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::AddProcessWorkItemTypeFieldRequest, - pub(crate) process_id: String, - pub(crate) wit_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessWorkItemTypeField>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessWorkItemTypeField>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeField> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemTypeField = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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<String>, - } - impl RequestBuilder { - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name, - &this.field_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessWorkItemTypeField>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessWorkItemTypeField>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeField> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessWorkItemTypeField = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name, - &this.field_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessWorkItemTypeField>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessWorkItemTypeField>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove_work_item_type_field { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name, - &this.field_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) wit_ref_name: String, + pub(crate) page_id: String, + pub(crate) section_id: String, + pub(crate) group_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . page_id , & this . section_id , & this . group_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } -pub mod layout { +pub mod processes { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get list of all processes including system and inherited."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + expand: None, + } + } + #[doc = "Creates a process."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: CreateProcessModel."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::CreateProcessModel>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get( + &self, + organization: impl Into<String>, + process_type_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn edit_process( + &self, + organization: impl Into<String>, + body: impl Into<models::UpdateProcessModel>, + process_type_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn delete( + &self, + organization: impl Into<String>, + process_type_id: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_type_id: process_type_id.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the form layout."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - pub fn get( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FormLayout> { - let bytes = self.0.into_body().collect().await?; - let body: models::FormLayout = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) wit_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FormLayout>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FormLayout>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessInfoList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessInfoList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod controls { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessInfoList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessInfoList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Creates a control in a group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The control."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `group_id`: The ID of the group to add the control to."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::Control>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - group_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The control."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `group_id`: The ID of the group to move the control to."] - #[doc = "* `control_id`: The ID of the control."] - pub fn move_control_to_group( - &self, - organization: impl Into<String>, - body: impl Into<models::Control>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - group_id: impl Into<String>, - control_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The updated control."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `group_id`: The ID of the group."] - #[doc = "* `control_id`: The ID of the control."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::Control>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - group_id: impl Into<String>, - control_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `group_id`: The ID of the group."] - #[doc = "* `control_id`: The ID of the control to remove."] - pub fn remove_control_from_group( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - group_id: impl Into<String>, - control_id: impl Into<String>, - ) -> 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 create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Control> { - let bytes = self.0.into_body().collect().await?; - let body: models::Control = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . group_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Control>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Control>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod move_control_to_group { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Control> { - let bytes = self.0.into_body().collect().await?; - let body: models::Control = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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, - pub(crate) control_id: String, - pub(crate) remove_from_group_id: Option<String>, - } - 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<String>) -> Self { - self.remove_from_group_id = Some(remove_from_group_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls/{}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . group_id , & this . control_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Control>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Control>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Control> { - let bytes = self.0.into_body().collect().await?; - let body: models::Control = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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, - pub(crate) control_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls/{}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . group_id , & this . control_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Control>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Control>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove_control_from_group { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls/{}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . group_id , & this . control_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessInfo> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessInfo = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod pages { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CreateProcessModel, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessInfo>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessInfo>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Adds a page to the work item form."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The page."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::Page>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The page"] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::Page>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - #[doc = "* `page_id`: The ID of the page"] - pub fn remove_page( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - page_id: impl Into<String>, - ) -> 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 add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Page> { - let bytes = self.0.into_body().collect().await?; - let body: models::Page = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Page, - pub(crate) process_id: String, - pub(crate) wit_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Page>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Page>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Page> { - let bytes = self.0.into_body().collect().await?; - let body: models::Page = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Page, - pub(crate) process_id: String, - pub(crate) wit_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Page>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Page>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove_page { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) wit_ref_name: String, - pub(crate) page_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name, - &this.page_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessInfo> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessInfo = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod system_controls { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_type_id: String, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}", + this.client.endpoint(), + &this.organization, + &this.process_type_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessInfo>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessInfo>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod edit_process { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - pub fn list( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `control_id`: The ID of the control."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::Control>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - control_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process."] - #[doc = "* `wit_ref_name`: The reference name of the work item type."] - #[doc = "* `control_id`: The ID of the control."] - pub fn delete( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - control_id: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ControlList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ControlList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) wit_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ControlList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ControlList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Control> { - let bytes = self.0.into_body().collect().await?; - let body: models::Control = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols/{}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . control_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Control>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Control>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ControlList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ControlList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) wit_ref_name: String, - pub(crate) control_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols/{}" , this . client . endpoint () , & this . organization , & this . process_id , & this . wit_ref_name , & this . control_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ControlList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ControlList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessInfo> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessInfo = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod rules { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UpdateProcessModel, + pub(crate) process_type_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}", + this.client.endpoint(), + &this.organization, + &this.process_type_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessInfo>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessInfo>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - pub fn list( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::CreateProcessRuleRequest>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - #[doc = "* `rule_id`: The ID of the rule"] - pub fn get( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - rule_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - #[doc = "* `rule_id`: The ID of the rule"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::UpdateProcessRuleRequest>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - rule_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - #[doc = "* `rule_id`: The ID of the rule"] - pub fn delete( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - rule_id: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessRuleList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessRuleList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) wit_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessRuleList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ProcessRuleList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessRule> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessRule = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CreateProcessRuleRequest, - pub(crate) process_id: String, - pub(crate) wit_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessRule>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ProcessRule>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessRule> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessRule = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name, - &this.rule_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessRule>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ProcessRule>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessRule> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessRule = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name, - &this.rule_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessRule>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ProcessRule>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name, - &this.rule_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_type_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}", + this.client.endpoint(), + &this.organization, + &this.process_type_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } -pub mod states { +pub mod behaviors { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a list of all behaviors in the process."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + pub fn list( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::ProcessBehaviorCreateRequest>, + process_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `behavior_ref_name`: The reference name of the behavior"] + pub fn get( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + behavior_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `behavior_ref_name`: The reference name of the behavior"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::ProcessBehaviorUpdateRequest>, + process_id: impl Into<String>, + behavior_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `behavior_ref_name`: The reference name of the behavior"] + pub fn delete( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + behavior_ref_name: impl Into<String>, + ) -> 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 list { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - pub fn list( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemStateInputModel>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - #[doc = "* `state_id`: The ID of the state"] - pub fn get( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - state_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - #[doc = "* `state_id`: The ID of the state"] - pub fn hide_state_definition( - &self, - organization: impl Into<String>, - body: impl Into<models::HideStateModel>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - state_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - #[doc = "* `state_id`: ID of the state"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemStateInputModel>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - state_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: ID of the process"] - #[doc = "* `wit_ref_name`: The reference name of the work item type"] - #[doc = "* `state_id`: ID of the state"] - pub fn delete( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name: impl Into<String>, - state_id: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::WorkItemStateResultModelList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemStateResultModelList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) wit_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemStateResultModelList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemStateResultModelList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModel> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemStateResultModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemStateInputModel, - pub(crate) process_id: String, - pub(crate) wit_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemStateResultModel>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemStateResultModel>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModel> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemStateResultModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name, - &this.state_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemStateResultModel>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemStateResultModel>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod hide_state_definition { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModel> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemStateResultModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name, - &this.state_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemStateResultModel>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemStateResultModel>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModel> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemStateResultModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name, - &this.state_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemStateResultModel>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemStateResultModel>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name, - &this.state_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessBehaviorList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessBehaviorList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod work_item_types_behaviors { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/behaviors", + this.client.endpoint(), + &this.organization, + &this.process_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessBehaviorList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessBehaviorList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"] - pub fn list( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name_for_behaviors: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"] - pub fn add( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemTypeBehavior>, - process_id: impl Into<String>, - wit_ref_name_for_behaviors: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemTypeBehavior>, - process_id: impl Into<String>, - wit_ref_name_for_behaviors: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"] - #[doc = "* `behavior_ref_name`: The reference name of the behavior"] - pub fn get( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name_for_behaviors: impl Into<String>, - behavior_ref_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `process_id`: The ID of the process"] - #[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"] - #[doc = "* `behavior_ref_name`: The reference name of the behavior"] - pub fn remove_behavior_from_work_item_type( - &self, - organization: impl Into<String>, - process_id: impl Into<String>, - wit_ref_name_for_behaviors: impl Into<String>, - behavior_ref_name: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeBehaviorList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeBehaviorList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) process_id: String, - pub(crate) wit_ref_name_for_behaviors: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name_for_behaviors - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTypeBehaviorList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemTypeBehaviorList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeBehavior> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemTypeBehavior, - pub(crate) process_id: String, - pub(crate) wit_ref_name_for_behaviors: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name_for_behaviors - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTypeBehavior>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemTypeBehavior>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeBehavior> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemTypeBehavior, - pub(crate) process_id: String, - pub(crate) wit_ref_name_for_behaviors: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name_for_behaviors - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTypeBehavior>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemTypeBehavior>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeBehavior> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeBehavior = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name_for_behaviors, - &this.behavior_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTypeBehavior>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemTypeBehavior>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove_behavior_from_work_item_type { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors/{}", - this.client.endpoint(), - &this.organization, - &this.process_id, - &this.wit_ref_name_for_behaviors, - &this.behavior_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessBehavior> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessBehavior = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ProcessBehaviorCreateRequest, + pub(crate) process_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/behaviors", + this.client.endpoint(), + &this.organization, + &this.process_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessBehavior>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessBehavior>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessBehavior> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessBehavior = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) behavior_ref_name: String, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/behaviors/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.behavior_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessBehavior>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessBehavior>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessBehavior> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessBehavior = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ProcessBehaviorUpdateRequest, + pub(crate) process_id: String, + pub(crate) behavior_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/behaviors/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.behavior_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessBehavior>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessBehavior>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) behavior_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/behaviors/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.behavior_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } -pub mod lists { +pub mod work_item_types { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a list of all work item types in a process."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + pub fn list( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process on which to create work item type."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::CreateProcessWorkItemTypeRequest>, + process_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + pub fn get( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::UpdateProcessWorkItemTypeRequest>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 itewm type in the process."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + pub fn delete( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns meta data of the picklist."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - #[doc = "Creates a picklist."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Picklist"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::PickList>, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - #[doc = "Returns a picklist."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `list_id`: The ID of the list"] - pub fn get( - &self, - organization: impl Into<String>, - list_id: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - list_id: list_id.into(), - } - } - #[doc = "Updates a list."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `list_id`: The ID of the list"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::PickList>, - list_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `list_id`: The ID of the list"] - pub fn delete( - &self, - organization: impl Into<String>, - list_id: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - list_id: list_id.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PickListMetadataList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PickListMetadataList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/lists", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PickListMetadataList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PickListMetadataList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PickList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PickList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PickList, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/lists", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PickList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PickList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PickList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PickList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) list_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/lists/{}", - this.client.endpoint(), - &this.organization, - &this.list_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PickList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PickList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PickList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PickList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PickList, - pub(crate) list_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/lists/{}", - this.client.endpoint(), - &this.organization, - &this.list_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PickList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PickList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) list_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/processes/lists/{}", - this.client.endpoint(), - &this.organization, - &this.list_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessWorkItemTypeList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "Flag to determine what properties of work item type to return"] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypes", + this.client.endpoint(), + &this.organization, + &this.process_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessWorkItemTypeList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessWorkItemTypeList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemType> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessWorkItemType = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CreateProcessWorkItemTypeRequest, + pub(crate) process_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypes", + this.client.endpoint(), + &this.organization, + &this.process_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessWorkItemType>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessWorkItemType>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemType> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessWorkItemType = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) wit_ref_name: String, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "Flag to determine what properties of work item type to return"] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypes/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessWorkItemType>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessWorkItemType>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemType> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessWorkItemType = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UpdateProcessWorkItemTypeRequest, + pub(crate) process_id: String, + pub(crate) wit_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypes/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessWorkItemType>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessWorkItemType>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) wit_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypes/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod fields { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + pub fn list( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::AddProcessWorkItemTypeFieldRequest>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `field_ref_name`: The reference name of the field."] + pub fn get( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + field_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `field_ref_name`: The reference name of the field."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::UpdateProcessWorkItemTypeFieldRequest>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + field_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `field_ref_name`: The reference name of the field."] + pub fn remove_work_item_type_field( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + field_ref_name: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeFieldList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessWorkItemTypeFieldList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) wit_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessWorkItemTypeFieldList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::ProcessWorkItemTypeFieldList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeField> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessWorkItemTypeField = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::AddProcessWorkItemTypeFieldRequest, + pub(crate) process_id: String, + pub(crate) wit_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessWorkItemTypeField>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessWorkItemTypeField>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeField> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessWorkItemTypeField = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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<String>, + } + impl RequestBuilder { + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.field_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessWorkItemTypeField>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessWorkItemTypeField>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeField> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessWorkItemTypeField = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.field_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessWorkItemTypeField>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessWorkItemTypeField>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod remove_work_item_type_field { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.field_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod layout { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the form layout."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + pub fn get( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FormLayout> { + let bytes = self.0.into_body().collect().await?; + let body: models::FormLayout = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) wit_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FormLayout>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::FormLayout>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod controls { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Creates a control in a group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The control."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `group_id`: The ID of the group to add the control to."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::Control>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + group_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The control."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `group_id`: The ID of the group to move the control to."] + #[doc = "* `control_id`: The ID of the control."] + pub fn move_control_to_group( + &self, + organization: impl Into<String>, + body: impl Into<models::Control>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + group_id: impl Into<String>, + control_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The updated control."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `group_id`: The ID of the group."] + #[doc = "* `control_id`: The ID of the control."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::Control>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + group_id: impl Into<String>, + control_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `group_id`: The ID of the group."] + #[doc = "* `control_id`: The ID of the control to remove."] + pub fn remove_control_from_group( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + group_id: impl Into<String>, + control_id: impl Into<String>, + ) -> 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 create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Control> { + let bytes = self.0.into_body().collect().await?; + let body: models::Control = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Control>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Control>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod move_control_to_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Control> { + let bytes = self.0.into_body().collect().await?; + let body: models::Control = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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, + pub(crate) control_id: String, + pub(crate) remove_from_group_id: Option<String>, + } + 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<String>) -> Self { + self.remove_from_group_id = Some(remove_from_group_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.group_id, + &this.control_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Control>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Control>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Control> { + let bytes = self.0.into_body().collect().await?; + let body: models::Control = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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, + pub(crate) control_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.group_id, + &this.control_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Control>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Control>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod remove_control_from_group { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.group_id, + &this.control_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod pages { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Adds a page to the work item form."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The page."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::Page>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The page"] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::Page>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + #[doc = "* `page_id`: The ID of the page"] + pub fn remove_page( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + page_id: impl Into<String>, + ) -> 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 add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Page> { + let bytes = self.0.into_body().collect().await?; + let body: models::Page = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Page, + pub(crate) process_id: String, + pub(crate) wit_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Page>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Page>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Page> { + let bytes = self.0.into_body().collect().await?; + let body: models::Page = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Page, + pub(crate) process_id: String, + pub(crate) wit_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Page>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Page>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod remove_page { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) wit_ref_name: String, + pub(crate) page_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.page_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod system_controls { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + pub fn list( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `control_id`: The ID of the control."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::Control>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + control_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process."] + #[doc = "* `wit_ref_name`: The reference name of the work item type."] + #[doc = "* `control_id`: The ID of the control."] + pub fn delete( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + control_id: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ControlList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ControlList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) wit_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ControlList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ControlList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Control> { + let bytes = self.0.into_body().collect().await?; + let body: models::Control = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.control_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Control>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Control>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ControlList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ControlList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) wit_ref_name: String, + pub(crate) control_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.control_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ControlList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ControlList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod rules { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + pub fn list( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::CreateProcessRuleRequest>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + #[doc = "* `rule_id`: The ID of the rule"] + pub fn get( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + rule_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + #[doc = "* `rule_id`: The ID of the rule"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::UpdateProcessRuleRequest>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + rule_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + #[doc = "* `rule_id`: The ID of the rule"] + pub fn delete( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + rule_id: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessRuleList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessRuleList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) wit_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessRuleList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessRuleList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessRule> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessRule = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CreateProcessRuleRequest, + pub(crate) process_id: String, + pub(crate) wit_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessRule>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessRule>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessRule> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessRule = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessRule>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessRule>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessRule> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessRule = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessRule>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessRule>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod states { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + pub fn list( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemStateInputModel>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + #[doc = "* `state_id`: The ID of the state"] + pub fn get( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + state_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + #[doc = "* `state_id`: The ID of the state"] + pub fn hide_state_definition( + &self, + organization: impl Into<String>, + body: impl Into<models::HideStateModel>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + state_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + #[doc = "* `state_id`: ID of the state"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemStateInputModel>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + state_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: ID of the process"] + #[doc = "* `wit_ref_name`: The reference name of the work item type"] + #[doc = "* `state_id`: ID of the state"] + pub fn delete( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name: impl Into<String>, + state_id: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModelList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemStateResultModelList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) wit_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemStateResultModelList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::WorkItemStateResultModelList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModel> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemStateResultModel = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WorkItemStateInputModel, + pub(crate) process_id: String, + pub(crate) wit_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemStateResultModel>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemStateResultModel>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModel> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemStateResultModel = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.state_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemStateResultModel>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemStateResultModel>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod hide_state_definition { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModel> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemStateResultModel = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.state_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemStateResultModel>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemStateResultModel>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModel> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemStateResultModel = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.state_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemStateResultModel>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemStateResultModel>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name, + &this.state_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod work_item_types_behaviors { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"] + pub fn list( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name_for_behaviors: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemTypeBehavior>, + process_id: impl Into<String>, + wit_ref_name_for_behaviors: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemTypeBehavior>, + process_id: impl Into<String>, + wit_ref_name_for_behaviors: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"] + #[doc = "* `behavior_ref_name`: The reference name of the behavior"] + pub fn get( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name_for_behaviors: impl Into<String>, + behavior_ref_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `process_id`: The ID of the process"] + #[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"] + #[doc = "* `behavior_ref_name`: The reference name of the behavior"] + pub fn remove_behavior_from_work_item_type( + &self, + organization: impl Into<String>, + process_id: impl Into<String>, + wit_ref_name_for_behaviors: impl Into<String>, + behavior_ref_name: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeBehaviorList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTypeBehaviorList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) process_id: String, + pub(crate) wit_ref_name_for_behaviors: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name_for_behaviors + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTypeBehaviorList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTypeBehaviorList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeBehavior> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTypeBehavior = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WorkItemTypeBehavior, + pub(crate) process_id: String, + pub(crate) wit_ref_name_for_behaviors: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name_for_behaviors + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTypeBehavior>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTypeBehavior>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeBehavior> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTypeBehavior = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WorkItemTypeBehavior, + pub(crate) process_id: String, + pub(crate) wit_ref_name_for_behaviors: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name_for_behaviors + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTypeBehavior>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTypeBehavior>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeBehavior> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTypeBehavior = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name_for_behaviors, + &this.behavior_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTypeBehavior>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTypeBehavior>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod remove_behavior_from_work_item_type { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors/{}", + this.client.endpoint(), + &this.organization, + &this.process_id, + &this.wit_ref_name_for_behaviors, + &this.behavior_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } +} +pub mod lists { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns meta data of the picklist."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Creates a picklist."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Picklist"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::PickList>, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Returns a picklist."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `list_id`: The ID of the list"] + pub fn get( + &self, + organization: impl Into<String>, + list_id: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + list_id: list_id.into(), + } + } + #[doc = "Updates a list."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `list_id`: The ID of the list"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::PickList>, + list_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `list_id`: The ID of the list"] + pub fn delete( + &self, + organization: impl Into<String>, + list_id: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + list_id: list_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PickListMetadataList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PickListMetadataList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/lists", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PickListMetadataList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PickListMetadataList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PickList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PickList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PickList, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/lists", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PickList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::PickList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PickList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PickList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) list_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/lists/{}", + this.client.endpoint(), + &this.organization, + &this.list_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PickList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::PickList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PickList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PickList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PickList, + pub(crate) list_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/lists/{}", + this.client.endpoint(), + &this.organization, + &this.list_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PickList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::PickList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) list_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/processes/lists/{}", + this.client.endpoint(), + &this.organization, + &this.list_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } diff --git a/azure_devops_rust_api/src/processes/models.rs b/azure_devops_rust_api/src/processes/models.rs index 47f9a231..cc60157b 100644 --- a/azure_devops_rust_api/src/processes/models.rs +++ b/azure_devops_rust_api/src/processes/models.rs @@ -8,1740 +8,1733 @@ use std::str::FromStr; #[doc = "Class that describes a request to add a field in a work item type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AddProcessWorkItemTypeFieldRequest { - #[doc = "The list of field allowed values."] - #[serde( - rename = "allowedValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub allowed_values: Vec<String>, - #[doc = "Allow setting field value to a group identity. Only applies to identity fields."] - #[serde( - rename = "allowGroups", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_groups: Option<bool>, - #[doc = "The default value of the field."] - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<serde_json::Value>, - #[doc = "If true the field cannot be edited."] - #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] - pub read_only: Option<bool>, - #[doc = "Reference name of the field."] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "If true the field cannot be empty."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub required: Option<bool>, + #[doc = "The list of field allowed values."] + #[serde( + rename = "allowedValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub allowed_values: Vec<String>, + #[doc = "Allow setting field value to a group identity. Only applies to identity fields."] + #[serde( + rename = "allowGroups", + default, + skip_serializing_if = "Option::is_none" + )] + pub allow_groups: Option<bool>, + #[doc = "The default value of the field."] + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<serde_json::Value>, + #[doc = "If true the field cannot be edited."] + #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] + pub read_only: Option<bool>, + #[doc = "Reference name of the field."] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "If true the field cannot be empty."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub required: Option<bool>, } impl AddProcessWorkItemTypeFieldRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represent a control in the form."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Control { - #[doc = "Properties of a work item form contribution"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub contribution: Option<WitContribution>, - #[doc = "Type of the control."] - #[serde( - rename = "controlType", - default, - skip_serializing_if = "Option::is_none" - )] - pub control_type: Option<String>, - #[doc = "Height of the control, for html controls."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub height: Option<i32>, - #[doc = "The id for the layout node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "A value indicating whether this layout node has been inherited. from a parent layout. This is expected to only be only set by the combiner."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inherited: Option<bool>, - #[doc = "A value indicating if the layout node is contribution or not."] - #[serde( - rename = "isContribution", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_contribution: Option<bool>, - #[doc = "Label for the field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub label: Option<String>, - #[doc = "Inner text of the control."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub metadata: Option<String>, - #[doc = "Order in which the control should appear in its group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, - #[doc = "A value indicating whether this layout node has been overridden . by a child layout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub overridden: Option<bool>, - #[doc = "A value indicating if the control is readonly."] - #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] - pub read_only: Option<bool>, - #[doc = "A value indicating if the control should be hidden or not."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub visible: Option<bool>, - #[doc = "Watermark text for the textbox."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub watermark: Option<String>, + #[doc = "Properties of a work item form contribution"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub contribution: Option<WitContribution>, + #[doc = "Type of the control."] + #[serde( + rename = "controlType", + default, + skip_serializing_if = "Option::is_none" + )] + pub control_type: Option<String>, + #[doc = "Height of the control, for html controls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub height: Option<i32>, + #[doc = "The id for the layout node."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "A value indicating whether this layout node has been inherited. from a parent layout. This is expected to only be only set by the combiner."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inherited: Option<bool>, + #[doc = "A value indicating if the layout node is contribution or not."] + #[serde( + rename = "isContribution", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_contribution: Option<bool>, + #[doc = "Label for the field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option<String>, + #[doc = "Inner text of the control."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metadata: Option<String>, + #[doc = "Order in which the control should appear in its group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, + #[doc = "A value indicating whether this layout node has been overridden . by a child layout."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overridden: Option<bool>, + #[doc = "A value indicating if the control is readonly."] + #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] + pub read_only: Option<bool>, + #[doc = "A value indicating if the control should be hidden or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub visible: Option<bool>, + #[doc = "Watermark text for the textbox."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub watermark: Option<String>, } impl Control { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ControlList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Control>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Control>, } impl ControlList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a process being created."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreateProcessModel { - #[doc = "Description of the process"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Name of the process"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The ID of the parent process"] - #[serde( - rename = "parentProcessTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_process_type_id: Option<String>, - #[doc = "Reference name of process being created. If not specified, server will assign a unique reference name"] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, + #[doc = "Description of the process"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Name of the process"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The ID of the parent process"] + #[serde( + rename = "parentProcessTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_process_type_id: Option<String>, + #[doc = "Reference name of process being created. If not specified, server will assign a unique reference name"] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, } impl CreateProcessModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Request object/class for creating a rule on a work item type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreateProcessRuleRequest { - #[doc = "List of actions to take when the rule is triggered."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub actions: Vec<RuleAction>, - #[doc = "List of conditions when the rule should be triggered."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub conditions: Vec<RuleCondition>, - #[doc = "Indicates if the rule is disabled."] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "Name for the rule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "List of actions to take when the rule is triggered."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub actions: Vec<RuleAction>, + #[doc = "List of conditions when the rule should be triggered."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub conditions: Vec<RuleCondition>, + #[doc = "Indicates if the rule is disabled."] + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[doc = "Name for the rule."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl CreateProcessRuleRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Class for create work item type request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreateProcessWorkItemTypeRequest { - #[doc = "Color hexadecimal code to represent the work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "Description of the work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Icon to represent the work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub icon: Option<String>, - #[doc = "Parent work item type for work item type"] - #[serde( - rename = "inheritsFrom", - default, - skip_serializing_if = "Option::is_none" - )] - pub inherits_from: Option<String>, - #[doc = "True if the work item type need to be disabled"] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "Name of work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Color hexadecimal code to represent the work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "Description of the work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Icon to represent the work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icon: Option<String>, + #[doc = "Parent work item type for work item type"] + #[serde( + rename = "inheritsFrom", + default, + skip_serializing_if = "Option::is_none" + )] + pub inherits_from: Option<String>, + #[doc = "True if the work item type need to be disabled"] + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[doc = "Name of work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl CreateProcessWorkItemTypeRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the extensions part of the layout"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Extension { - #[doc = "Id of the extension"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[doc = "Id of the extension"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl Extension { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FieldModel { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde( - rename = "isIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_identity: Option<bool>, - #[serde(rename = "isLocked", default, skip_serializing_if = "Option::is_none")] - pub is_locked: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<field_model::Type>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde( + rename = "isIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_identity: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<field_model::Type>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl FieldModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod field_model { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "string")] - String, - #[serde(rename = "integer")] - Integer, - #[serde(rename = "dateTime")] - DateTime, - #[serde(rename = "plainText")] - PlainText, - #[serde(rename = "html")] - Html, - #[serde(rename = "treePath")] - TreePath, - #[serde(rename = "history")] - History, - #[serde(rename = "double")] - Double, - #[serde(rename = "guid")] - Guid, - #[serde(rename = "boolean")] - Boolean, - #[serde(rename = "identity")] - Identity, - #[serde(rename = "picklistInteger")] - PicklistInteger, - #[serde(rename = "picklistString")] - PicklistString, - #[serde(rename = "picklistDouble")] - PicklistDouble, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "string")] + String, + #[serde(rename = "integer")] + Integer, + #[serde(rename = "dateTime")] + DateTime, + #[serde(rename = "plainText")] + PlainText, + #[serde(rename = "html")] + Html, + #[serde(rename = "treePath")] + TreePath, + #[serde(rename = "history")] + History, + #[serde(rename = "double")] + Double, + #[serde(rename = "guid")] + Guid, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "identity")] + Identity, + #[serde(rename = "picklistInteger")] + PicklistInteger, + #[serde(rename = "picklistString")] + PicklistString, + #[serde(rename = "picklistDouble")] + PicklistDouble, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FieldRuleModel { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub actions: Vec<RuleActionModel>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub conditions: Vec<RuleConditionModel>, - #[serde( - rename = "friendlyName", - default, - skip_serializing_if = "Option::is_none" - )] - pub friendly_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[serde(rename = "isSystem", default, skip_serializing_if = "Option::is_none")] - pub is_system: Option<bool>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub actions: Vec<RuleActionModel>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub conditions: Vec<RuleConditionModel>, + #[serde( + rename = "friendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[serde(rename = "isSystem", default, skip_serializing_if = "Option::is_none")] + pub is_system: Option<bool>, } impl FieldRuleModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes the layout of a work item type"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FormLayout { - #[doc = "Gets and sets extensions list."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub extensions: Vec<Extension>, - #[doc = "Top level tabs of the layout."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub pages: Vec<Page>, - #[doc = "Headers controls of the layout."] - #[serde( - rename = "systemControls", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub system_controls: Vec<Control>, + #[doc = "Gets and sets extensions list."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub extensions: Vec<Extension>, + #[doc = "Top level tabs of the layout."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub pages: Vec<Page>, + #[doc = "Headers controls of the layout."] + #[serde( + rename = "systemControls", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub system_controls: Vec<Control>, } impl FormLayout { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represent a group in the form that holds controls in it."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Group { - #[doc = "Properties of a work item form contribution"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub contribution: Option<WitContribution>, - #[doc = "Controls to be put in the group."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub controls: Vec<Control>, - #[doc = "The height for the contribution."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub height: Option<i32>, - #[doc = "The id for the layout node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "A value indicating whether this layout node has been inherited from a parent layout. This is expected to only be only set by the combiner."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inherited: Option<bool>, - #[doc = "A value indicating if the layout node is contribution are not."] - #[serde( - rename = "isContribution", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_contribution: Option<bool>, - #[doc = "Label for the group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub label: Option<String>, - #[doc = "Order in which the group should appear in the section."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, - #[doc = "A value indicating whether this layout node has been overridden by a child layout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub overridden: Option<bool>, - #[doc = "A value indicating if the group should be hidden or not."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub visible: Option<bool>, + #[doc = "Properties of a work item form contribution"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub contribution: Option<WitContribution>, + #[doc = "Controls to be put in the group."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub controls: Vec<Control>, + #[doc = "The height for the contribution."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub height: Option<i32>, + #[doc = "The id for the layout node."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "A value indicating whether this layout node has been inherited from a parent layout. This is expected to only be only set by the combiner."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inherited: Option<bool>, + #[doc = "A value indicating if the layout node is contribution are not."] + #[serde( + rename = "isContribution", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_contribution: Option<bool>, + #[doc = "Label for the group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option<String>, + #[doc = "Order in which the group should appear in the section."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, + #[doc = "A value indicating whether this layout node has been overridden by a child layout."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overridden: Option<bool>, + #[doc = "A value indicating if the group should be hidden or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub visible: Option<bool>, } impl Group { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Class that describes the work item state is hidden."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HideStateModel { - #[doc = "Returns 'true', if workitem state is hidden, 'false' otherwise."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub hidden: Option<bool>, + #[doc = "Returns 'true', if workitem state is hidden, 'false' otherwise."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hidden: Option<bool>, } impl HideStateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a page in the work item form layout"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Page { - #[doc = "Properties of a work item form contribution"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub contribution: Option<WitContribution>, - #[doc = "The id for the layout node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "A value indicating whether this layout node has been inherited from a parent layout. This is expected to only be only set by the combiner."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inherited: Option<bool>, - #[doc = "A value indicating if the layout node is contribution are not."] - #[serde( - rename = "isContribution", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_contribution: Option<bool>, - #[doc = "The label for the page."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub label: Option<String>, - #[doc = "A value indicating whether any user operations are permitted on this page and the contents of this page"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub locked: Option<bool>, - #[doc = "Order in which the page should appear in the layout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, - #[doc = "A value indicating whether this layout node has been overridden by a child layout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub overridden: Option<bool>, - #[doc = "The icon for the page."] - #[serde(rename = "pageType", default, skip_serializing_if = "Option::is_none")] - pub page_type: Option<page::PageType>, - #[doc = "The sections of the page."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub sections: Vec<Section>, - #[doc = "A value indicating if the page should be hidden or not."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub visible: Option<bool>, + #[doc = "Properties of a work item form contribution"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub contribution: Option<WitContribution>, + #[doc = "The id for the layout node."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "A value indicating whether this layout node has been inherited from a parent layout. This is expected to only be only set by the combiner."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inherited: Option<bool>, + #[doc = "A value indicating if the layout node is contribution are not."] + #[serde( + rename = "isContribution", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_contribution: Option<bool>, + #[doc = "The label for the page."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option<String>, + #[doc = "A value indicating whether any user operations are permitted on this page and the contents of this page"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locked: Option<bool>, + #[doc = "Order in which the page should appear in the layout."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, + #[doc = "A value indicating whether this layout node has been overridden by a child layout."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overridden: Option<bool>, + #[doc = "The icon for the page."] + #[serde(rename = "pageType", default, skip_serializing_if = "Option::is_none")] + pub page_type: Option<page::PageType>, + #[doc = "The sections of the page."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub sections: Vec<Section>, + #[doc = "A value indicating if the page should be hidden or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub visible: Option<bool>, } impl Page { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod page { - use super::*; - #[doc = "The icon for the page."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum PageType { - #[serde(rename = "custom")] - Custom, - #[serde(rename = "history")] - History, - #[serde(rename = "links")] - Links, - #[serde(rename = "attachments")] - Attachments, - } + use super::*; + #[doc = "The icon for the page."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum PageType { + #[serde(rename = "custom")] + Custom, + #[serde(rename = "history")] + History, + #[serde(rename = "links")] + Links, + #[serde(rename = "attachments")] + Attachments, + } } #[doc = "Picklist."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PickList { - #[serde(flatten)] - pub pick_list_metadata: PickListMetadata, - #[doc = "A list of PicklistItemModel."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub items: Vec<String>, + #[serde(flatten)] + pub pick_list_metadata: PickListMetadata, + #[doc = "A list of PicklistItemModel."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub items: Vec<String>, } impl PickList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for picklist."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PickListMetadata { - #[doc = "ID of the picklist"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Indicates whether items outside of suggested list are allowed"] - #[serde( - rename = "isSuggested", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_suggested: Option<bool>, - #[doc = "Name of the picklist"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "DataType of picklist"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "Url of the picklist"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "ID of the picklist"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Indicates whether items outside of suggested list are allowed"] + #[serde( + rename = "isSuggested", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_suggested: Option<bool>, + #[doc = "Name of the picklist"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "DataType of picklist"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "Url of the picklist"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl PickListMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PickListMetadataList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<PickListMetadata>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<PickListMetadata>, } impl PickListMetadataList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Process Behavior Model."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessBehavior { - #[doc = "Color."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "Indicates the type of customization on this work item. System behaviors are inherited from parent process but not modified. Inherited behaviors are modified behaviors that were inherited from parent process. Custom behaviors are behaviors created by user in current process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub customization: Option<process_behavior::Customization>, - #[doc = ". Description"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Process Behavior Fields."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub fields: Vec<ProcessBehaviorField>, - #[doc = "Process behavior Reference."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inherits: Option<ProcessBehaviorReference>, - #[doc = "Behavior Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Rank of the behavior"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option<i32>, - #[doc = "Behavior Id"] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "Url of the behavior."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Color."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "Indicates the type of customization on this work item. System behaviors are inherited from parent process but not modified. Inherited behaviors are modified modified behaviors that were inherited from parent process. Custom behaviors are behaviors created by user in current process."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub customization: Option<process_behavior::Customization>, + #[doc = ". Description"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Process Behavior Fields."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub fields: Vec<ProcessBehaviorField>, + #[doc = "Process behavior Reference."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inherits: Option<ProcessBehaviorReference>, + #[doc = "Behavior Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Rank of the behavior"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option<i32>, + #[doc = "Behavior Id"] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "Url of the behavior."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ProcessBehavior { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod process_behavior { - use super::*; - #[doc = "Indicates the type of customization on this work item. System behaviors are inherited from parent process but not modified. Inherited behaviors are modified behaviors that were inherited from parent process. Custom behaviors are behaviors created by user in current process."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Customization { - #[serde(rename = "system")] - System, - #[serde(rename = "inherited")] - Inherited, - #[serde(rename = "custom")] - Custom, - } + use super::*; + #[doc = "Indicates the type of customization on this work item. System behaviors are inherited from parent process but not modified. Inherited behaviors are modified modified behaviors that were inherited from parent process. Custom behaviors are behaviors created by user in current process."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Customization { + #[serde(rename = "system")] + System, + #[serde(rename = "inherited")] + Inherited, + #[serde(rename = "custom")] + Custom, + } } #[doc = "Process Behavior Create Payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessBehaviorCreateRequest { - #[doc = "Color."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "Parent behavior id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inherits: Option<String>, - #[doc = "Name of the behavior."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "ReferenceName is optional, if not specified will be auto-generated."] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, + #[doc = "Color."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "Parent behavior id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inherits: Option<String>, + #[doc = "Name of the behavior."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "ReferenceName is optional, if not specified will be auto-generated."] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, } impl ProcessBehaviorCreateRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Process Behavior Field."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessBehaviorField { - #[doc = "Name of the field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Reference name of the field."] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "Url to field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Name of the field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Reference name of the field."] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "Url to field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ProcessBehaviorField { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessBehaviorList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ProcessBehavior>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ProcessBehavior>, } impl ProcessBehaviorList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Process behavior Reference."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessBehaviorReference { - #[doc = "Id of a Behavior."] - #[serde( - rename = "behaviorRefName", - default, - skip_serializing_if = "Option::is_none" - )] - pub behavior_ref_name: Option<String>, - #[doc = "Url to behavior."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Id of a Behavior."] + #[serde( + rename = "behaviorRefName", + default, + skip_serializing_if = "Option::is_none" + )] + pub behavior_ref_name: Option<String>, + #[doc = "Url to behavior."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ProcessBehaviorReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Process Behavior Replace Payload."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessBehaviorUpdateRequest { - #[doc = "Color."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "Behavior Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Color."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "Behavior Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ProcessBehaviorUpdateRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Process."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessInfo { - #[doc = "Indicates the type of customization on this process. System Process is default process. Inherited Process is modified process that was System process before."] - #[serde( - rename = "customizationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub customization_type: Option<process_info::CustomizationType>, - #[doc = "Description of the process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Is the process default."] - #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] - pub is_default: Option<bool>, - #[doc = "Is the process enabled."] - #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_enabled: Option<bool>, - #[doc = "Name of the process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "ID of the parent process."] - #[serde( - rename = "parentProcessTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_process_type_id: Option<String>, - #[doc = "Projects in this process to which the user is subscribed to."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub projects: Vec<ProjectReference>, - #[doc = "Reference name of the process."] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "The ID of the process."] - #[serde(rename = "typeId", default, skip_serializing_if = "Option::is_none")] - pub type_id: Option<String>, + #[doc = "Indicates the type of customization on this process. System Process is default process. Inherited Process is modified process that was System process before."] + #[serde( + rename = "customizationType", + default, + skip_serializing_if = "Option::is_none" + )] + pub customization_type: Option<process_info::CustomizationType>, + #[doc = "Description of the process."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Is the process default."] + #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] + pub is_default: Option<bool>, + #[doc = "Is the process enabled."] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option<bool>, + #[doc = "Name of the process."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "ID of the parent process."] + #[serde( + rename = "parentProcessTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_process_type_id: Option<String>, + #[doc = "Projects in this process to which the user is subscribed to."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub projects: Vec<ProjectReference>, + #[doc = "Reference name of the process."] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "The ID of the process."] + #[serde(rename = "typeId", default, skip_serializing_if = "Option::is_none")] + pub type_id: Option<String>, } impl ProcessInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod process_info { - use super::*; - #[doc = "Indicates the type of customization on this process. System Process is default process. Inherited Process is modified process that was System process before."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum CustomizationType { - #[serde(rename = "system")] - System, - #[serde(rename = "inherited")] - Inherited, - #[serde(rename = "custom")] - Custom, - } + use super::*; + #[doc = "Indicates the type of customization on this process. System Process is default process. Inherited Process is modified process that was System process before."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum CustomizationType { + #[serde(rename = "system")] + System, + #[serde(rename = "inherited")] + Inherited, + #[serde(rename = "custom")] + Custom, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessInfoList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ProcessInfo>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ProcessInfo>, } impl ProcessInfoList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessModel { - #[doc = "Description of the process"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Name of the process"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Projects in this process"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub projects: Vec<ProjectReference>, - #[doc = "Properties of the process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<ProcessProperties>, - #[doc = "Reference name of the process"] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "The ID of the process"] - #[serde(rename = "typeId", default, skip_serializing_if = "Option::is_none")] - pub type_id: Option<String>, + #[doc = "Description of the process"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Name of the process"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Projects in this process"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub projects: Vec<ProjectReference>, + #[doc = "Properties of the process."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<ProcessProperties>, + #[doc = "Reference name of the process"] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "The ID of the process"] + #[serde(rename = "typeId", default, skip_serializing_if = "Option::is_none")] + pub type_id: Option<String>, } impl ProcessModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Properties of the process."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessProperties { - #[doc = "Class of the process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub class: Option<process_properties::Class>, - #[doc = "Is the process default process."] - #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] - pub is_default: Option<bool>, - #[doc = "Is the process enabled."] - #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_enabled: Option<bool>, - #[doc = "ID of the parent process."] - #[serde( - rename = "parentProcessTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_process_type_id: Option<String>, - #[doc = "Version of the process."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Class of the process."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub class: Option<process_properties::Class>, + #[doc = "Is the process default process."] + #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] + pub is_default: Option<bool>, + #[doc = "Is the process enabled."] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option<bool>, + #[doc = "ID of the parent process."] + #[serde( + rename = "parentProcessTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_process_type_id: Option<String>, + #[doc = "Version of the process."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl ProcessProperties { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod process_properties { - use super::*; - #[doc = "Class of the process."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Class { - #[serde(rename = "system")] - System, - #[serde(rename = "derived")] - Derived, - #[serde(rename = "custom")] - Custom, - } + use super::*; + #[doc = "Class of the process."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Class { + #[serde(rename = "system")] + System, + #[serde(rename = "derived")] + Derived, + #[serde(rename = "custom")] + Custom, + } } #[doc = "Process Rule Response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessRule { - #[serde(flatten)] - pub create_process_rule_request: CreateProcessRuleRequest, - #[doc = "Indicates if the rule is system generated or created by user."] - #[serde( - rename = "customizationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub customization_type: Option<process_rule::CustomizationType>, - #[doc = "Id to uniquely identify the rule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Resource Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(flatten)] + pub create_process_rule_request: CreateProcessRuleRequest, + #[doc = "Indicates if the rule is system generated or created by user."] + #[serde( + rename = "customizationType", + default, + skip_serializing_if = "Option::is_none" + )] + pub customization_type: Option<process_rule::CustomizationType>, + #[doc = "Id to uniquely identify the rule."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Resource Url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ProcessRule { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod process_rule { - use super::*; - #[doc = "Indicates if the rule is system generated or created by user."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum CustomizationType { - #[serde(rename = "system")] - System, - #[serde(rename = "inherited")] - Inherited, - #[serde(rename = "custom")] - Custom, - } + use super::*; + #[doc = "Indicates if the rule is system generated or created by user."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum CustomizationType { + #[serde(rename = "system")] + System, + #[serde(rename = "inherited")] + Inherited, + #[serde(rename = "custom")] + Custom, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessRuleList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ProcessRule>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ProcessRule>, } impl ProcessRuleList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Class that describes a work item type object"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessWorkItemType { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub behaviors: Vec<WorkItemTypeBehavior>, - #[doc = "Color hexadecimal code to represent the work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "Indicates the type of customization on this work item System work item types are inherited from parent process but not modified Inherited work item types are modified work item that were inherited from parent process Custom work item types are work item types that were created in the current process"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub customization: Option<process_work_item_type::Customization>, - #[doc = "Description of the work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Icon to represent the work item typ"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub icon: Option<String>, - #[doc = "Reference name of the parent work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inherits: Option<String>, - #[doc = "Indicates if a work item type is disabled"] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "Describes the layout of a work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub layout: Option<FormLayout>, - #[doc = "Name of the work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Reference name of work item type"] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub states: Vec<WorkItemStateResultModel>, - #[doc = "Url of the work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub behaviors: Vec<WorkItemTypeBehavior>, + #[doc = "Color hexadecimal code to represent the work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "Indicates the type of customization on this work item System work item types are inherited from parent process but not modified Inherited work item types are modified work item that were inherited from parent process Custom work item types are work item types that were created in the current process"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub customization: Option<process_work_item_type::Customization>, + #[doc = "Description of the work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Icon to represent the work item typ"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icon: Option<String>, + #[doc = "Reference name of the parent work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inherits: Option<String>, + #[doc = "Indicates if a work item type is disabled"] + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[doc = "Describes the layout of a work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub layout: Option<FormLayout>, + #[doc = "Name of the work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Reference name of work item type"] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub states: Vec<WorkItemStateResultModel>, + #[doc = "Url of the work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ProcessWorkItemType { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod process_work_item_type { - use super::*; - #[doc = "Indicates the type of customization on this work item System work item types are inherited from parent process but not modified Inherited work item types are modified work item that were inherited from parent process Custom work item types are work item types that were created in the current process"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Customization { - #[serde(rename = "system")] - System, - #[serde(rename = "inherited")] - Inherited, - #[serde(rename = "custom")] - Custom, - } + use super::*; + #[doc = "Indicates the type of customization on this work item System work item types are inherited from parent process but not modified Inherited work item types are modified work item that were inherited from parent process Custom work item types are work item types that were created in the current process"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Customization { + #[serde(rename = "system")] + System, + #[serde(rename = "inherited")] + Inherited, + #[serde(rename = "custom")] + Custom, + } } #[doc = "Class that describes a field in a work item type and its properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessWorkItemTypeField { - #[doc = "The list of field allowed values."] - #[serde( - rename = "allowedValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub allowed_values: Vec<serde_json::Value>, - #[doc = "Allow setting field value to a group identity. Only applies to identity fields."] - #[serde( - rename = "allowGroups", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_groups: Option<bool>, - #[doc = "Indicates the type of customization on this work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub customization: Option<process_work_item_type_field::Customization>, - #[doc = "The default value of the field."] - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<serde_json::Value>, - #[doc = "Description of the field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Information about field definition being locked for editing"] - #[serde(rename = "isLocked", default, skip_serializing_if = "Option::is_none")] - pub is_locked: Option<bool>, - #[doc = "Name of the field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "If true the field cannot be edited."] - #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] - pub read_only: Option<bool>, - #[doc = "Reference name of the field."] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "If true the field cannot be empty."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub required: Option<bool>, - #[doc = "Type of the field."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<process_work_item_type_field::Type>, - #[doc = "Resource URL of the field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The list of field allowed values."] + #[serde( + rename = "allowedValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub allowed_values: Vec<serde_json::Value>, + #[doc = "Allow setting field value to a group identity. Only applies to identity fields."] + #[serde( + rename = "allowGroups", + default, + skip_serializing_if = "Option::is_none" + )] + pub allow_groups: Option<bool>, + #[doc = "Indicates the type of customization on this work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub customization: Option<process_work_item_type_field::Customization>, + #[doc = "The default value of the field."] + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<serde_json::Value>, + #[doc = "Description of the field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Name of the field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "If true the field cannot be edited."] + #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] + pub read_only: Option<bool>, + #[doc = "Reference name of the field."] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "If true the field cannot be empty."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub required: Option<bool>, + #[doc = "Type of the field."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<process_work_item_type_field::Type>, + #[doc = "Resource URL of the field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ProcessWorkItemTypeField { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod process_work_item_type_field { - use super::*; - #[doc = "Indicates the type of customization on this work item."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Customization { - #[serde(rename = "system")] - System, - #[serde(rename = "inherited")] - Inherited, - #[serde(rename = "custom")] - Custom, - } - #[doc = "Type of the field."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "string")] - String, - #[serde(rename = "integer")] - Integer, - #[serde(rename = "dateTime")] - DateTime, - #[serde(rename = "plainText")] - PlainText, - #[serde(rename = "html")] - Html, - #[serde(rename = "treePath")] - TreePath, - #[serde(rename = "history")] - History, - #[serde(rename = "double")] - Double, - #[serde(rename = "guid")] - Guid, - #[serde(rename = "boolean")] - Boolean, - #[serde(rename = "identity")] - Identity, - #[serde(rename = "picklistInteger")] - PicklistInteger, - #[serde(rename = "picklistString")] - PicklistString, - #[serde(rename = "picklistDouble")] - PicklistDouble, - } + use super::*; + #[doc = "Indicates the type of customization on this work item."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Customization { + #[serde(rename = "system")] + System, + #[serde(rename = "inherited")] + Inherited, + #[serde(rename = "custom")] + Custom, + } + #[doc = "Type of the field."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "string")] + String, + #[serde(rename = "integer")] + Integer, + #[serde(rename = "dateTime")] + DateTime, + #[serde(rename = "plainText")] + PlainText, + #[serde(rename = "html")] + Html, + #[serde(rename = "treePath")] + TreePath, + #[serde(rename = "history")] + History, + #[serde(rename = "double")] + Double, + #[serde(rename = "guid")] + Guid, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "identity")] + Identity, + #[serde(rename = "picklistInteger")] + PicklistInteger, + #[serde(rename = "picklistString")] + PicklistString, + #[serde(rename = "picklistDouble")] + PicklistDouble, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessWorkItemTypeFieldList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ProcessWorkItemTypeField>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ProcessWorkItemTypeField>, } impl ProcessWorkItemTypeFieldList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessWorkItemTypeList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ProcessWorkItemType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ProcessWorkItemType>, } impl ProcessWorkItemTypeList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the project reference class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectReference { - #[doc = "Description of the project"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The ID of the project"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the project"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Url of the project"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Description of the project"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The ID of the project"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the project"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Url of the project"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ProjectReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Action to take when the rule is triggered."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RuleAction { - #[doc = "Type of action to take when the rule is triggered."] - #[serde( - rename = "actionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_type: Option<rule_action::ActionType>, - #[doc = "Field on which the action should be taken."] - #[serde( - rename = "targetField", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_field: Option<String>, - #[doc = "Value to apply on target field, once the action is taken."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Type of action to take when the rule is triggered."] + #[serde( + rename = "actionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_type: Option<rule_action::ActionType>, + #[doc = "Field on which the action should be taken."] + #[serde( + rename = "targetField", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_field: Option<String>, + #[doc = "Value to apply on target field, once the action is taken."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl RuleAction { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod rule_action { - use super::*; - #[doc = "Type of action to take when the rule is triggered."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ActionType { - #[serde(rename = "makeRequired")] - MakeRequired, - #[serde(rename = "makeReadOnly")] - MakeReadOnly, - #[serde(rename = "setDefaultValue")] - SetDefaultValue, - #[serde(rename = "setDefaultFromClock")] - SetDefaultFromClock, - #[serde(rename = "setDefaultFromCurrentUser")] - SetDefaultFromCurrentUser, - #[serde(rename = "setDefaultFromField")] - SetDefaultFromField, - #[serde(rename = "copyValue")] - CopyValue, - #[serde(rename = "copyFromClock")] - CopyFromClock, - #[serde(rename = "copyFromCurrentUser")] - CopyFromCurrentUser, - #[serde(rename = "copyFromField")] - CopyFromField, - #[serde(rename = "setValueToEmpty")] - SetValueToEmpty, - #[serde(rename = "copyFromServerClock")] - CopyFromServerClock, - #[serde(rename = "copyFromServerCurrentUser")] - CopyFromServerCurrentUser, - #[serde(rename = "hideTargetField")] - HideTargetField, - #[serde(rename = "disallowValue")] - DisallowValue, - } + use super::*; + #[doc = "Type of action to take when the rule is triggered."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ActionType { + #[serde(rename = "makeRequired")] + MakeRequired, + #[serde(rename = "makeReadOnly")] + MakeReadOnly, + #[serde(rename = "setDefaultValue")] + SetDefaultValue, + #[serde(rename = "setDefaultFromClock")] + SetDefaultFromClock, + #[serde(rename = "setDefaultFromCurrentUser")] + SetDefaultFromCurrentUser, + #[serde(rename = "setDefaultFromField")] + SetDefaultFromField, + #[serde(rename = "copyValue")] + CopyValue, + #[serde(rename = "copyFromClock")] + CopyFromClock, + #[serde(rename = "copyFromCurrentUser")] + CopyFromCurrentUser, + #[serde(rename = "copyFromField")] + CopyFromField, + #[serde(rename = "setValueToEmpty")] + SetValueToEmpty, + #[serde(rename = "copyFromServerClock")] + CopyFromServerClock, + #[serde(rename = "copyFromServerCurrentUser")] + CopyFromServerCurrentUser, + #[serde(rename = "hideTargetField")] + HideTargetField, + #[serde(rename = "disallowValue")] + DisallowValue, + } } #[doc = "Action to take when the rule is triggered."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RuleActionModel { - #[serde( - rename = "actionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_type: Option<String>, - #[serde( - rename = "targetField", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_field: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde( + rename = "actionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_type: Option<String>, + #[serde( + rename = "targetField", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_field: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl RuleActionModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a condition on a field when the rule should be triggered."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RuleCondition { - #[doc = "Type of condition. $When. This condition limits the execution of its children to cases when another field has a particular value, i.e. when the Is value of the referenced field is equal to the given literal value. $WhenNot.This condition limits the execution of its children to cases when another field does not have a particular value, i.e.when the Is value of the referenced field is not equal to the given literal value. $WhenChanged.This condition limits the execution of its children to cases when another field has changed, i.e.when the Is value of the referenced field is not equal to the Was value of that field. $WhenNotChanged.This condition limits the execution of its children to cases when another field has not changed, i.e.when the Is value of the referenced field is equal to the Was value of that field."] - #[serde( - rename = "conditionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub condition_type: Option<rule_condition::ConditionType>, - #[doc = "Field that defines condition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub field: Option<String>, - #[doc = "Value of field to define the condition for rule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Type of condition. $When. This condition limits the execution of its children to cases when another field has a particular value, i.e. when the Is value of the referenced field is equal to the given literal value. $WhenNot.This condition limits the execution of its children to cases when another field does not have a particular value, i.e.when the Is value of the referenced field is not equal to the given literal value. $WhenChanged.This condition limits the execution of its children to cases when another field has changed, i.e.when the Is value of the referenced field is not equal to the Was value of that field. $WhenNotChanged.This condition limits the execution of its children to cases when another field has not changed, i.e.when the Is value of the referenced field is equal to the Was value of that field."] + #[serde( + rename = "conditionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub condition_type: Option<rule_condition::ConditionType>, + #[doc = "Field that defines condition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub field: Option<String>, + #[doc = "Value of field to define the condition for rule."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl RuleCondition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod rule_condition { - use super::*; - #[doc = "Type of condition. $When. This condition limits the execution of its children to cases when another field has a particular value, i.e. when the Is value of the referenced field is equal to the given literal value. $WhenNot.This condition limits the execution of its children to cases when another field does not have a particular value, i.e.when the Is value of the referenced field is not equal to the given literal value. $WhenChanged.This condition limits the execution of its children to cases when another field has changed, i.e.when the Is value of the referenced field is not equal to the Was value of that field. $WhenNotChanged.This condition limits the execution of its children to cases when another field has not changed, i.e.when the Is value of the referenced field is equal to the Was value of that field."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ConditionType { - #[serde(rename = "when")] - When, - #[serde(rename = "whenNot")] - WhenNot, - #[serde(rename = "whenChanged")] - WhenChanged, - #[serde(rename = "whenNotChanged")] - WhenNotChanged, - #[serde(rename = "whenWas")] - WhenWas, - #[serde(rename = "whenStateChangedTo")] - WhenStateChangedTo, - #[serde(rename = "whenStateChangedFromAndTo")] - WhenStateChangedFromAndTo, - #[serde(rename = "whenWorkItemIsCreated")] - WhenWorkItemIsCreated, - #[serde(rename = "whenValueIsDefined")] - WhenValueIsDefined, - #[serde(rename = "whenValueIsNotDefined")] - WhenValueIsNotDefined, - #[serde(rename = "whenCurrentUserIsMemberOfGroup")] - WhenCurrentUserIsMemberOfGroup, - #[serde(rename = "whenCurrentUserIsNotMemberOfGroup")] - WhenCurrentUserIsNotMemberOfGroup, - } + use super::*; + #[doc = "Type of condition. $When. This condition limits the execution of its children to cases when another field has a particular value, i.e. when the Is value of the referenced field is equal to the given literal value. $WhenNot.This condition limits the execution of its children to cases when another field does not have a particular value, i.e.when the Is value of the referenced field is not equal to the given literal value. $WhenChanged.This condition limits the execution of its children to cases when another field has changed, i.e.when the Is value of the referenced field is not equal to the Was value of that field. $WhenNotChanged.This condition limits the execution of its children to cases when another field has not changed, i.e.when the Is value of the referenced field is equal to the Was value of that field."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ConditionType { + #[serde(rename = "when")] + When, + #[serde(rename = "whenNot")] + WhenNot, + #[serde(rename = "whenChanged")] + WhenChanged, + #[serde(rename = "whenNotChanged")] + WhenNotChanged, + #[serde(rename = "whenWas")] + WhenWas, + #[serde(rename = "whenStateChangedTo")] + WhenStateChangedTo, + #[serde(rename = "whenStateChangedFromAndTo")] + WhenStateChangedFromAndTo, + #[serde(rename = "whenWorkItemIsCreated")] + WhenWorkItemIsCreated, + #[serde(rename = "whenValueIsDefined")] + WhenValueIsDefined, + #[serde(rename = "whenValueIsNotDefined")] + WhenValueIsNotDefined, + #[serde(rename = "whenCurrentUserIsMemberOfGroup")] + WhenCurrentUserIsMemberOfGroup, + #[serde(rename = "whenCurrentUserIsNotMemberOfGroup")] + WhenCurrentUserIsNotMemberOfGroup, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RuleConditionModel { - #[serde( - rename = "conditionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub condition_type: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub field: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde( + rename = "conditionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub condition_type: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub field: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl RuleConditionModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a section of the work item form layout"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Section { - #[doc = "List of child groups in this section"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub groups: Vec<Group>, - #[doc = "The id for the layout node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "A value indicating whether this layout node has been overridden by a child layout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub overridden: Option<bool>, + #[doc = "List of child groups in this section"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub groups: Vec<Group>, + #[doc = "The id for the layout node."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "A value indicating whether this layout node has been overridden by a child layout."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overridden: Option<bool>, } impl Section { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a request to update a process"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateProcessModel { - #[doc = "New description of the process"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "If true new projects will use this process by default"] - #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] - pub is_default: Option<bool>, - #[doc = "If false the process will be disabled and cannot be used to create projects"] - #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_enabled: Option<bool>, - #[doc = "New name of the process"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "New description of the process"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "If true new projects will use this process by default"] + #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] + pub is_default: Option<bool>, + #[doc = "If false the process will be disabled and cannot be used to create projects"] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option<bool>, + #[doc = "New name of the process"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl UpdateProcessModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Request class/object to update the rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateProcessRuleRequest { - #[serde(flatten)] - pub create_process_rule_request: CreateProcessRuleRequest, - #[doc = "Id to uniquely identify the rule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[serde(flatten)] + pub create_process_rule_request: CreateProcessRuleRequest, + #[doc = "Id to uniquely identify the rule."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl UpdateProcessRuleRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Class to describe a request that updates a field's properties in a work item type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateProcessWorkItemTypeFieldRequest { - #[doc = "The list of field allowed values."] - #[serde( - rename = "allowedValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub allowed_values: Vec<String>, - #[doc = "Allow setting field value to a group identity. Only applies to identity fields."] - #[serde( - rename = "allowGroups", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_groups: Option<bool>, - #[doc = "The default value of the field."] - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<serde_json::Value>, - #[doc = "If true the field cannot be edited."] - #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] - pub read_only: Option<bool>, - #[doc = "The default value of the field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub required: Option<bool>, + #[doc = "The list of field allowed values."] + #[serde( + rename = "allowedValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub allowed_values: Vec<String>, + #[doc = "Allow setting field value to a group identity. Only applies to identity fields."] + #[serde( + rename = "allowGroups", + default, + skip_serializing_if = "Option::is_none" + )] + pub allow_groups: Option<bool>, + #[doc = "The default value of the field."] + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<serde_json::Value>, + #[doc = "If true the field cannot be edited."] + #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] + pub read_only: Option<bool>, + #[doc = "The default value of the field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub required: Option<bool>, } impl UpdateProcessWorkItemTypeFieldRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Class for update request on a work item type"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateProcessWorkItemTypeRequest { - #[doc = "Color of the work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "Description of the work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Icon of the work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub icon: Option<String>, - #[doc = "If set will disable the work item type"] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, + #[doc = "Color of the work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "Description of the work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Icon of the work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icon: Option<String>, + #[doc = "If set will disable the work item type"] + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, } impl UpdateProcessWorkItemTypeRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Properties of a work item form contribution"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WitContribution { - #[doc = "The id for the contribution."] - #[serde( - rename = "contributionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub contribution_id: Option<String>, - #[doc = "The height for the contribution."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub height: Option<i32>, - #[doc = "A dictionary holding key value pairs for contribution inputs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option<serde_json::Value>, - #[doc = "A value indicating if the contribution should be show on deleted workItem."] - #[serde( - rename = "showOnDeletedWorkItem", - default, - skip_serializing_if = "Option::is_none" - )] - pub show_on_deleted_work_item: Option<bool>, + #[doc = "The id for the contribution."] + #[serde( + rename = "contributionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub contribution_id: Option<String>, + #[doc = "The height for the contribution."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub height: Option<i32>, + #[doc = "A dictionary holding key value pairs for contribution inputs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inputs: Option<serde_json::Value>, + #[doc = "A value indicating if the contribution should be show on deleted workItem."] + #[serde( + rename = "showOnDeletedWorkItem", + default, + skip_serializing_if = "Option::is_none" + )] + pub show_on_deleted_work_item: Option<bool>, } impl WitContribution { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemBehavior { - #[serde(rename = "abstract", default, skip_serializing_if = "Option::is_none")] - pub abstract_: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub fields: Vec<WorkItemBehaviorField>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Reference to the behavior of a work item type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inherits: Option<WorkItemBehaviorReference>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub overriden: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(rename = "abstract", default, skip_serializing_if = "Option::is_none")] + pub abstract_: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub fields: Vec<WorkItemBehaviorField>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Reference to the behavior of a work item type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inherits: Option<WorkItemBehaviorReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overriden: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemBehavior { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemBehaviorField { - #[serde( - rename = "behaviorFieldId", - default, - skip_serializing_if = "Option::is_none" - )] - pub behavior_field_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde( + rename = "behaviorFieldId", + default, + skip_serializing_if = "Option::is_none" + )] + pub behavior_field_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemBehaviorField { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to the behavior of a work item type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemBehaviorReference { - #[doc = "The ID of the reference behavior."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The url of the reference behavior."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The ID of the reference behavior."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The url of the reference behavior."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemBehaviorReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Class That represents a work item state input."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemStateInputModel { - #[doc = "Color of the state"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "Name of the state"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Order in which state should appear"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, - #[doc = "Category of the state"] - #[serde( - rename = "stateCategory", - default, - skip_serializing_if = "Option::is_none" - )] - pub state_category: Option<String>, + #[doc = "Color of the state"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "Name of the state"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Order in which state should appear"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, + #[doc = "Category of the state"] + #[serde( + rename = "stateCategory", + default, + skip_serializing_if = "Option::is_none" + )] + pub state_category: Option<String>, } impl WorkItemStateInputModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Class that represents a work item state result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemStateResultModel { - #[doc = "Work item state color."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "Work item state customization type."] - #[serde( - rename = "customizationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub customization_type: Option<work_item_state_result_model::CustomizationType>, - #[doc = "If the Work item state is hidden."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub hidden: Option<bool>, - #[doc = "Id of the Workitemstate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Work item state name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Work item state order."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, - #[doc = "Work item state statecategory."] - #[serde( - rename = "stateCategory", - default, - skip_serializing_if = "Option::is_none" - )] - pub state_category: Option<String>, - #[doc = "Work item state url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Work item state color."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "Work item state customization type."] + #[serde( + rename = "customizationType", + default, + skip_serializing_if = "Option::is_none" + )] + pub customization_type: Option<work_item_state_result_model::CustomizationType>, + #[doc = "If the Work item state is hidden."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hidden: Option<bool>, + #[doc = "Id of the Workitemstate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Work item state name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Work item state order."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, + #[doc = "Work item state statecategory."] + #[serde( + rename = "stateCategory", + default, + skip_serializing_if = "Option::is_none" + )] + pub state_category: Option<String>, + #[doc = "Work item state url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemStateResultModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod work_item_state_result_model { - use super::*; - #[doc = "Work item state customization type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum CustomizationType { - #[serde(rename = "system")] - System, - #[serde(rename = "inherited")] - Inherited, - #[serde(rename = "custom")] - Custom, - } + use super::*; + #[doc = "Work item state customization type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum CustomizationType { + #[serde(rename = "system")] + System, + #[serde(rename = "inherited")] + Inherited, + #[serde(rename = "custom")] + Custom, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemStateResultModelList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemStateResultModel>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemStateResultModel>, } impl WorkItemStateResultModelList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Association between a work item type and it's behavior"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeBehavior { - #[doc = "Reference to the behavior of a work item type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub behavior: Option<WorkItemBehaviorReference>, - #[doc = "If true the work item type is the default work item type in the behavior"] - #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] - pub is_default: Option<bool>, - #[doc = "If true the work item type is the default work item type in the parent behavior"] - #[serde( - rename = "isLegacyDefault", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_legacy_default: Option<bool>, - #[doc = "URL of the work item type behavior"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Reference to the behavior of a work item type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub behavior: Option<WorkItemBehaviorReference>, + #[doc = "If true the work item type is the default work item type in the behavior"] + #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] + pub is_default: Option<bool>, + #[doc = "If true the work item type is the default work item type in the parent behavior"] + #[serde( + rename = "isLegacyDefault", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_legacy_default: Option<bool>, + #[doc = "URL of the work item type behavior"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemTypeBehavior { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeBehaviorList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemTypeBehavior>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemTypeBehavior>, } impl WorkItemTypeBehaviorList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeModel { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub behaviors: Vec<WorkItemTypeBehavior>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub class: Option<work_item_type_model::Class>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub icon: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Parent WIT Id/Internal ReferenceName that it inherits from"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inherits: Option<String>, - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "Describes the layout of a work item type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub layout: Option<FormLayout>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub states: Vec<WorkItemStateResultModel>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub behaviors: Vec<WorkItemTypeBehavior>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub class: Option<work_item_type_model::Class>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icon: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Parent WIT Id/Internal ReferenceName that it inherits from"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inherits: Option<String>, + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[doc = "Describes the layout of a work item type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub layout: Option<FormLayout>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub states: Vec<WorkItemStateResultModel>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemTypeModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod work_item_type_model { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Class { - #[serde(rename = "system")] - System, - #[serde(rename = "derived")] - Derived, - #[serde(rename = "custom")] - Custom, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Class { + #[serde(rename = "system")] + System, + #[serde(rename = "derived")] + Derived, + #[serde(rename = "custom")] + Custom, + } } diff --git a/azure_devops_rust_api/src/profile/mod.rs b/azure_devops_rust_api/src/profile/mod.rs index 1373b690..4ab30b8c 100644 --- a/azure_devops_rust_api/src/profile/mod.rs +++ b/azure_devops_rust_api/src/profile/mod.rs @@ -9,297 +9,302 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://app.vssps.visualstudio.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self - } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self - } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self - } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self - } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } } impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await + } + pub fn profiles_client(&self) -> profiles::Client { + profiles::Client(self.clone()) + } +} +pub mod profiles { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a user profile."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `id`: The ID of the target user profile within the same organization, or 'me' to get the profile of the current authenticated user."] + pub fn get(&self, id: impl Into<String>) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + id: id.into(), + details: None, + with_attributes: None, + partition: None, + core_attributes: None, + force_refresh: None, + } } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Profile> { + let bytes = self.0.into_body().collect().await?; + let body: models::Profile = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn profiles_client(&self) -> profiles::Client { - profiles::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } -} -pub mod profiles { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets a user profile."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `id`: The ID of the target user profile within the same organization, or 'me' to get the profile of the current authenticated user."] - pub fn get(&self, id: impl Into<String>) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - id: id.into(), - details: None, - with_attributes: None, - partition: None, - core_attributes: None, - force_refresh: None, - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) id: String, + pub(crate) details: Option<bool>, + pub(crate) with_attributes: Option<bool>, + pub(crate) partition: Option<String>, + pub(crate) core_attributes: Option<String>, + pub(crate) force_refresh: Option<bool>, } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Profile> { - let bytes = self.0.into_body().collect().await?; - let body: models::Profile = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) id: String, - pub(crate) details: Option<bool>, - pub(crate) with_attributes: Option<bool>, - pub(crate) partition: Option<String>, - pub(crate) core_attributes: Option<String>, - pub(crate) force_refresh: Option<bool>, - } - 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); - self - } - #[doc = "If true, gets the attributes (named key-value pairs of arbitrary data) associated with the profile. The partition parameter must also have a value."] - pub fn with_attributes(mut self, with_attributes: bool) -> Self { - self.with_attributes = Some(with_attributes); - self + 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); + self + } + #[doc = "If true, gets the attributes (named key-value pairs of arbitrary data) associated with the profile. The partition parameter must also have a value."] + pub fn with_attributes(mut self, with_attributes: bool) -> Self { + self.with_attributes = Some(with_attributes); + self + } + #[doc = "The partition (named group) of attributes to return."] + pub fn partition(mut self, partition: impl Into<String>) -> Self { + self.partition = Some(partition.into()); + self + } + #[doc = "A comma-delimited list of core profile attributes to return. Valid values are Email, Avatar, DisplayName, and ContactWithOffers."] + pub fn core_attributes(mut self, core_attributes: impl Into<String>) -> Self { + self.core_attributes = Some(core_attributes.into()); + self + } + #[doc = "Not used in this version of the API."] + pub fn force_refresh(mut self, force_refresh: bool) -> Self { + self.force_refresh = Some(force_refresh); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/_apis/profile/profiles/{}", + this.client.endpoint(), + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); } - #[doc = "The partition (named group) of attributes to return."] - pub fn partition(mut self, partition: impl Into<String>) -> Self { - self.partition = Some(partition.into()); - self + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(details) = &this.details { + req + .url_mut() + .query_pairs_mut() + .append_pair("details", &details.to_string()); } - #[doc = "A comma-delimited list of core profile attributes to return. Valid values are Email, Avatar, DisplayName, and ContactWithOffers."] - pub fn core_attributes(mut self, core_attributes: impl Into<String>) -> Self { - self.core_attributes = Some(core_attributes.into()); - self + if let Some(with_attributes) = &this.with_attributes { + req + .url_mut() + .query_pairs_mut() + .append_pair("withAttributes", &with_attributes.to_string()); } - #[doc = "Not used in this version of the API."] - pub fn force_refresh(mut self, force_refresh: bool) -> Self { - self.force_refresh = Some(force_refresh); - self + if let Some(partition) = &this.partition { + req + .url_mut() + .query_pairs_mut() + .append_pair("partition", partition); } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/_apis/profile/profiles/{}", - this.client.endpoint(), - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + if let Some(core_attributes) = &this.core_attributes { + req + .url_mut() + .query_pairs_mut() + .append_pair("coreAttributes", core_attributes); } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Profile>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Profile>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Profile>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Profile>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/profile/models.rs b/azure_devops_rust_api/src/profile/models.rs index 2866a3f5..86397434 100644 --- a/azure_devops_rust_api/src/profile/models.rs +++ b/azure_devops_rust_api/src/profile/models.rs @@ -8,370 +8,368 @@ use std::str::FromStr; #[doc = "Identifies an attribute with a name and a container."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AttributeDescriptor { - #[doc = "The name of the attribute."] - #[serde( - rename = "attributeName", - default, - skip_serializing_if = "Option::is_none" - )] - pub attribute_name: Option<String>, - #[doc = "The container the attribute resides in."] - #[serde( - rename = "containerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub container_name: Option<String>, + #[doc = "The name of the attribute."] + #[serde( + rename = "attributeName", + default, + skip_serializing_if = "Option::is_none" + )] + pub attribute_name: Option<String>, + #[doc = "The container the attribute resides in."] + #[serde( + rename = "containerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub container_name: Option<String>, } impl AttributeDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Stores a set of named profile attributes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AttributesContainer { - #[doc = "The attributes stored by the container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attributes: Option<serde_json::Value>, - #[doc = "The name of the container."] - #[serde( - rename = "containerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub container_name: Option<String>, - #[doc = "The maximum revision number of any attribute within the container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[doc = "The attributes stored by the container."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attributes: Option<serde_json::Value>, + #[doc = "The name of the container."] + #[serde( + rename = "containerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub container_name: Option<String>, + #[doc = "The maximum revision number of any attribute within the container."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl AttributesContainer { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Avatar { - #[serde( - rename = "isAutoGenerated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_auto_generated: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<avatar::Size>, - #[serde( - rename = "timeStamp", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub time_stamp: Option<time::OffsetDateTime>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<String>, + #[serde( + rename = "isAutoGenerated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_auto_generated: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<avatar::Size>, + #[serde( + rename = "timeStamp", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub time_stamp: Option<time::OffsetDateTime>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<String>, } impl Avatar { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod avatar { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Size { - #[serde(rename = "small")] - Small, - #[serde(rename = "medium")] - Medium, - #[serde(rename = "large")] - Large, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Size { + #[serde(rename = "small")] + Small, + #[serde(rename = "medium")] + Medium, + #[serde(rename = "large")] + Large, + } } #[doc = "A profile attribute which always has a value for each profile."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CoreProfileAttribute { - #[serde(flatten)] - pub profile_attribute_base: ProfileAttributeBase, + #[serde(flatten)] + pub profile_attribute_base: ProfileAttributeBase, } impl CoreProfileAttribute { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreateProfileContext { - #[serde(rename = "ciData", default, skip_serializing_if = "Option::is_none")] - pub ci_data: Option<serde_json::Value>, - #[serde( - rename = "contactWithOffers", - default, - skip_serializing_if = "Option::is_none" - )] - pub contact_with_offers: Option<bool>, - #[serde( - rename = "countryName", - default, - skip_serializing_if = "Option::is_none" - )] - pub country_name: Option<String>, - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde( - rename = "emailAddress", - default, - skip_serializing_if = "Option::is_none" - )] - pub email_address: Option<String>, - #[serde( - rename = "hasAccount", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_account: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub language: Option<String>, - #[serde( - rename = "phoneNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub phone_number: Option<String>, - #[doc = "The current state of the profile."] - #[serde( - rename = "profileState", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_state: Option<create_profile_context::ProfileState>, + #[serde(rename = "ciData", default, skip_serializing_if = "Option::is_none")] + pub ci_data: Option<serde_json::Value>, + #[serde( + rename = "contactWithOffers", + default, + skip_serializing_if = "Option::is_none" + )] + pub contact_with_offers: Option<bool>, + #[serde( + rename = "countryName", + default, + skip_serializing_if = "Option::is_none" + )] + pub country_name: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde( + rename = "emailAddress", + default, + skip_serializing_if = "Option::is_none" + )] + pub email_address: Option<String>, + #[serde( + rename = "hasAccount", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_account: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub language: Option<String>, + #[serde( + rename = "phoneNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub phone_number: Option<String>, + #[doc = "The current state of the profile."] + #[serde( + rename = "profileState", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_state: Option<create_profile_context::ProfileState>, } impl CreateProfileContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod create_profile_context { - use super::*; - #[doc = "The current state of the profile."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ProfileState { - #[serde(rename = "custom")] - Custom, - #[serde(rename = "customReadOnly")] - CustomReadOnly, - #[serde(rename = "readOnly")] - ReadOnly, - } + use super::*; + #[doc = "The current state of the profile."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ProfileState { + #[serde(rename = "custom")] + Custom, + #[serde(rename = "customReadOnly")] + CustomReadOnly, + #[serde(rename = "readOnly")] + ReadOnly, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GeoRegion { - #[serde( - rename = "regionCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub region_code: Option<String>, + #[serde( + rename = "regionCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub region_code: Option<String>, } impl GeoRegion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a JSON object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JObject { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<String>, - #[doc = "Gets the node type for this JToken."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<String>, + #[doc = "Gets the node type for this JToken."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl JObject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A user profile."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Profile { - #[doc = "Stores a set of named profile attributes."] - #[serde( - rename = "applicationContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub application_container: Option<AttributesContainer>, - #[doc = "The core attributes of this profile."] - #[serde( - rename = "coreAttributes", - default, - skip_serializing_if = "Option::is_none" - )] - pub core_attributes: Option<serde_json::Value>, - #[doc = "The maximum revision number of any attribute."] - #[serde( - rename = "coreRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub core_revision: Option<i32>, - #[doc = "The unique identifier of the profile."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The current state of the profile."] - #[serde( - rename = "profileState", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_state: Option<profile::ProfileState>, - #[doc = "The maximum revision number of any attribute."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "The time at which this profile was last changed."] - #[serde( - rename = "timeStamp", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub time_stamp: Option<time::OffsetDateTime>, + #[doc = "Stores a set of named profile attributes."] + #[serde( + rename = "applicationContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub application_container: Option<AttributesContainer>, + #[doc = "The core attributes of this profile."] + #[serde( + rename = "coreAttributes", + default, + skip_serializing_if = "Option::is_none" + )] + pub core_attributes: Option<serde_json::Value>, + #[doc = "The maximum revision number of any attribute."] + #[serde( + rename = "coreRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub core_revision: Option<i32>, + #[doc = "The unique identifier of the profile."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The current state of the profile."] + #[serde( + rename = "profileState", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_state: Option<profile::ProfileState>, + #[doc = "The maximum revision number of any attribute."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "The time at which this profile was last changed."] + #[serde( + rename = "timeStamp", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub time_stamp: Option<time::OffsetDateTime>, } impl Profile { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod profile { - use super::*; - #[doc = "The current state of the profile."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ProfileState { - #[serde(rename = "custom")] - Custom, - #[serde(rename = "customReadOnly")] - CustomReadOnly, - #[serde(rename = "readOnly")] - ReadOnly, - } + use super::*; + #[doc = "The current state of the profile."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ProfileState { + #[serde(rename = "custom")] + Custom, + #[serde(rename = "customReadOnly")] + CustomReadOnly, + #[serde(rename = "readOnly")] + ReadOnly, + } } #[doc = "A named object associated with a profile."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProfileAttribute { - #[serde(flatten)] - pub profile_attribute_base: ProfileAttributeBase, + #[serde(flatten)] + pub profile_attribute_base: ProfileAttributeBase, } impl ProfileAttribute { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProfileAttributeBase { - #[doc = "Identifies an attribute with a name and a container."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<AttributeDescriptor>, - #[doc = "The revision number of the attribute."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "The time the attribute was last changed."] - #[serde( - rename = "timeStamp", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub time_stamp: Option<time::OffsetDateTime>, - #[doc = "The value of the attribute."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Identifies an attribute with a name and a container."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<AttributeDescriptor>, + #[doc = "The revision number of the attribute."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "The time the attribute was last changed."] + #[serde( + rename = "timeStamp", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub time_stamp: Option<time::OffsetDateTime>, + #[doc = "The value of the attribute."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl ProfileAttributeBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Country/region information"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProfileRegion { - #[doc = "The two-letter code defined in ISO 3166 for the country/region."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option<String>, - #[doc = "Localized country/region name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "The two-letter code defined in ISO 3166 for the country/region."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option<String>, + #[doc = "Localized country/region name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ProfileRegion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Container of country/region information"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProfileRegions { - #[doc = "List of country/region code with contact consent requirement type of notice"] - #[serde( - rename = "noticeContactConsentRequirementRegions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub notice_contact_consent_requirement_regions: Vec<String>, - #[doc = "List of country/region code with contact consent requirement type of opt-out"] - #[serde( - rename = "optOutContactConsentRequirementRegions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub opt_out_contact_consent_requirement_regions: Vec<String>, - #[doc = "List of country/regions"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub regions: Vec<ProfileRegion>, + #[doc = "List of country/region code with contact consent requirement type of notice"] + #[serde( + rename = "noticeContactConsentRequirementRegions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub notice_contact_consent_requirement_regions: Vec<String>, + #[doc = "List of country/region code with contact consent requirement type of opt-out"] + #[serde( + rename = "optOutContactConsentRequirementRegions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub opt_out_contact_consent_requirement_regions: Vec<String>, + #[doc = "List of country/regions"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub regions: Vec<ProfileRegion>, } impl ProfileRegions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/release/mod.rs b/azure_devops_rust_api/src/release/mod.rs index 45efbad9..0f275583 100644 --- a/azure_devops_rust_api/src/release/mod.rs +++ b/azure_devops_rust_api/src/release/mod.rs @@ -9,5086 +9,5138 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://vsrm.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + 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()) + } +} +pub mod releases { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a Release"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + pub fn get_release( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Metadata to create a release."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::ReleaseStartMetadata>, + project: impl Into<String>, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); + #[doc = "Get release for a given revision number."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + #[doc = "* `definition_snapshot_revision`: Definition snapshot revision number."] + pub fn get_release_revision( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Release object for update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release to update."] + pub fn update_release( + &self, + organization: impl Into<String>, + body: impl Into<models::Release>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Properties of release to update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release to update."] + pub fn update_release_resource( + &self, + organization: impl Into<String>, + body: impl Into<models::ReleaseUpdateMetadata>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + #[doc = "* `environment_id`: Id of the release environment."] + pub fn get_release_environment( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Environment update meta data."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + #[doc = "* `environment_id`: Id of release environment."] + pub fn update_release_environment( + &self, + organization: impl Into<String>, + body: impl Into<models::ReleaseEnvironmentUpdateMetadata>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + #[doc = "* `environment_id`: Id of release environment."] + #[doc = "* `release_deploy_phase_id`: Release deploy phase Id."] + #[doc = "* `task_id`: ReleaseTask Id for the log."] + pub fn get_task_log( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + pub fn get_logs( + &self, + organization: impl Into<String>, + project: impl Into<String>, + release_id: i32, + ) -> get_logs::RequestBuilder { + get_logs::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + } + } + } + pub mod get_release { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Release> { + let bytes = self.0.into_body().collect().await?; + let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) release_id: i32, + pub(crate) approval_filters: Option<String>, + pub(crate) property_filters: Option<String>, + pub(crate) expand: Option<String>, + pub(crate) top_gate_records: Option<i32>, + } + 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, approval_filters: impl Into<String>) -> Self { + self.approval_filters = Some(approval_filters.into()); self + } + #[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Release 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<String>) -> Self { + self.property_filters = Some(property_filters.into()); + self + } + #[doc = "A property that should be expanded in the release."] + pub fn expand(mut self, expand: impl Into<String>) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "Number of release gate records to get. Default is 5."] + pub fn top_gate_records(mut self, top_gate_records: i32) -> Self { + self.top_gate_records = Some(top_gate_records); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases/{}?", + this.client.endpoint(), + &this.organization, + &this.project, + &this.release_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(approval_filters) = &this.approval_filters { + req + .url_mut() + .query_pairs_mut() + .append_pair("approvalFilters", approval_filters); + } + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Release>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Release>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_id: Option<i32>, + pub(crate) definition_environment_id: Option<i32>, + pub(crate) search_text: Option<String>, + pub(crate) created_by: Option<String>, + pub(crate) status_filter: Option<String>, + pub(crate) environment_status_filter: Option<i32>, + pub(crate) min_created_time: Option<time::OffsetDateTime>, + pub(crate) max_created_time: Option<time::OffsetDateTime>, + pub(crate) query_order: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<i32>, + pub(crate) expand: Option<String>, + pub(crate) artifact_type_id: Option<String>, + pub(crate) source_id: Option<String>, + pub(crate) artifact_version_id: Option<String>, + pub(crate) source_branch_filter: Option<String>, + pub(crate) is_deleted: Option<bool>, + pub(crate) tag_filter: Option<String>, + pub(crate) property_filters: Option<String>, + pub(crate) release_id_filter: Option<String>, + pub(crate) path: Option<String>, + } + 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); + self + } + pub fn definition_environment_id(mut self, definition_environment_id: i32) -> Self { + self.definition_environment_id = Some(definition_environment_id); + self + } + #[doc = "Releases with names containing searchText."] + pub fn search_text(mut self, search_text: impl Into<String>) -> Self { + self.search_text = Some(search_text.into()); + self + } + #[doc = "Releases created by this user."] + pub fn created_by(mut self, created_by: impl Into<String>) -> Self { + self.created_by = Some(created_by.into()); + self + } + #[doc = "Releases that have this status."] + pub fn status_filter(mut self, status_filter: impl Into<String>) -> Self { + self.status_filter = Some(status_filter.into()); + self + } + pub fn environment_status_filter(mut self, environment_status_filter: i32) -> Self { + self.environment_status_filter = Some(environment_status_filter); + self + } + #[doc = "Releases that were created after this time."] + pub fn min_created_time(mut self, min_created_time: impl Into<time::OffsetDateTime>) -> Self { + self.min_created_time = Some(min_created_time.into()); + self + } + #[doc = "Releases that were created before this time."] + pub fn max_created_time(mut self, max_created_time: impl Into<time::OffsetDateTime>) -> Self { + self.max_created_time = Some(max_created_time.into()); + self + } + #[doc = "Gets the results in the defined order of created date for releases. Default is descending."] + pub fn query_order(mut self, query_order: impl Into<String>) -> Self { + self.query_order = Some(query_order.into()); + self + } + #[doc = "Number of releases to get. Default is 50."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Gets the releases after the continuation token provided."] + pub fn continuation_token(mut self, continuation_token: i32) -> Self { + self.continuation_token = Some(continuation_token); + self + } + #[doc = "The property that should be expanded in the list of releases."] + pub fn expand(mut self, expand: impl Into<String>) -> Self { + self.expand = Some(expand.into()); self + } + #[doc = "Releases with given artifactTypeId will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild."] + pub fn artifact_type_id(mut self, artifact_type_id: impl Into<String>) -> Self { + self.artifact_type_id = Some(artifact_type_id.into()); + self + } + #[doc = "Unique identifier of the artifact used. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json<https://github>.com/Microsoft/vsts-rm-extensions/blob/master/Extensions."] + pub fn source_id(mut self, source_id: impl Into<String>) -> Self { + self.source_id = Some(source_id.into()); + self + } + #[doc = "Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId."] + pub fn artifact_version_id(mut self, artifact_version_id: impl Into<String>) -> Self { + self.artifact_version_id = Some(artifact_version_id.into()); + self + } + #[doc = "Releases with given sourceBranchFilter will be returned."] + pub fn source_branch_filter(mut self, source_branch_filter: impl Into<String>) -> Self { + self.source_branch_filter = Some(source_branch_filter.into()); + self + } + #[doc = "Gets the soft deleted releases, if true."] + pub fn is_deleted(mut self, is_deleted: bool) -> Self { + self.is_deleted = Some(is_deleted); + self + } + #[doc = "A comma-delimited list of tags. Only releases with these tags will be returned."] + pub fn tag_filter(mut self, tag_filter: impl Into<String>) -> Self { + self.tag_filter = Some(tag_filter.into()); + self + } + #[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Releases will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release from results irrespective of whether it has property set or not."] + pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { + self.property_filters = Some(property_filters.into()); + self + } + #[doc = "A comma-delimited list of releases Ids. Only releases with these Ids will be returned."] + pub fn release_id_filter(mut self, release_id_filter: impl Into<String>) -> Self { + self.release_id_filter = Some(release_id_filter.into()); + self + } + #[doc = "Releases under this folder path will be returned"] + pub fn path(mut self, path: impl Into<String>) -> Self { + self.path = Some(path.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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); + } + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Release> { + let bytes = self.0.into_body().collect().await?; + let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ReleaseStartMetadata, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Release>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Release>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_release_revision { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) release_id: i32, + pub(crate) definition_snapshot_revision: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.release_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let definition_snapshot_revision = &this.definition_snapshot_revision; + req.url_mut().query_pairs_mut().append_pair( + "definitionSnapshotRevision", + &definition_snapshot_revision.to_string(), + ); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_release { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Release> { + let bytes = self.0.into_body().collect().await?; + let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Release, + pub(crate) project: String, + pub(crate) release_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.release_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Release>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Release>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_release_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Release> { + let bytes = self.0.into_body().collect().await?; + let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ReleaseUpdateMetadata, + pub(crate) project: String, + pub(crate) release_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.release_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Release>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Release>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_release_environment { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseEnvironment> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseEnvironment = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) release_id: i32, + pub(crate) environment_id: i32, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "A property that should be expanded in the environment."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/Release/releases/{}/environments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.release_id, + &this.environment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseEnvironment>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseEnvironment>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) + } + pub mod update_release_environment { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseEnvironment> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseEnvironment = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod releases { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/Release/releases/{}/environments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.release_id, + &this.environment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseEnvironment>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseEnvironment>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_task_log { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a Release"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - pub fn get_release( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Metadata to create a release."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::ReleaseStartMetadata>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - #[doc = "* `definition_snapshot_revision`: Definition snapshot revision number."] - pub fn get_release_revision( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Release object for update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release to update."] - pub fn update_release( - &self, - organization: impl Into<String>, - body: impl Into<models::Release>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Properties of release to update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release to update."] - pub fn update_release_resource( - &self, - organization: impl Into<String>, - body: impl Into<models::ReleaseUpdateMetadata>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - #[doc = "* `environment_id`: Id of the release environment."] - pub fn get_release_environment( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Environment update meta data."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - #[doc = "* `environment_id`: Id of release environment."] - pub fn update_release_environment( - &self, - organization: impl Into<String>, - body: impl Into<models::ReleaseEnvironmentUpdateMetadata>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - #[doc = "* `environment_id`: Id of release environment."] - #[doc = "* `release_deploy_phase_id`: Release deploy phase Id."] - #[doc = "* `task_id`: ReleaseTask Id for the log."] - pub fn get_task_log( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - pub fn get_logs( - &self, - organization: impl Into<String>, - project: impl Into<String>, - release_id: i32, - ) -> get_logs::RequestBuilder { - get_logs::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - release_id, - } - } - } - pub mod get_release { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Release> { - let bytes = self.0.into_body().collect().await?; - let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) release_id: i32, - pub(crate) approval_filters: Option<String>, - pub(crate) property_filters: Option<String>, - pub(crate) expand: Option<String>, - pub(crate) top_gate_records: Option<i32>, - } - 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, approval_filters: impl Into<String>) -> Self { - self.approval_filters = Some(approval_filters.into()); - self - } - #[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Release 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<String>) -> Self { - self.property_filters = Some(property_filters.into()); - self - } - #[doc = "A property that should be expanded in the release."] - pub fn expand(mut self, expand: impl Into<String>) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Number of release gate records to get. Default is 5."] - pub fn top_gate_records(mut self, top_gate_records: i32) -> Self { - self.top_gate_records = Some(top_gate_records); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases/{}?", - this.client.endpoint(), - &this.organization, - &this.project, - &this.release_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(approval_filters) = &this.approval_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("approvalFilters", approval_filters); - } - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Release>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Release>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReleaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_id: Option<i32>, - pub(crate) definition_environment_id: Option<i32>, - pub(crate) search_text: Option<String>, - pub(crate) created_by: Option<String>, - pub(crate) status_filter: Option<String>, - pub(crate) environment_status_filter: Option<i32>, - pub(crate) min_created_time: Option<time::OffsetDateTime>, - pub(crate) max_created_time: Option<time::OffsetDateTime>, - pub(crate) query_order: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<i32>, - pub(crate) expand: Option<String>, - pub(crate) artifact_type_id: Option<String>, - pub(crate) source_id: Option<String>, - pub(crate) artifact_version_id: Option<String>, - pub(crate) source_branch_filter: Option<String>, - pub(crate) is_deleted: Option<bool>, - pub(crate) tag_filter: Option<String>, - pub(crate) property_filters: Option<String>, - pub(crate) release_id_filter: Option<String>, - pub(crate) path: Option<String>, - } - 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); - self - } - pub fn definition_environment_id(mut self, definition_environment_id: i32) -> Self { - self.definition_environment_id = Some(definition_environment_id); - self - } - #[doc = "Releases with names containing searchText."] - pub fn search_text(mut self, search_text: impl Into<String>) -> Self { - self.search_text = Some(search_text.into()); - self - } - #[doc = "Releases created by this user."] - pub fn created_by(mut self, created_by: impl Into<String>) -> Self { - self.created_by = Some(created_by.into()); - self - } - #[doc = "Releases that have this status."] - pub fn status_filter(mut self, status_filter: impl Into<String>) -> Self { - self.status_filter = Some(status_filter.into()); - self - } - pub fn environment_status_filter(mut self, environment_status_filter: i32) -> Self { - self.environment_status_filter = Some(environment_status_filter); - self - } - #[doc = "Releases that were created after this time."] - pub fn min_created_time( - mut self, - min_created_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.min_created_time = Some(min_created_time.into()); - self - } - #[doc = "Releases that were created before this time."] - pub fn max_created_time( - mut self, - max_created_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.max_created_time = Some(max_created_time.into()); - self - } - #[doc = "Gets the results in the defined order of created date for releases. Default is descending."] - pub fn query_order(mut self, query_order: impl Into<String>) -> Self { - self.query_order = Some(query_order.into()); - self - } - #[doc = "Number of releases to get. Default is 50."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Gets the releases after the continuation token provided."] - pub fn continuation_token(mut self, continuation_token: i32) -> Self { - self.continuation_token = Some(continuation_token); - self - } - #[doc = "The property that should be expanded in the list of releases."] - pub fn expand(mut self, expand: impl Into<String>) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Releases with given artifactTypeId will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild."] - pub fn artifact_type_id(mut self, artifact_type_id: impl Into<String>) -> Self { - self.artifact_type_id = Some(artifact_type_id.into()); - self - } - #[doc = "Unique identifier of the artifact used. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json<https://github>.com/Microsoft/vsts-rm-extensions/blob/master/Extensions."] - pub fn source_id(mut self, source_id: impl Into<String>) -> Self { - self.source_id = Some(source_id.into()); - self - } - #[doc = "Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId."] - pub fn artifact_version_id(mut self, artifact_version_id: impl Into<String>) -> Self { - self.artifact_version_id = Some(artifact_version_id.into()); - self - } - #[doc = "Releases with given sourceBranchFilter will be returned."] - pub fn source_branch_filter(mut self, source_branch_filter: impl Into<String>) -> Self { - self.source_branch_filter = Some(source_branch_filter.into()); - self - } - #[doc = "Gets the soft deleted releases, if true."] - pub fn is_deleted(mut self, is_deleted: bool) -> Self { - self.is_deleted = Some(is_deleted); - self - } - #[doc = "A comma-delimited list of tags. Only releases with these tags will be returned."] - pub fn tag_filter(mut self, tag_filter: impl Into<String>) -> Self { - self.tag_filter = Some(tag_filter.into()); - self - } - #[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Releases will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release from results irrespective of whether it has property set or not."] - pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { - self.property_filters = Some(property_filters.into()); - self - } - #[doc = "A comma-delimited list of releases Ids. Only releases with these Ids will be returned."] - pub fn release_id_filter(mut self, release_id_filter: impl Into<String>) -> Self { - self.release_id_filter = Some(release_id_filter.into()); - self - } - #[doc = "Releases under this folder path will be returned"] - pub fn path(mut self, path: impl Into<String>) -> Self { - self.path = Some(path.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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); - } - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Release> { - let bytes = self.0.into_body().collect().await?; - let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ReleaseStartMetadata, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Release>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Release>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_release_revision { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) release_id: i32, - pub(crate) definition_snapshot_revision: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.release_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let definition_snapshot_revision = &this.definition_snapshot_revision; - req.url_mut().query_pairs_mut().append_pair( - "definitionSnapshotRevision", - &definition_snapshot_revision.to_string(), - ); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_release { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Release> { - let bytes = self.0.into_body().collect().await?; - let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Release, - pub(crate) project: String, - pub(crate) release_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.release_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Release>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Release>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_release_resource { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Release> { - let bytes = self.0.into_body().collect().await?; - let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ReleaseUpdateMetadata, - pub(crate) project: String, - pub(crate) release_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.release_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Release>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Release>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_release_environment { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReleaseEnvironment> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseEnvironment = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) release_id: i32, - pub(crate) environment_id: i32, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "A property that should be expanded in the environment."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/Release/releases/{}/environments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.release_id, - &this.environment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseEnvironment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseEnvironment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_release_environment { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReleaseEnvironment> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseEnvironment = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/Release/releases/{}/environments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.release_id, - &this.environment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseEnvironment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseEnvironment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_task_log { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) release_id: i32, - pub(crate) environment_id: i32, - pub(crate) release_deploy_phase_id: i32, - pub(crate) task_id: i32, - pub(crate) start_line: Option<i64>, - pub(crate) end_line: Option<i64>, - } - impl RequestBuilder { - #[doc = "Starting line number for logs"] - pub fn start_line(mut self, start_line: i64) -> Self { - self.start_line = Some(start_line); - self - } - #[doc = "Ending line number for logs"] - pub fn end_line(mut self, end_line: i64) -> Self { - self.end_line = Some(end_line); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/deployPhases/{}/tasks/{}/logs" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . release_deploy_phase_id , & this . task_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_logs { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) release_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases/{}/logs", - this.client.endpoint(), - &this.organization, - &this.project, - &this.release_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod approvals { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) release_id: i32, + pub(crate) environment_id: i32, + pub(crate) release_deploy_phase_id: i32, + pub(crate) task_id: i32, + pub(crate) start_line: Option<i64>, + pub(crate) end_line: Option<i64>, + } + impl RequestBuilder { + #[doc = "Starting line number for logs"] + pub fn start_line(mut self, start_line: i64) -> Self { + self.start_line = Some(start_line); + self + } + #[doc = "Ending line number for logs"] + pub fn end_line(mut self, end_line: i64) -> Self { + self.end_line = Some(end_line); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases/{}/environments/{}/deployPhases/{}/tasks/{}/logs", + this.client.endpoint(), + &this.organization, + &this.project, + &this.release_id, + &this.environment_id, + &this.release_deploy_phase_id, + &this.task_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_logs { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of approvals"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: ReleaseApproval object having status, approver and comments."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `approval_id`: Id of the approval."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::ReleaseApproval>, - project: impl Into<String>, - approval_id: i32, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - approval_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReleaseApprovalList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseApprovalList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) assigned_to_filter: Option<String>, - pub(crate) status_filter: Option<String>, - pub(crate) release_ids_filter: Option<String>, - pub(crate) type_filter: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<i32>, - pub(crate) query_order: Option<String>, - pub(crate) include_my_group_approvals: Option<bool>, - } - impl RequestBuilder { - #[doc = "Approvals assigned to this user."] - pub fn assigned_to_filter(mut self, assigned_to_filter: impl Into<String>) -> Self { - self.assigned_to_filter = Some(assigned_to_filter.into()); - self - } - #[doc = "Approvals with this status. Default is 'pending'."] - pub fn status_filter(mut self, status_filter: impl Into<String>) -> Self { - self.status_filter = Some(status_filter.into()); - self - } - #[doc = "Approvals for release id(s) mentioned in the filter. Multiple releases can be mentioned by separating them with ',' e.g. releaseIdsFilter=1,2,3,4."] - pub fn release_ids_filter(mut self, release_ids_filter: impl Into<String>) -> Self { - self.release_ids_filter = Some(release_ids_filter.into()); - self - } - #[doc = "Approval with this type."] - pub fn type_filter(mut self, type_filter: impl Into<String>) -> Self { - self.type_filter = Some(type_filter.into()); - self - } - #[doc = "Number of approvals to get. Default is 50."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Gets the approvals after the continuation token provided."] - pub fn continuation_token(mut self, continuation_token: i32) -> Self { - self.continuation_token = Some(continuation_token); - self - } - #[doc = "Gets the results in the defined order of created approvals. Default is 'descending'."] - pub fn query_order(mut self, query_order: impl Into<String>) -> Self { - self.query_order = Some(query_order.into()); - self - } - #[doc = "'true' to include my group approvals. Default is 'false'."] - pub fn include_my_group_approvals(mut self, include_my_group_approvals: bool) -> Self { - self.include_my_group_approvals = Some(include_my_group_approvals); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/approvals", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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); - } - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseApprovalList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ReleaseApprovalList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReleaseApproval> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseApproval = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ReleaseApproval, - pub(crate) project: String, - pub(crate) approval_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/approvals/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.approval_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseApproval>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseApproval>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) release_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases/{}/logs", + this.client.endpoint(), + &this.organization, + &this.project, + &this.release_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } -pub mod definitions { +pub mod approvals { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of approvals"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: ReleaseApproval object having status, approver and comments."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `approval_id`: Id of the approval."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::ReleaseApproval>, + project: impl Into<String>, + approval_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + approval_id, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of release definitions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: release definition object to create."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::ReleaseDefinition>, - project: impl Into<String>, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - #[doc = "Update a release definition."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Release definition object to update."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::ReleaseDefinition>, - project: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - #[doc = "Get a release definition."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: Id of the release definition."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: Id of the release definition."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: Id of the definition."] - pub fn get_release_definition_history( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `definition_id`: Id of the definition."] - #[doc = "* `revision`: Id of the revision."] - pub fn get_definition_revision( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReleaseDefinitionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseDefinitionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) search_text: Option<String>, - pub(crate) expand: Option<String>, - pub(crate) artifact_type: Option<String>, - pub(crate) artifact_source_id: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - pub(crate) query_order: Option<String>, - pub(crate) path: Option<String>, - pub(crate) is_exact_name_match: Option<bool>, - pub(crate) tag_filter: Option<String>, - pub(crate) property_filters: Option<String>, - pub(crate) definition_id_filter: Option<String>, - pub(crate) is_deleted: Option<bool>, - pub(crate) search_text_contains_folder_name: Option<bool>, - } - impl RequestBuilder { - #[doc = "Get release definitions with names containing searchText."] - pub fn search_text(mut self, search_text: impl Into<String>) -> Self { - self.search_text = Some(search_text.into()); - self - } - #[doc = "The properties that should be expanded in the list of Release definitions."] - pub fn expand(mut self, expand: impl Into<String>) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Release definitions with given artifactType will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild."] - pub fn artifact_type(mut self, artifact_type: impl Into<String>) -> Self { - self.artifact_type = Some(artifact_type.into()); - self - } - #[doc = "Release definitions with given artifactSourceId will be returned. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at<https://github>.com/Microsoft/vsts-rm-extensions/blob/master/Extensions."] - pub fn artifact_source_id(mut self, artifact_source_id: impl Into<String>) -> Self { - self.artifact_source_id = Some(artifact_source_id.into()); - self - } - #[doc = "Number of release definitions to get."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Gets the release definitions after the continuation token provided."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Gets the results in the defined order. Default is 'IdAscending'."] - pub fn query_order(mut self, query_order: impl Into<String>) -> Self { - self.query_order = Some(query_order.into()); - self - } - #[doc = "Gets the release definitions under the specified path."] - pub fn path(mut self, path: impl Into<String>) -> Self { - self.path = Some(path.into()); - self - } - #[doc = "'true'to gets the release definitions with exact match as specified in searchText. Default is 'false'."] - pub fn is_exact_name_match(mut self, is_exact_name_match: bool) -> Self { - self.is_exact_name_match = Some(is_exact_name_match); - self - } - #[doc = "A comma-delimited list of tags. Only release definitions with these tags will be returned."] - pub fn tag_filter(mut self, tag_filter: impl Into<String>) -> Self { - self.tag_filter = Some(tag_filter.into()); - self - } - #[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definitions will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release Definition from results irrespective of whether it has property set or not."] - pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { - self.property_filters = Some(property_filters.into()); - self - } - #[doc = "A comma-delimited list of release definitions to retrieve."] - pub fn definition_id_filter(mut self, definition_id_filter: impl Into<String>) -> Self { - self.definition_id_filter = Some(definition_id_filter.into()); - self - } - #[doc = "'true' to get release definitions that has been deleted. Default is 'false'"] - pub fn is_deleted(mut self, is_deleted: bool) -> Self { - self.is_deleted = Some(is_deleted); - self - } - #[doc = "'true' to get the release definitions under the folder with name as specified in searchText. Default is 'false'."] - pub fn search_text_contains_folder_name( - mut self, - search_text_contains_folder_name: bool, - ) -> Self { - self.search_text_contains_folder_name = Some(search_text_contains_folder_name); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/definitions", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseDefinitionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ReleaseDefinitionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReleaseDefinition> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ReleaseDefinition, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/definitions", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseDefinition>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseDefinition>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReleaseDefinition> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ReleaseDefinition, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/definitions", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseDefinition>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseDefinition>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReleaseDefinition> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_id: i32, - pub(crate) property_filters: Option<String>, - } - 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<String>) -> Self { - self.property_filters = Some(property_filters.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/definitions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(property_filters) = &this.property_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("propertyFilters", property_filters); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseDefinition>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseDefinition>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_id: i32, - pub(crate) comment: Option<String>, - pub(crate) force_delete: Option<bool>, - } - impl RequestBuilder { - #[doc = "Comment for deleting a release definition."] - pub fn comment(mut self, comment: impl Into<String>) -> Self { - self.comment = Some(comment.into()); - self - } - #[doc = "'true' to automatically cancel any in-progress release deployments and proceed with release definition deletion . Default is 'false'."] - pub fn force_delete(mut self, force_delete: bool) -> Self { - self.force_delete = Some(force_delete); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/definitions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_release_definition_history { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ReleaseDefinitionRevisionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseDefinitionRevisionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/Release/definitions/{}/revisions", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseDefinitionRevisionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ReleaseDefinitionRevisionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_definition_revision { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_id: i32, - pub(crate) revision: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/Release/definitions/{}/revisions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.definition_id, - &this.revision - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseApprovalList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseApprovalList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) assigned_to_filter: Option<String>, + pub(crate) status_filter: Option<String>, + pub(crate) release_ids_filter: Option<String>, + pub(crate) type_filter: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<i32>, + pub(crate) query_order: Option<String>, + pub(crate) include_my_group_approvals: Option<bool>, + } + impl RequestBuilder { + #[doc = "Approvals assigned to this user."] + pub fn assigned_to_filter(mut self, assigned_to_filter: impl Into<String>) -> Self { + self.assigned_to_filter = Some(assigned_to_filter.into()); + self + } + #[doc = "Approvals with this status. Default is 'pending'."] + pub fn status_filter(mut self, status_filter: impl Into<String>) -> Self { + self.status_filter = Some(status_filter.into()); + self + } + #[doc = "Approvals for release id(s) mentioned in the filter. Multiple releases can be mentioned by separating them with ',' e.g. releaseIdsFilter=1,2,3,4."] + pub fn release_ids_filter(mut self, release_ids_filter: impl Into<String>) -> Self { + self.release_ids_filter = Some(release_ids_filter.into()); + self + } + #[doc = "Approval with this type."] + pub fn type_filter(mut self, type_filter: impl Into<String>) -> Self { + self.type_filter = Some(type_filter.into()); + self + } + #[doc = "Number of approvals to get. Default is 50."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Gets the approvals after the continuation token provided."] + pub fn continuation_token(mut self, continuation_token: i32) -> Self { + self.continuation_token = Some(continuation_token); + self + } + #[doc = "Gets the results in the defined order of created approvals. Default is 'descending'."] + pub fn query_order(mut self, query_order: impl Into<String>) -> Self { + self.query_order = Some(query_order.into()); + self + } + #[doc = "'true' to include my group approvals. Default is 'false'."] + pub fn include_my_group_approvals(mut self, include_my_group_approvals: bool) -> Self { + self.include_my_group_approvals = Some(include_my_group_approvals); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/approvals", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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); + } + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseApprovalList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseApprovalList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseApproval> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseApproval = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ReleaseApproval, + pub(crate) project: String, + pub(crate) approval_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/approvals/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.approval_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseApproval>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseApproval>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } +} +pub mod definitions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of release definitions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: release definition object to create."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::ReleaseDefinition>, + project: impl Into<String>, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Update a release definition."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Release definition object to update."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::ReleaseDefinition>, + project: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get a release definition."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: Id of the release definition."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: Id of the release definition."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: Id of the definition."] + pub fn get_release_definition_history( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `definition_id`: Id of the definition."] + #[doc = "* `revision`: Id of the revision."] + pub fn get_definition_revision( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseDefinitionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseDefinitionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) search_text: Option<String>, + pub(crate) expand: Option<String>, + pub(crate) artifact_type: Option<String>, + pub(crate) artifact_source_id: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + pub(crate) query_order: Option<String>, + pub(crate) path: Option<String>, + pub(crate) is_exact_name_match: Option<bool>, + pub(crate) tag_filter: Option<String>, + pub(crate) property_filters: Option<String>, + pub(crate) definition_id_filter: Option<String>, + pub(crate) is_deleted: Option<bool>, + pub(crate) search_text_contains_folder_name: Option<bool>, + } + impl RequestBuilder { + #[doc = "Get release definitions with names containing searchText."] + pub fn search_text(mut self, search_text: impl Into<String>) -> Self { + self.search_text = Some(search_text.into()); + self + } + #[doc = "The properties that should be expanded in the list of Release definitions."] + pub fn expand(mut self, expand: impl Into<String>) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "Release definitions with given artifactType will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild."] + pub fn artifact_type(mut self, artifact_type: impl Into<String>) -> Self { + self.artifact_type = Some(artifact_type.into()); + self + } + #[doc = "Release definitions with given artifactSourceId will be returned. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at<https://github>.com/Microsoft/vsts-rm-extensions/blob/master/Extensions."] + pub fn artifact_source_id(mut self, artifact_source_id: impl Into<String>) -> Self { + self.artifact_source_id = Some(artifact_source_id.into()); + self + } + #[doc = "Number of release definitions to get."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Gets the release definitions after the continuation token provided."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "Gets the results in the defined order. Default is 'IdAscending'."] + pub fn query_order(mut self, query_order: impl Into<String>) -> Self { + self.query_order = Some(query_order.into()); + self + } + #[doc = "Gets the release definitions under the specified path."] + pub fn path(mut self, path: impl Into<String>) -> Self { + self.path = Some(path.into()); + self + } + #[doc = "'true'to gets the release definitions with exact match as specified in searchText. Default is 'false'."] + pub fn is_exact_name_match(mut self, is_exact_name_match: bool) -> Self { + self.is_exact_name_match = Some(is_exact_name_match); + self + } + #[doc = "A comma-delimited list of tags. Only release definitions with these tags will be returned."] + pub fn tag_filter(mut self, tag_filter: impl Into<String>) -> Self { + self.tag_filter = Some(tag_filter.into()); + self + } + #[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definitions will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release Definition from results irrespective of whether it has property set or not."] + pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self { + self.property_filters = Some(property_filters.into()); + self + } + #[doc = "A comma-delimited list of release definitions to retrieve."] + pub fn definition_id_filter(mut self, definition_id_filter: impl Into<String>) -> Self { + self.definition_id_filter = Some(definition_id_filter.into()); + self + } + #[doc = "'true' to get release definitions that has been deleted. Default is 'false'"] + pub fn is_deleted(mut self, is_deleted: bool) -> Self { + self.is_deleted = Some(is_deleted); + self + } + #[doc = "'true' to get the release definitions under the folder with name as specified in searchText. Default is 'false'."] + pub fn search_text_contains_folder_name( + mut self, + search_text_contains_folder_name: bool, + ) -> Self { + self.search_text_contains_folder_name = Some(search_text_contains_folder_name); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/definitions", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseDefinitionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseDefinitionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseDefinition> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseDefinition = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ReleaseDefinition, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/definitions", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseDefinition>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseDefinition>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseDefinition> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseDefinition = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ReleaseDefinition, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/definitions", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseDefinition>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseDefinition>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseDefinition> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseDefinition = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_id: i32, + pub(crate) property_filters: Option<String>, + } + 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<String>) -> Self { + self.property_filters = Some(property_filters.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/definitions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(property_filters) = &this.property_filters { + req + .url_mut() + .query_pairs_mut() + .append_pair("propertyFilters", property_filters); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseDefinition>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseDefinition>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_id: i32, + pub(crate) comment: Option<String>, + pub(crate) force_delete: Option<bool>, + } + impl RequestBuilder { + #[doc = "Comment for deleting a release definition."] + pub fn comment(mut self, comment: impl Into<String>) -> Self { + self.comment = Some(comment.into()); + self + } + #[doc = "'true' to automatically cancel any in-progress release deployments and proceed with release definition deletion . Default is 'false'."] + pub fn force_delete(mut self, force_delete: bool) -> Self { + self.force_delete = Some(force_delete); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/definitions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_release_definition_history { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseDefinitionRevisionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseDefinitionRevisionList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/Release/definitions/{}/revisions", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseDefinitionRevisionList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::ReleaseDefinitionRevisionList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_definition_revision { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_id: i32, + pub(crate) revision: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/Release/definitions/{}/revisions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.definition_id, + &this.revision + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod deployments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DeploymentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) definition_id: Option<i32>, - pub(crate) definition_environment_id: Option<i32>, - pub(crate) created_by: Option<String>, - pub(crate) min_modified_time: Option<time::OffsetDateTime>, - pub(crate) max_modified_time: Option<time::OffsetDateTime>, - pub(crate) deployment_status: Option<String>, - pub(crate) operation_status: Option<String>, - pub(crate) latest_attempts_only: Option<bool>, - pub(crate) query_order: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<i32>, - pub(crate) created_for: Option<String>, - pub(crate) min_started_time: Option<time::OffsetDateTime>, - pub(crate) max_started_time: Option<time::OffsetDateTime>, - pub(crate) source_branch: Option<String>, - } - impl RequestBuilder { - pub fn definition_id(mut self, definition_id: i32) -> Self { - self.definition_id = Some(definition_id); - self - } - pub fn definition_environment_id(mut self, definition_environment_id: i32) -> Self { - self.definition_environment_id = Some(definition_environment_id); - self - } - pub fn created_by(mut self, created_by: impl Into<String>) -> Self { - self.created_by = Some(created_by.into()); - self - } - pub fn min_modified_time( - mut self, - min_modified_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.min_modified_time = Some(min_modified_time.into()); - self - } - pub fn max_modified_time( - mut self, - max_modified_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.max_modified_time = Some(max_modified_time.into()); - self - } - pub fn deployment_status(mut self, deployment_status: impl Into<String>) -> Self { - self.deployment_status = Some(deployment_status.into()); - self - } - pub fn operation_status(mut self, operation_status: impl Into<String>) -> Self { - self.operation_status = Some(operation_status.into()); - self - } - pub fn latest_attempts_only(mut self, latest_attempts_only: bool) -> Self { - self.latest_attempts_only = Some(latest_attempts_only); - self - } - pub fn query_order(mut self, query_order: impl Into<String>) -> Self { - self.query_order = Some(query_order.into()); - self - } - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - pub fn continuation_token(mut self, continuation_token: i32) -> Self { - self.continuation_token = Some(continuation_token); - self - } - pub fn created_for(mut self, created_for: impl Into<String>) -> Self { - self.created_for = Some(created_for.into()); - self - } - pub fn min_started_time( - mut self, - min_started_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.min_started_time = Some(min_started_time.into()); - self - } - pub fn max_started_time( - mut self, - max_started_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.max_started_time = Some(max_started_time.into()); - self - } - pub fn source_branch(mut self, source_branch: impl Into<String>) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/deployments", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - if let Some(operation_status) = &this.operation_status { - req.url_mut() - .query_pairs_mut() - .append_pair("operationStatus", operation_status); - } - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DeploymentList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DeploymentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::DeploymentList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) definition_id: Option<i32>, + pub(crate) definition_environment_id: Option<i32>, + pub(crate) created_by: Option<String>, + pub(crate) min_modified_time: Option<time::OffsetDateTime>, + pub(crate) max_modified_time: Option<time::OffsetDateTime>, + pub(crate) deployment_status: Option<String>, + pub(crate) operation_status: Option<String>, + pub(crate) latest_attempts_only: Option<bool>, + pub(crate) query_order: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<i32>, + pub(crate) created_for: Option<String>, + pub(crate) min_started_time: Option<time::OffsetDateTime>, + pub(crate) max_started_time: Option<time::OffsetDateTime>, + pub(crate) source_branch: Option<String>, + } + impl RequestBuilder { + pub fn definition_id(mut self, definition_id: i32) -> Self { + self.definition_id = Some(definition_id); + self + } + pub fn definition_environment_id(mut self, definition_environment_id: i32) -> Self { + self.definition_environment_id = Some(definition_environment_id); + self + } + pub fn created_by(mut self, created_by: impl Into<String>) -> Self { + self.created_by = Some(created_by.into()); + self + } + pub fn min_modified_time( + mut self, + min_modified_time: impl Into<time::OffsetDateTime>, + ) -> Self { + self.min_modified_time = Some(min_modified_time.into()); + self + } + pub fn max_modified_time( + mut self, + max_modified_time: impl Into<time::OffsetDateTime>, + ) -> Self { + self.max_modified_time = Some(max_modified_time.into()); + self + } + pub fn deployment_status(mut self, deployment_status: impl Into<String>) -> Self { + self.deployment_status = Some(deployment_status.into()); + self + } + pub fn operation_status(mut self, operation_status: impl Into<String>) -> Self { + self.operation_status = Some(operation_status.into()); + self + } + pub fn latest_attempts_only(mut self, latest_attempts_only: bool) -> Self { + self.latest_attempts_only = Some(latest_attempts_only); + self + } + pub fn query_order(mut self, query_order: impl Into<String>) -> Self { + self.query_order = Some(query_order.into()); + self + } + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn continuation_token(mut self, continuation_token: i32) -> Self { + self.continuation_token = Some(continuation_token); + self + } + pub fn created_for(mut self, created_for: impl Into<String>) -> Self { + self.created_for = Some(created_for.into()); + self + } + pub fn min_started_time(mut self, min_started_time: impl Into<time::OffsetDateTime>) -> Self { + self.min_started_time = Some(min_started_time.into()); + self + } + pub fn max_started_time(mut self, max_started_time: impl Into<time::OffsetDateTime>) -> Self { + self.max_started_time = Some(max_started_time.into()); + self + } + pub fn source_branch(mut self, source_branch: impl Into<String>) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/deployments", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + if let Some(operation_status) = &this.operation_status { + req + .url_mut() + .query_pairs_mut() + .append_pair("operationStatus", operation_status); + } + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DeploymentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod folders { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets folders."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `path`: Path of the folder."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + path: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: folder."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `path`: Path of the folder."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::Folder>, + project: impl Into<String>, + path: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: folder."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `path`: Path of the folder to update."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::Folder>, + project: impl Into<String>, + path: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `path`: Path of the folder to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + path: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + path: path.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets folders."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `path`: Path of the folder."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: folder."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `path`: Path of the folder."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::Folder>, - project: impl Into<String>, - path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: folder."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `path`: Path of the folder to update."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::Folder>, - project: impl Into<String>, - path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `path`: Path of the folder to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - path: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - path: path.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::FolderList> { - let bytes = self.0.into_body().collect().await?; - let body: models::FolderList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) path: String, - pub(crate) query_order: Option<String>, - } - impl RequestBuilder { - #[doc = "Gets the results in the defined order. Default is 'None'."] - pub fn query_order(mut self, query_order: impl Into<String>) -> Self { - self.query_order = Some(query_order.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/folders/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.path - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", query_order); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::FolderList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::FolderList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Folder> { - let bytes = self.0.into_body().collect().await?; - let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Folder, - pub(crate) project: String, - pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/folders/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.path - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Folder>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Folder>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Folder> { - let bytes = self.0.into_body().collect().await?; - let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Folder, - pub(crate) project: String, - pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/folders/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.path - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Folder>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Folder>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/folders/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.path - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::FolderList> { + let bytes = self.0.into_body().collect().await?; + let body: models::FolderList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) path: String, + pub(crate) query_order: Option<String>, + } + impl RequestBuilder { + #[doc = "Gets the results in the defined order. Default is 'None'."] + pub fn query_order(mut self, query_order: impl Into<String>) -> Self { + self.query_order = Some(query_order.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/folders/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.path + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(query_order) = &this.query_order { + req + .url_mut() + .query_pairs_mut() + .append_pair("queryOrder", query_order); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::FolderList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::FolderList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Folder> { + let bytes = self.0.into_body().collect().await?; + let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Folder, + pub(crate) project: String, + pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/folders/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.path + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Folder>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Folder>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Folder> { + let bytes = self.0.into_body().collect().await?; + let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Folder, + pub(crate) project: String, + pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/folders/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.path + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Folder>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Folder>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/folders/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.path + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod gates { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Updates the gate for a deployment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Metadata to patch the Release Gates."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `gate_step_id`: Gate step Id."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::GateUpdateMetadata>, + project: impl Into<String>, + 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 update { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Updates the gate for a deployment."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Metadata to patch the Release Gates."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `gate_step_id`: Gate step Id."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::GateUpdateMetadata>, - project: impl Into<String>, - 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 update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReleaseGates> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseGates = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::GateUpdateMetadata, - pub(crate) project: String, - pub(crate) gate_step_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/release/gates/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.gate_step_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseGates>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseGates>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseGates> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseGates = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::GateUpdateMetadata, + pub(crate) project: String, + pub(crate) gate_step_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/release/gates/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.gate_step_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseGates>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseGates>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod attachments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the release task attachments."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + #[doc = "* `environment_id`: Id of the release environment."] + #[doc = "* `attempt_id`: Attempt number of deployment."] + #[doc = "* `plan_id`: Plan Id of the deploy phase."] + #[doc = "* `type_`: Type of the attachment."] + pub fn get_release_task_attachments( + &self, + organization: impl Into<String>, + project: impl Into<String>, + release_id: i32, + environment_id: i32, + attempt_id: i32, + plan_id: impl Into<String>, + type_: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + #[doc = "* `environment_id`: Id of the release environment."] + #[doc = "* `attempt_id`: Attempt number of deployment."] + #[doc = "* `plan_id`: Plan Id of the deploy phase."] + #[doc = "* `timeline_id`: Timeline Id of the task."] + #[doc = "* `record_id`: Record Id of attachment."] + #[doc = "* `type_`: Type of the attachment."] + #[doc = "* `name`: Name of the attachment."] + pub fn get_release_task_attachment_content( + &self, + organization: impl Into<String>, + project: impl Into<String>, + release_id: i32, + environment_id: i32, + attempt_id: i32, + plan_id: impl Into<String>, + timeline_id: impl Into<String>, + record_id: impl Into<String>, + type_: impl Into<String>, + name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + #[doc = "* `environment_id`: Id of the release environment."] + #[doc = "* `attempt_id`: Attempt number of deployment."] + #[doc = "* `timeline_id`: Timeline Id of the task."] + #[doc = "* `type_`: Type of the attachment."] + pub fn get_task_attachments( + &self, + organization: impl Into<String>, + project: impl Into<String>, + release_id: i32, + environment_id: i32, + attempt_id: i32, + timeline_id: impl Into<String>, + type_: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + #[doc = "* `environment_id`: Id of the release environment."] + #[doc = "* `attempt_id`: Attempt number of deployment."] + #[doc = "* `timeline_id`: Timeline Id of the task."] + #[doc = "* `record_id`: Record Id of attachment."] + #[doc = "* `type_`: Type of the attachment."] + #[doc = "* `name`: Name of the attachment."] + pub fn get_task_attachment_content( + &self, + organization: impl Into<String>, + project: impl Into<String>, + release_id: i32, + environment_id: i32, + attempt_id: i32, + timeline_id: impl Into<String>, + record_id: impl Into<String>, + type_: impl Into<String>, + name: impl Into<String>, + ) -> 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 get_release_task_attachments { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get the release task attachments."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - #[doc = "* `environment_id`: Id of the release environment."] - #[doc = "* `attempt_id`: Attempt number of deployment."] - #[doc = "* `plan_id`: Plan Id of the deploy phase."] - #[doc = "* `type_`: Type of the attachment."] - pub fn get_release_task_attachments( - &self, - organization: impl Into<String>, - project: impl Into<String>, - release_id: i32, - environment_id: i32, - attempt_id: i32, - plan_id: impl Into<String>, - type_: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - #[doc = "* `environment_id`: Id of the release environment."] - #[doc = "* `attempt_id`: Attempt number of deployment."] - #[doc = "* `plan_id`: Plan Id of the deploy phase."] - #[doc = "* `timeline_id`: Timeline Id of the task."] - #[doc = "* `record_id`: Record Id of attachment."] - #[doc = "* `type_`: Type of the attachment."] - #[doc = "* `name`: Name of the attachment."] - pub fn get_release_task_attachment_content( - &self, - organization: impl Into<String>, - project: impl Into<String>, - release_id: i32, - environment_id: i32, - attempt_id: i32, - plan_id: impl Into<String>, - timeline_id: impl Into<String>, - record_id: impl Into<String>, - type_: impl Into<String>, - name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - #[doc = "* `environment_id`: Id of the release environment."] - #[doc = "* `attempt_id`: Attempt number of deployment."] - #[doc = "* `timeline_id`: Timeline Id of the task."] - #[doc = "* `type_`: Type of the attachment."] - pub fn get_task_attachments( - &self, - organization: impl Into<String>, - project: impl Into<String>, - release_id: i32, - environment_id: i32, - attempt_id: i32, - timeline_id: impl Into<String>, - type_: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - #[doc = "* `environment_id`: Id of the release environment."] - #[doc = "* `attempt_id`: Attempt number of deployment."] - #[doc = "* `timeline_id`: Timeline Id of the task."] - #[doc = "* `record_id`: Record Id of attachment."] - #[doc = "* `type_`: Type of the attachment."] - #[doc = "* `name`: Name of the attachment."] - pub fn get_task_attachment_content( - &self, - organization: impl Into<String>, - project: impl Into<String>, - release_id: i32, - environment_id: i32, - attempt_id: i32, - timeline_id: impl Into<String>, - record_id: impl Into<String>, - type_: impl Into<String>, - name: impl Into<String>, - ) -> 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 get_release_task_attachments { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReleaseTaskAttachmentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseTaskAttachmentList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) release_id: i32, - pub(crate) environment_id: i32, - pub(crate) attempt_id: i32, - pub(crate) plan_id: String, - pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/plan/{}/attachments/{}" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . attempt_id , & this . plan_id , & this . type_)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseTaskAttachmentList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ReleaseTaskAttachmentList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_release_task_attachment_content { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) release_id: i32, - pub(crate) environment_id: i32, - pub(crate) attempt_id: i32, - pub(crate) plan_id: String, - pub(crate) timeline_id: String, - pub(crate) record_id: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/plan/{}/timelines/{}/records/{}/attachments/{}/{}" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . attempt_id , & this . plan_id , & this . timeline_id , & this . record_id , & this . type_ , & this . name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_task_attachments { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReleaseTaskAttachmentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReleaseTaskAttachmentList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) release_id: i32, - pub(crate) environment_id: i32, - pub(crate) attempt_id: i32, - pub(crate) timeline_id: String, - pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/timelines/{}/attachments/{}" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . attempt_id , & this . timeline_id , & this . type_)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReleaseTaskAttachmentList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ReleaseTaskAttachmentList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_task_attachment_content { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) release_id: i32, - pub(crate) environment_id: i32, - pub(crate) attempt_id: i32, - pub(crate) timeline_id: String, - pub(crate) record_id: String, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/timelines/{}/records/{}/attachments/{}/{}" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . attempt_id , & this . timeline_id , & this . record_id , & this . type_ , & this . name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseTaskAttachmentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseTaskAttachmentList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) release_id: i32, + pub(crate) environment_id: i32, + pub(crate) attempt_id: i32, + pub(crate) plan_id: String, + pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/plan/{}/attachments/{}" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . attempt_id , & this . plan_id , & this . type_)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseTaskAttachmentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseTaskAttachmentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_release_task_attachment_content { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) release_id: i32, + pub(crate) environment_id: i32, + pub(crate) attempt_id: i32, + pub(crate) plan_id: String, + pub(crate) timeline_id: String, + pub(crate) record_id: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/plan/{}/timelines/{}/records/{}/attachments/{}/{}" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . attempt_id , & this . plan_id , & this . timeline_id , & this . record_id , & this . type_ , & this . name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_task_attachments { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReleaseTaskAttachmentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReleaseTaskAttachmentList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) release_id: i32, + pub(crate) environment_id: i32, + pub(crate) attempt_id: i32, + pub(crate) timeline_id: String, + pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/timelines/{}/attachments/{}" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . attempt_id , & this . timeline_id , & this . type_)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReleaseTaskAttachmentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseTaskAttachmentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_task_attachment_content { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) release_id: i32, + pub(crate) environment_id: i32, + pub(crate) attempt_id: i32, + pub(crate) timeline_id: String, + pub(crate) record_id: String, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/timelines/{}/records/{}/attachments/{}/{}" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . attempt_id , & this . timeline_id , & this . record_id , & this . type_ , & this . name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod manual_interventions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all manual interventions for a given release."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + #[doc = "* `manual_intervention_id`: Id of the manual intervention."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Meta data to update manual intervention."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `release_id`: Id of the release."] + #[doc = "* `manual_intervention_id`: Id of the manual intervention."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::ManualInterventionUpdateMetadata>, + project: impl Into<String>, + 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, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List all manual interventions for a given release."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - #[doc = "* `manual_intervention_id`: Id of the manual intervention."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Meta data to update manual intervention."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `release_id`: Id of the release."] - #[doc = "* `manual_intervention_id`: Id of the manual intervention."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::ManualInterventionUpdateMetadata>, - project: impl Into<String>, - 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, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ManualInterventionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ManualInterventionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) release_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/Release/releases/{}/manualinterventions", - this.client.endpoint(), - &this.organization, - &this.project, - &this.release_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ManualInterventionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ManualInterventionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ManualIntervention> { - let bytes = self.0.into_body().collect().await?; - let body: models::ManualIntervention = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) release_id: i32, - pub(crate) manual_intervention_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.release_id, - &this.manual_intervention_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ManualIntervention>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ManualIntervention>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ManualIntervention> { - let bytes = self.0.into_body().collect().await?; - let body: models::ManualIntervention = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.release_id, - &this.manual_intervention_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ManualIntervention>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ManualIntervention>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ManualInterventionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ManualInterventionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) release_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/Release/releases/{}/manualinterventions", + this.client.endpoint(), + &this.organization, + &this.project, + &this.release_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ManualInterventionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ManualInterventionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ManualIntervention> { + let bytes = self.0.into_body().collect().await?; + let body: models::ManualIntervention = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) release_id: i32, + pub(crate) manual_intervention_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.release_id, + &this.manual_intervention_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ManualIntervention>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ManualIntervention>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ManualIntervention> { + let bytes = self.0.into_body().collect().await?; + let body: models::ManualIntervention = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.release_id, + &this.manual_intervention_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ManualIntervention>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ManualIntervention>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/release/models.rs b/azure_devops_rust_api/src/release/models.rs index 9ec16c5d..1a05c678 100644 --- a/azure_devops_rust_api/src/release/models.rs +++ b/azure_devops_rust_api/src/release/models.rs @@ -8,7304 +8,7302 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentArtifactDefinition { - #[doc = "Gets or sets the artifact definition alias."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub alias: Option<String>, - #[doc = "Gets or sets the artifact type."] - #[serde( - rename = "artifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type: Option<agent_artifact_definition::ArtifactType>, - #[doc = "Gets or sets the artifact definition details."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub details: Option<String>, - #[doc = "Gets or sets the name of artifact definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the version of artifact definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Gets or sets the artifact definition alias."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, + #[doc = "Gets or sets the artifact type."] + #[serde( + rename = "artifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type: Option<agent_artifact_definition::ArtifactType>, + #[doc = "Gets or sets the artifact definition details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub details: Option<String>, + #[doc = "Gets or sets the name of artifact definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the version of artifact definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl AgentArtifactDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod agent_artifact_definition { - use super::*; - #[doc = "Gets or sets the artifact type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ArtifactType { - #[serde(rename = "xamlBuild")] - XamlBuild, - #[serde(rename = "build")] - Build, - #[serde(rename = "jenkins")] - Jenkins, - #[serde(rename = "fileShare")] - FileShare, - #[serde(rename = "nuget")] - Nuget, - #[serde(rename = "tfsOnPrem")] - TfsOnPrem, - #[serde(rename = "gitHub")] - GitHub, - #[serde(rename = "tfGit")] - TfGit, - #[serde(rename = "externalTfsBuild")] - ExternalTfsBuild, - #[serde(rename = "custom")] - Custom, - #[serde(rename = "tfvc")] - Tfvc, - } + use super::*; + #[doc = "Gets or sets the artifact type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ArtifactType { + #[serde(rename = "xamlBuild")] + XamlBuild, + #[serde(rename = "build")] + Build, + #[serde(rename = "jenkins")] + Jenkins, + #[serde(rename = "fileShare")] + FileShare, + #[serde(rename = "nuget")] + Nuget, + #[serde(rename = "tfsOnPrem")] + TfsOnPrem, + #[serde(rename = "gitHub")] + GitHub, + #[serde(rename = "tfGit")] + TfGit, + #[serde(rename = "externalTfsBuild")] + ExternalTfsBuild, + #[serde(rename = "custom")] + Custom, + #[serde(rename = "tfvc")] + Tfvc, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentBasedDeployPhase { - #[serde(flatten)] - pub deploy_phase: DeployPhase, - #[doc = ""] - #[serde( - rename = "deploymentInput", - default, - skip_serializing_if = "Option::is_none" - )] - pub deployment_input: Option<AgentDeploymentInput>, + #[serde(flatten)] + pub deploy_phase: DeployPhase, + #[doc = ""] + #[serde( + rename = "deploymentInput", + default, + skip_serializing_if = "Option::is_none" + )] + pub deployment_input: Option<AgentDeploymentInput>, } impl AgentBasedDeployPhase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentDeploymentInput { - #[serde(flatten)] - pub deployment_input: DeploymentInput, - #[doc = "Specification of the agent defined by the pool provider."] - #[serde( - rename = "agentSpecification", - default, - skip_serializing_if = "Option::is_none" - )] - pub agent_specification: Option<AgentSpecification>, - #[doc = "Gets or sets the image ID."] - #[serde(rename = "imageId", default, skip_serializing_if = "Option::is_none")] - pub image_id: Option<i32>, - #[doc = ""] - #[serde( - rename = "parallelExecution", - default, - skip_serializing_if = "Option::is_none" - )] - pub parallel_execution: Option<ExecutionInput>, + #[serde(flatten)] + pub deployment_input: DeploymentInput, + #[doc = "Specification of the agent defined by the pool provider."] + #[serde( + rename = "agentSpecification", + default, + skip_serializing_if = "Option::is_none" + )] + pub agent_specification: Option<AgentSpecification>, + #[doc = "Gets or sets the image ID."] + #[serde(rename = "imageId", default, skip_serializing_if = "Option::is_none")] + pub image_id: Option<i32>, + #[doc = ""] + #[serde( + rename = "parallelExecution", + default, + skip_serializing_if = "Option::is_none" + )] + pub parallel_execution: Option<ExecutionInput>, } impl AgentDeploymentInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to an agent queue."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentPoolQueueReference { - #[serde(flatten)] - pub resource_reference: ResourceReference, - #[doc = "The ID of the queue."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, + #[serde(flatten)] + pub resource_reference: ResourceReference, + #[doc = "The ID of the queue."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, } impl AgentPoolQueueReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Specification of the agent defined by the pool provider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AgentSpecification { - #[doc = "Agent specification unique identifier."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, + #[doc = "Agent specification unique identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, } impl AgentSpecification { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApprovalOptions { - #[doc = "Specify whether the approval can be skipped if the same approver approved the previous stage."] - #[serde( - rename = "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped", - default, - skip_serializing_if = "Option::is_none" - )] - pub auto_triggered_and_previous_environment_approved_can_be_skipped: Option<bool>, - #[doc = "Specify whether revalidate identity of approver before completing the approval."] - #[serde( - rename = "enforceIdentityRevalidation", - default, - skip_serializing_if = "Option::is_none" - )] - pub enforce_identity_revalidation: Option<bool>, - #[doc = "Approvals execution order."] - #[serde( - rename = "executionOrder", - default, - skip_serializing_if = "Option::is_none" - )] - pub execution_order: Option<approval_options::ExecutionOrder>, - #[doc = "Specify whether the user requesting a release or deployment should allow to approver."] - #[serde( - rename = "releaseCreatorCanBeApprover", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_creator_can_be_approver: Option<bool>, - #[doc = "The number of approvals required to move release forward. '0' means all approvals required."] - #[serde( - rename = "requiredApproverCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub required_approver_count: Option<i32>, - #[doc = "Approval timeout. Approval default timeout is 30 days. Maximum allowed timeout is 365 days. '0' means default timeout i.e 30 days."] - #[serde( - rename = "timeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeout_in_minutes: Option<i32>, + #[doc = "Specify whether the approval can be skipped if the same approver approved the previous stage."] + #[serde( + rename = "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped", + default, + skip_serializing_if = "Option::is_none" + )] + pub auto_triggered_and_previous_environment_approved_can_be_skipped: Option<bool>, + #[doc = "Specify whether revalidate identity of approver before completing the approval."] + #[serde( + rename = "enforceIdentityRevalidation", + default, + skip_serializing_if = "Option::is_none" + )] + pub enforce_identity_revalidation: Option<bool>, + #[doc = "Approvals execution order."] + #[serde( + rename = "executionOrder", + default, + skip_serializing_if = "Option::is_none" + )] + pub execution_order: Option<approval_options::ExecutionOrder>, + #[doc = "Specify whether the user requesting a release or deployment should allow to approver."] + #[serde( + rename = "releaseCreatorCanBeApprover", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_creator_can_be_approver: Option<bool>, + #[doc = "The number of approvals required to move release forward. '0' means all approvals required."] + #[serde( + rename = "requiredApproverCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub required_approver_count: Option<i32>, + #[doc = "Approval timeout. Approval default timeout is 30 days. Maximum allowed timeout is 365 days. '0' means default timeout i.e 30 days."] + #[serde( + rename = "timeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeout_in_minutes: Option<i32>, } impl ApprovalOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod approval_options { - use super::*; - #[doc = "Approvals execution order."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ExecutionOrder { - #[serde(rename = "beforeGates")] - BeforeGates, - #[serde(rename = "afterSuccessfulGates")] - AfterSuccessfulGates, - #[serde(rename = "afterGatesAlways")] - AfterGatesAlways, - } + use super::*; + #[doc = "Approvals execution order."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ExecutionOrder { + #[serde(rename = "beforeGates")] + BeforeGates, + #[serde(rename = "afterSuccessfulGates")] + AfterSuccessfulGates, + #[serde(rename = "afterGatesAlways")] + AfterGatesAlways, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Artifact { - #[doc = "Gets or sets alias."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub alias: Option<String>, - #[doc = "Gets or sets definition reference. e.g. {\"project\":{\"id\":\"fed755ea-49c5-4399-acea-fd5b5aa90a6c\",\"name\":\"myProject\"},\"definition\":{\"id\":\"1\",\"name\":\"mybuildDefinition\"},\"connection\":{\"id\":\"1\",\"name\":\"myConnection\"}}."] - #[serde( - rename = "definitionReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_reference: Option<serde_json::Value>, - #[doc = "Indicates whether artifact is primary or not."] - #[serde(rename = "isPrimary", default, skip_serializing_if = "Option::is_none")] - pub is_primary: Option<bool>, - #[doc = "Indicates whether artifact is retained by release or not."] - #[serde( - rename = "isRetained", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_retained: Option<bool>, - #[doc = "Gets or sets type. It can have value as 'Build', 'Jenkins', 'GitHub', 'Nuget', 'Team Build (external)', 'ExternalTFSBuild', 'Git', 'TFVC', 'ExternalTfsXamlBuild'."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Gets or sets alias."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, + #[doc = "Gets or sets definition reference. e.g. {\"project\":{\"id\":\"fed755ea-49c5-4399-acea-fd5b5aa90a6c\",\"name\":\"myProject\"},\"definition\":{\"id\":\"1\",\"name\":\"mybuildDefinition\"},\"connection\":{\"id\":\"1\",\"name\":\"myConnection\"}}."] + #[serde( + rename = "definitionReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_reference: Option<serde_json::Value>, + #[doc = "Indicates whether artifact is primary or not."] + #[serde(rename = "isPrimary", default, skip_serializing_if = "Option::is_none")] + pub is_primary: Option<bool>, + #[doc = "Indicates whether artifact is retained by release or not."] + #[serde( + rename = "isRetained", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_retained: Option<bool>, + #[doc = "Gets or sets type. It can have value as 'Build', 'Jenkins', 'GitHub', 'Nuget', 'Team Build (external)', 'ExternalTFSBuild', 'Git', 'TFVC', 'ExternalTfsXamlBuild'."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl Artifact { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactContributionDefinition { - #[doc = ""] - #[serde( - rename = "artifactTriggerConfiguration", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_trigger_configuration: Option<ArtifactTriggerConfiguration>, - #[serde( - rename = "artifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type: Option<String>, - #[serde( - rename = "artifactTypeStreamMapping", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type_stream_mapping: Option<serde_json::Value>, - #[serde( - rename = "browsableArtifactTypeMapping", - default, - skip_serializing_if = "Option::is_none" - )] - pub browsable_artifact_type_mapping: Option<serde_json::Value>, - #[serde( - rename = "dataSourceBindings", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub data_source_bindings: Vec<DataSourceBinding>, - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde( - rename = "downloadTaskId", - default, - skip_serializing_if = "Option::is_none" - )] - pub download_task_id: Option<String>, - #[serde( - rename = "endpointTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_type_id: Option<String>, - #[serde( - rename = "inputDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_descriptors: Vec<InputDescriptor>, - #[serde( - rename = "isCommitsTraceabilitySupported", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_commits_traceability_supported: Option<bool>, - #[serde( - rename = "isWorkitemsTraceabilitySupported", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_workitems_traceability_supported: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "taskInputMapping", - default, - skip_serializing_if = "Option::is_none" - )] - pub task_input_mapping: Option<serde_json::Value>, - #[serde( - rename = "uniqueSourceIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub unique_source_identifier: Option<String>, + #[doc = ""] + #[serde( + rename = "artifactTriggerConfiguration", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_trigger_configuration: Option<ArtifactTriggerConfiguration>, + #[serde( + rename = "artifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type: Option<String>, + #[serde( + rename = "artifactTypeStreamMapping", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type_stream_mapping: Option<serde_json::Value>, + #[serde( + rename = "browsableArtifactTypeMapping", + default, + skip_serializing_if = "Option::is_none" + )] + pub browsable_artifact_type_mapping: Option<serde_json::Value>, + #[serde( + rename = "dataSourceBindings", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub data_source_bindings: Vec<DataSourceBinding>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde( + rename = "downloadTaskId", + default, + skip_serializing_if = "Option::is_none" + )] + pub download_task_id: Option<String>, + #[serde( + rename = "endpointTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_type_id: Option<String>, + #[serde( + rename = "inputDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_descriptors: Vec<InputDescriptor>, + #[serde( + rename = "isCommitsTraceabilitySupported", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_commits_traceability_supported: Option<bool>, + #[serde( + rename = "isWorkitemsTraceabilitySupported", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_workitems_traceability_supported: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "taskInputMapping", + default, + skip_serializing_if = "Option::is_none" + )] + pub task_input_mapping: Option<serde_json::Value>, + #[serde( + rename = "uniqueSourceIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub unique_source_identifier: Option<String>, } impl ArtifactContributionDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactDownloadInputBase { - #[doc = "Gets or sets the alias of artifact."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub alias: Option<String>, - #[doc = "Gets or sets the name of artifact definition. Valid values are 'Skip', 'Selective', 'All'."] - #[serde( - rename = "artifactDownloadMode", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_download_mode: Option<String>, - #[doc = "Gets or sets the artifact items of the input."] - #[serde( - rename = "artifactItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub artifact_items: Vec<String>, - #[doc = "Gets or sets the type of artifact."] - #[serde( - rename = "artifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type: Option<String>, + #[doc = "Gets or sets the alias of artifact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, + #[doc = "Gets or sets the name of artifact definition. Valid values are 'Skip', 'Selective', 'All'."] + #[serde( + rename = "artifactDownloadMode", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_download_mode: Option<String>, + #[doc = "Gets or sets the artifact items of the input."] + #[serde( + rename = "artifactItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub artifact_items: Vec<String>, + #[doc = "Gets or sets the type of artifact."] + #[serde( + rename = "artifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type: Option<String>, } impl ArtifactDownloadInputBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactFilter { - #[doc = "Gets or sets whether a release should be created on build tagging."] - #[serde( - rename = "createReleaseOnBuildTagging", - default, - skip_serializing_if = "Option::is_none" - )] - pub create_release_on_build_tagging: Option<bool>, - #[doc = "Gets or sets the branch for the filter."] - #[serde( - rename = "sourceBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_branch: Option<String>, - #[doc = ""] - #[serde(rename = "tagFilter", default, skip_serializing_if = "Option::is_none")] - pub tag_filter: Option<TagFilter>, - #[doc = "Gets or sets the list of tags for the filter."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[doc = "Gets or sets whether filter should default to build definition branch."] - #[serde( - rename = "useBuildDefinitionBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub use_build_definition_branch: Option<bool>, + #[doc = "Gets or sets whether a release should be created on build tagging."] + #[serde( + rename = "createReleaseOnBuildTagging", + default, + skip_serializing_if = "Option::is_none" + )] + pub create_release_on_build_tagging: Option<bool>, + #[doc = "Gets or sets the branch for the filter."] + #[serde( + rename = "sourceBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_branch: Option<String>, + #[doc = ""] + #[serde(rename = "tagFilter", default, skip_serializing_if = "Option::is_none")] + pub tag_filter: Option<TagFilter>, + #[doc = "Gets or sets the list of tags for the filter."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[doc = "Gets or sets whether filter should default to build definition branch."] + #[serde( + rename = "useBuildDefinitionBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub use_build_definition_branch: Option<bool>, } impl ArtifactFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactInstanceData { - #[serde( - rename = "accountName", - default, - skip_serializing_if = "Option::is_none" - )] - pub account_name: Option<String>, - #[serde( - rename = "authenticationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub authentication_token: Option<String>, - #[serde(rename = "tfsUrl", default, skip_serializing_if = "Option::is_none")] - pub tfs_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[serde( + rename = "accountName", + default, + skip_serializing_if = "Option::is_none" + )] + pub account_name: Option<String>, + #[serde( + rename = "authenticationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub authentication_token: Option<String>, + #[serde(rename = "tfsUrl", default, skip_serializing_if = "Option::is_none")] + pub tfs_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl ArtifactInstanceData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactMetadata { - #[doc = "Sets alias of artifact."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub alias: Option<String>, - #[doc = ""] - #[serde( - rename = "instanceReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub instance_reference: Option<BuildVersion>, + #[doc = "Sets alias of artifact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, + #[doc = ""] + #[serde( + rename = "instanceReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub instance_reference: Option<BuildVersion>, } impl ArtifactMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactProvider { - #[doc = "Gets or sets the id of artifact provider."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Gets or sets the name of artifact provider."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the link of artifact provider."] - #[serde(rename = "sourceUri", default, skip_serializing_if = "Option::is_none")] - pub source_uri: Option<String>, - #[doc = "Gets or sets the version of artifact provider."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Gets or sets the id of artifact provider."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Gets or sets the name of artifact provider."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the link of artifact provider."] + #[serde(rename = "sourceUri", default, skip_serializing_if = "Option::is_none")] + pub source_uri: Option<String>, + #[doc = "Gets or sets the version of artifact provider."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl ArtifactProvider { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactSourceId { - #[doc = "Gets or sets the artifact type of artifact source."] - #[serde( - rename = "artifactTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type_id: Option<String>, - #[doc = "Gets or sets the list of sourceIdInput of artifact source."] - #[serde( - rename = "sourceIdInputs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub source_id_inputs: Vec<SourceIdInput>, + #[doc = "Gets or sets the artifact type of artifact source."] + #[serde( + rename = "artifactTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type_id: Option<String>, + #[doc = "Gets or sets the list of sourceIdInput of artifact source."] + #[serde( + rename = "sourceIdInputs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub source_id_inputs: Vec<SourceIdInput>, } impl ArtifactSourceId { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactSourceIdsQueryResult { - #[doc = "Gets or sets the list of artifactsourceIds."] - #[serde( - rename = "artifactSourceIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub artifact_source_ids: Vec<ArtifactSourceId>, + #[doc = "Gets or sets the list of artifactsourceIds."] + #[serde( + rename = "artifactSourceIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub artifact_source_ids: Vec<ArtifactSourceId>, } impl ArtifactSourceIdsQueryResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactSourceReference { - #[doc = "ID of the artifact source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the artifact source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "ID of the artifact source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the artifact source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ArtifactSourceReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactSourceTrigger { - #[serde(flatten)] - pub release_trigger_base: ReleaseTriggerBase, - #[doc = "Artifact source alias for Artifact Source trigger type"] - #[serde( - rename = "artifactAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_alias: Option<String>, - #[serde( - rename = "triggerConditions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub trigger_conditions: Vec<ArtifactFilter>, + #[serde(flatten)] + pub release_trigger_base: ReleaseTriggerBase, + #[doc = "Artifact source alias for Artifact Source trigger type"] + #[serde( + rename = "artifactAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_alias: Option<String>, + #[serde( + rename = "triggerConditions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub trigger_conditions: Vec<ArtifactFilter>, } impl ArtifactSourceTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactTriggerConfiguration { - #[doc = "Gets or sets the whether trigger is supported or not."] - #[serde( - rename = "isTriggerSupported", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_trigger_supported: Option<bool>, - #[doc = "Gets or sets the whether trigger is supported only on hosted environment."] - #[serde( - rename = "isTriggerSupportedOnlyInHosted", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_trigger_supported_only_in_hosted: Option<bool>, - #[doc = "Gets or sets the whether webhook is supported at server level."] - #[serde( - rename = "isWebhookSupportedAtServerLevel", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_webhook_supported_at_server_level: Option<bool>, - #[doc = "Gets or sets the payload hash header name for the artifact trigger configuration."] - #[serde( - rename = "payloadHashHeaderName", - default, - skip_serializing_if = "Option::is_none" - )] - pub payload_hash_header_name: Option<String>, - #[doc = "Gets or sets the resources for artifact trigger configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option<serde_json::Value>, - #[doc = "Gets or sets the webhook payload mapping for artifact trigger configuration."] - #[serde( - rename = "webhookPayloadMapping", - default, - skip_serializing_if = "Option::is_none" - )] - pub webhook_payload_mapping: Option<serde_json::Value>, + #[doc = "Gets or sets the whether trigger is supported or not."] + #[serde( + rename = "isTriggerSupported", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_trigger_supported: Option<bool>, + #[doc = "Gets or sets the whether trigger is supported only on hosted environment."] + #[serde( + rename = "isTriggerSupportedOnlyInHosted", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_trigger_supported_only_in_hosted: Option<bool>, + #[doc = "Gets or sets the whether webhook is supported at server level."] + #[serde( + rename = "isWebhookSupportedAtServerLevel", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_webhook_supported_at_server_level: Option<bool>, + #[doc = "Gets or sets the payload hash header name for the artifact trigger configuration."] + #[serde( + rename = "payloadHashHeaderName", + default, + skip_serializing_if = "Option::is_none" + )] + pub payload_hash_header_name: Option<String>, + #[doc = "Gets or sets the resources for artifact trigger configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resources: Option<serde_json::Value>, + #[doc = "Gets or sets the webhook payload mapping for artifact trigger configuration."] + #[serde( + rename = "webhookPayloadMapping", + default, + skip_serializing_if = "Option::is_none" + )] + pub webhook_payload_mapping: Option<serde_json::Value>, } impl ArtifactTriggerConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactTypeDefinition { - #[doc = ""] - #[serde( - rename = "artifactTriggerConfiguration", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_trigger_configuration: Option<ArtifactTriggerConfiguration>, - #[doc = "Gets or sets the artifact type of artifact type definition. Valid values are 'Build', 'Package', 'Source' or 'ContainerImage'."] - #[serde( - rename = "artifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type: Option<String>, - #[doc = "Gets or sets the display name of artifact type definition."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Gets or sets the endpoint type id of artifact type definition."] - #[serde( - rename = "endpointTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_type_id: Option<String>, - #[doc = "Gets or sets the input descriptors of artifact type definition."] - #[serde( - rename = "inputDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_descriptors: Vec<InputDescriptor>, - #[doc = "Gets or sets the is commits tracebility supported value of artifact type defintion."] - #[serde( - rename = "isCommitsTraceabilitySupported", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_commits_traceability_supported: Option<bool>, - #[doc = "Gets or sets the is workitems tracebility supported value of artifact type defintion."] - #[serde( - rename = "isWorkitemsTraceabilitySupported", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_workitems_traceability_supported: Option<bool>, - #[doc = "Gets or sets the name of artifact type definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the unique source identifier of artifact type definition."] - #[serde( - rename = "uniqueSourceIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub unique_source_identifier: Option<String>, + #[doc = ""] + #[serde( + rename = "artifactTriggerConfiguration", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_trigger_configuration: Option<ArtifactTriggerConfiguration>, + #[doc = "Gets or sets the artifact type of artifact type definition. Valid values are 'Build', 'Package', 'Source' or 'ContainerImage'."] + #[serde( + rename = "artifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type: Option<String>, + #[doc = "Gets or sets the display name of artifact type definition."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Gets or sets the endpoint type id of artifact type definition."] + #[serde( + rename = "endpointTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_type_id: Option<String>, + #[doc = "Gets or sets the input descriptors of artifact type definition."] + #[serde( + rename = "inputDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_descriptors: Vec<InputDescriptor>, + #[doc = "Gets or sets the is commits tracebility supported value of artifact type defintion."] + #[serde( + rename = "isCommitsTraceabilitySupported", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_commits_traceability_supported: Option<bool>, + #[doc = "Gets or sets the is workitems tracebility supported value of artifact type defintion."] + #[serde( + rename = "isWorkitemsTraceabilitySupported", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_workitems_traceability_supported: Option<bool>, + #[doc = "Gets or sets the name of artifact type definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the unique source identifier of artifact type definition."] + #[serde( + rename = "uniqueSourceIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub unique_source_identifier: Option<String>, } impl ArtifactTypeDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactVersion { - #[doc = "Gets or sets the alias of artifact."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub alias: Option<String>, - #[doc = ""] - #[serde( - rename = "defaultVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_version: Option<BuildVersion>, - #[doc = "Gets or sets the error message encountered during querying of versions for artifact."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "Gets or sets the list of build versions of artifact."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub versions: Vec<BuildVersion>, + #[doc = "Gets or sets the alias of artifact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, + #[doc = ""] + #[serde( + rename = "defaultVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_version: Option<BuildVersion>, + #[doc = "Gets or sets the error message encountered during querying of versions for artifact."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "Gets or sets the list of build versions of artifact."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub versions: Vec<BuildVersion>, } impl ArtifactVersion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactVersionQueryResult { - #[doc = "Gets or sets the list for artifact versions of artifact version query result."] - #[serde( - rename = "artifactVersions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub artifact_versions: Vec<ArtifactVersion>, + #[doc = "Gets or sets the list for artifact versions of artifact version query result."] + #[serde( + rename = "artifactVersions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub artifact_versions: Vec<ArtifactVersion>, } impl ArtifactVersionQueryResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactsDownloadInput { - #[serde( - rename = "downloadInputs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub download_inputs: Vec<ArtifactDownloadInputBase>, + #[serde( + rename = "downloadInputs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub download_inputs: Vec<ArtifactDownloadInputBase>, } impl ArtifactsDownloadInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuthorizationHeader { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl AuthorizationHeader { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AutoTriggerIssue { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub issue: Option<Issue>, - #[serde( - rename = "issueSource", - default, - skip_serializing_if = "Option::is_none" - )] - pub issue_source: Option<auto_trigger_issue::IssueSource>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, - #[doc = ""] - #[serde( - rename = "releaseDefinitionReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_definition_reference: Option<ReleaseDefinitionShallowReference>, - #[serde( - rename = "releaseTriggerType", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_trigger_type: Option<auto_trigger_issue::ReleaseTriggerType>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issue: Option<Issue>, + #[serde( + rename = "issueSource", + default, + skip_serializing_if = "Option::is_none" + )] + pub issue_source: Option<auto_trigger_issue::IssueSource>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, + #[doc = ""] + #[serde( + rename = "releaseDefinitionReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_definition_reference: Option<ReleaseDefinitionShallowReference>, + #[serde( + rename = "releaseTriggerType", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_trigger_type: Option<auto_trigger_issue::ReleaseTriggerType>, } impl AutoTriggerIssue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod auto_trigger_issue { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum IssueSource { - #[serde(rename = "none")] - None, - #[serde(rename = "user")] - User, - #[serde(rename = "system")] - System, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ReleaseTriggerType { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "artifactSource")] - ArtifactSource, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "sourceRepo")] - SourceRepo, - #[serde(rename = "containerImage")] - ContainerImage, - #[serde(rename = "package")] - Package, - #[serde(rename = "pullRequest")] - PullRequest, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum IssueSource { + #[serde(rename = "none")] + None, + #[serde(rename = "user")] + User, + #[serde(rename = "system")] + System, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ReleaseTriggerType { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "artifactSource")] + ArtifactSource, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "sourceRepo")] + SourceRepo, + #[serde(rename = "containerImage")] + ContainerImage, + #[serde(rename = "package")] + Package, + #[serde(rename = "pullRequest")] + PullRequest, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureKeyVaultVariableGroupProviderData { - #[serde(flatten)] - pub variable_group_provider_data: VariableGroupProviderData, - #[doc = "Gets or sets last refreshed time."] - #[serde( - rename = "lastRefreshedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_refreshed_on: Option<time::OffsetDateTime>, - #[doc = "Gets or sets the service endpoint ID."] - #[serde( - rename = "serviceEndpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_id: Option<String>, - #[doc = "Gets or sets the vault name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub vault: Option<String>, + #[serde(flatten)] + pub variable_group_provider_data: VariableGroupProviderData, + #[doc = "Gets or sets last refreshed time."] + #[serde( + rename = "lastRefreshedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_refreshed_on: Option<time::OffsetDateTime>, + #[doc = "Gets or sets the service endpoint ID."] + #[serde( + rename = "serviceEndpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_id: Option<String>, + #[doc = "Gets or sets the vault name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vault: Option<String>, } impl AzureKeyVaultVariableGroupProviderData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureKeyVaultVariableValue { - #[serde(flatten)] - pub variable_value: VariableValue, - #[doc = "Gets or sets the content type of key vault variable value."] - #[serde( - rename = "contentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_type: Option<String>, - #[doc = "Indicates the vault variable value enabled or not."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[doc = "Gets or sets the expire time of key vault variable value."] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub expires: Option<time::OffsetDateTime>, + #[serde(flatten)] + pub variable_value: VariableValue, + #[doc = "Gets or sets the content type of key vault variable value."] + #[serde( + rename = "contentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_type: Option<String>, + #[doc = "Indicates the vault variable value enabled or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[doc = "Gets or sets the expire time of key vault variable value."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub expires: Option<time::OffsetDateTime>, } impl AzureKeyVaultVariableValue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BaseDeploymentInput { - #[doc = "Gets or sets the job condition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub condition: Option<String>, - #[doc = "Gets or sets the job cancel timeout in minutes for deployment which are cancelled by user for this release environment."] - #[serde( - rename = "jobCancelTimeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_cancel_timeout_in_minutes: Option<i32>, - #[doc = "Gets or sets the override inputs."] - #[serde( - rename = "overrideInputs", - default, - skip_serializing_if = "Option::is_none" - )] - pub override_inputs: Option<serde_json::Value>, - #[doc = "Gets or sets the job execution timeout in minutes for deployment which are queued against this release environment."] - #[serde( - rename = "timeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeout_in_minutes: Option<i32>, + #[doc = "Gets or sets the job condition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub condition: Option<String>, + #[doc = "Gets or sets the job cancel timeout in minutes for deployment which are cancelled by user for this release environment."] + #[serde( + rename = "jobCancelTimeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_cancel_timeout_in_minutes: Option<i32>, + #[doc = "Gets or sets the override inputs."] + #[serde( + rename = "overrideInputs", + default, + skip_serializing_if = "Option::is_none" + )] + pub override_inputs: Option<serde_json::Value>, + #[doc = "Gets or sets the job execution timeout in minutes for deployment which are queued against this release environment."] + #[serde( + rename = "timeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeout_in_minutes: Option<i32>, } impl BaseDeploymentInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildArtifactDownloadInput { - #[serde(flatten)] - pub artifact_download_input_base: ArtifactDownloadInputBase, + #[serde(flatten)] + pub artifact_download_input_base: ArtifactDownloadInputBase, } impl BuildArtifactDownloadInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildVersion { - #[doc = "Gets or sets the commit message for the artifact."] - #[serde( - rename = "commitMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub commit_message: Option<String>, - #[doc = "Gets or sets the definition id."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<String>, - #[doc = "Gets or sets the definition name."] - #[serde( - rename = "definitionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_name: Option<String>, - #[doc = "Gets or sets the build id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Gets or sets if the artifact supports multiple definitions."] - #[serde( - rename = "isMultiDefinitionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_multi_definition_type: Option<bool>, - #[doc = "Gets or sets the build number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the source branch for the artifact."] - #[serde( - rename = "sourceBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_branch: Option<String>, - #[doc = ""] - #[serde( - rename = "sourcePullRequestVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_pull_request_version: Option<SourcePullRequestVersion>, - #[doc = "Gets or sets the repository id for the artifact."] - #[serde( - rename = "sourceRepositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_repository_id: Option<String>, - #[doc = "Gets or sets the repository type for the artifact."] - #[serde( - rename = "sourceRepositoryType", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_repository_type: Option<String>, - #[doc = "Gets or sets the source version for the artifact."] - #[serde( - rename = "sourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_version: Option<String>, + #[doc = "Gets or sets the commit message for the artifact."] + #[serde( + rename = "commitMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub commit_message: Option<String>, + #[doc = "Gets or sets the definition id."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<String>, + #[doc = "Gets or sets the definition name."] + #[serde( + rename = "definitionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_name: Option<String>, + #[doc = "Gets or sets the build id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Gets or sets if the artifact supports multiple definitions."] + #[serde( + rename = "isMultiDefinitionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_multi_definition_type: Option<bool>, + #[doc = "Gets or sets the build number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the source branch for the artifact."] + #[serde( + rename = "sourceBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_branch: Option<String>, + #[doc = ""] + #[serde( + rename = "sourcePullRequestVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_pull_request_version: Option<SourcePullRequestVersion>, + #[doc = "Gets or sets the repository id for the artifact."] + #[serde( + rename = "sourceRepositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_repository_id: Option<String>, + #[doc = "Gets or sets the repository type for the artifact."] + #[serde( + rename = "sourceRepositoryType", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_repository_type: Option<String>, + #[doc = "Gets or sets the source version for the artifact."] + #[serde( + rename = "sourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_version: Option<String>, } impl BuildVersion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a change associated with a build."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Change { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<IdentityRef>, - #[doc = "The type of source. \"TfsVersionControl\", \"TfsGit\", etc."] - #[serde( - rename = "changeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_type: Option<String>, - #[doc = "The location of a user-friendly representation of the resource."] - #[serde( - rename = "displayUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_uri: Option<String>, - #[doc = "Something that identifies the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The location of the full representation of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option<String>, - #[doc = "A description of the change. This might be a commit message or changeset description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = ""] - #[serde(rename = "pushedBy", default, skip_serializing_if = "Option::is_none")] - pub pushed_by: Option<IdentityRef>, - #[doc = "A timestamp for the change."] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub timestamp: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<IdentityRef>, + #[doc = "The type of source. \"TfsVersionControl\", \"TfsGit\", etc."] + #[serde( + rename = "changeType", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_type: Option<String>, + #[doc = "The location of a user-friendly representation of the resource."] + #[serde( + rename = "displayUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_uri: Option<String>, + #[doc = "Something that identifies the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The location of the full representation of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option<String>, + #[doc = "A description of the change. This might be a commit message or changeset description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = ""] + #[serde(rename = "pushedBy", default, skip_serializing_if = "Option::is_none")] + pub pushed_by: Option<IdentityRef>, + #[doc = "A timestamp for the change."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub timestamp: Option<time::OffsetDateTime>, } impl Change { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CodeRepositoryReference { - #[doc = "Gets and sets the repository references."] - #[serde( - rename = "repositoryReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_reference: Option<serde_json::Value>, - #[doc = "It can have value as ‘GitHub’, ‘Vsts’."] - #[serde( - rename = "systemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub system_type: Option<code_repository_reference::SystemType>, + #[doc = "Gets and sets the repository references."] + #[serde( + rename = "repositoryReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_reference: Option<serde_json::Value>, + #[doc = "It can have value as ‘GitHub’, ‘Vsts’."] + #[serde( + rename = "systemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub system_type: Option<code_repository_reference::SystemType>, } impl CodeRepositoryReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod code_repository_reference { - use super::*; - #[doc = "It can have value as ‘GitHub’, ‘Vsts’."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SystemType { - #[serde(rename = "none")] - None, - #[serde(rename = "tfsGit")] - TfsGit, - #[serde(rename = "gitHub")] - GitHub, - } + use super::*; + #[doc = "It can have value as ‘GitHub’, ‘Vsts’."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SystemType { + #[serde(rename = "none")] + None, + #[serde(rename = "tfsGit")] + TfsGit, + #[serde(rename = "gitHub")] + GitHub, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ComplianceSettings { - #[doc = "Scan the release definition for secrets"] - #[serde( - rename = "checkForCredentialsAndOtherSecrets", - default, - skip_serializing_if = "Option::is_none" - )] - pub check_for_credentials_and_other_secrets: Option<bool>, + #[doc = "Scan the release definition for secrets"] + #[serde( + rename = "checkForCredentialsAndOtherSecrets", + default, + skip_serializing_if = "Option::is_none" + )] + pub check_for_credentials_and_other_secrets: Option<bool>, } impl ComplianceSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Condition { - #[doc = "Gets or sets the condition type."] - #[serde( - rename = "conditionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub condition_type: Option<condition::ConditionType>, - #[doc = "Gets or sets the name of the condition. e.g. 'ReleaseStarted'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or set value of the condition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Gets or sets the condition type."] + #[serde( + rename = "conditionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub condition_type: Option<condition::ConditionType>, + #[doc = "Gets or sets the name of the condition. e.g. 'ReleaseStarted'."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or set value of the condition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl Condition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod condition { - use super::*; - #[doc = "Gets or sets the condition type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ConditionType { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "event")] - Event, - #[serde(rename = "environmentState")] - EnvironmentState, - #[serde(rename = "artifact")] - Artifact, - } + use super::*; + #[doc = "Gets or sets the condition type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ConditionType { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "event")] + Event, + #[serde(rename = "environmentState")] + EnvironmentState, + #[serde(rename = "artifact")] + Artifact, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ConfigurationVariableValue { - #[doc = "Gets and sets if a variable can be overridden at deployment time or not."] - #[serde( - rename = "allowOverride", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_override: Option<bool>, - #[doc = "Gets or sets as variable is secret or not."] - #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] - pub is_secret: Option<bool>, - #[doc = "Gets and sets value of the configuration variable."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Gets and sets if a variable can be overridden at deployment time or not."] + #[serde( + rename = "allowOverride", + default, + skip_serializing_if = "Option::is_none" + )] + pub allow_override: Option<bool>, + #[doc = "Gets or sets as variable is secret or not."] + #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] + pub is_secret: Option<bool>, + #[doc = "Gets and sets value of the configuration variable."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl ConfigurationVariableValue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Consumer { - #[doc = "ID of the consumer."] - #[serde( - rename = "consumerId", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_id: Option<i32>, - #[doc = "Name of the consumer."] - #[serde( - rename = "consumerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub consumer_name: Option<String>, + #[doc = "ID of the consumer."] + #[serde( + rename = "consumerId", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_id: Option<i32>, + #[doc = "Name of the consumer."] + #[serde( + rename = "consumerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub consumer_name: Option<String>, } impl Consumer { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContainerImageTrigger { - #[serde(flatten)] - pub release_trigger_base: ReleaseTriggerBase, - #[doc = "Alias of the trigger."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub alias: Option<String>, - #[doc = "List tag filters applied while trigger."] - #[serde( - rename = "tagFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tag_filters: Vec<TagFilter>, + #[serde(flatten)] + pub release_trigger_base: ReleaseTriggerBase, + #[doc = "Alias of the trigger."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, + #[doc = "List tag filters applied while trigger."] + #[serde( + rename = "tagFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tag_filters: Vec<TagFilter>, } impl ContainerImageTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContinuousDeploymentTriggerIssue { - #[serde(flatten)] - pub auto_trigger_issue: AutoTriggerIssue, - #[doc = "Artifact type."] - #[serde( - rename = "artifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type: Option<String>, - #[doc = "ArtifactVersion ID."] - #[serde( - rename = "artifactVersionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_version_id: Option<String>, - #[doc = "Artifact source ID."] - #[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")] - pub source_id: Option<String>, + #[serde(flatten)] + pub auto_trigger_issue: AutoTriggerIssue, + #[doc = "Artifact type."] + #[serde( + rename = "artifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type: Option<String>, + #[doc = "ArtifactVersion ID."] + #[serde( + rename = "artifactVersionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_version_id: Option<String>, + #[doc = "Artifact source ID."] + #[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")] + pub source_id: Option<String>, } impl ContinuousDeploymentTriggerIssue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ControlOptions { - #[doc = "Always run the job."] - #[serde(rename = "alwaysRun", default, skip_serializing_if = "Option::is_none")] - pub always_run: Option<bool>, - #[doc = "Indicates whether to continue job on error or not."] - #[serde( - rename = "continueOnError", - default, - skip_serializing_if = "Option::is_none" - )] - pub continue_on_error: Option<bool>, - #[doc = "Indicates the job enabled or not."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, + #[doc = "Always run the job."] + #[serde(rename = "alwaysRun", default, skip_serializing_if = "Option::is_none")] + pub always_run: Option<bool>, + #[doc = "Indicates whether to continue job on error or not."] + #[serde( + rename = "continueOnError", + default, + skip_serializing_if = "Option::is_none" + )] + pub continue_on_error: Option<bool>, + #[doc = "Indicates the job enabled or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, } impl ControlOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomArtifactDownloadInput { - #[serde(flatten)] - pub artifact_download_input_base: ArtifactDownloadInputBase, + #[serde(flatten)] + pub artifact_download_input_base: ArtifactDownloadInputBase, } impl CustomArtifactDownloadInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataSourceBinding { - #[doc = "Pagination format supported by this data source(ContinuationToken/SkipTop)."] - #[serde( - rename = "callbackContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_context_template: Option<String>, - #[doc = "Subsequent calls needed?"] - #[serde( - rename = "callBackRequiredTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub call_back_required_template: Option<String>, - #[doc = "Name of the datasource."] - #[serde( - rename = "dataSourceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub data_source_name: Option<String>, - #[doc = "Endpoint ID of the datasource."] - #[serde( - rename = "endpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_id: Option<String>, - #[doc = "Endpoint URL of the datasource."] - #[serde( - rename = "endpointUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_url: Option<String>, - #[doc = "Defines the initial value of the query params"] - #[serde( - rename = "initialContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub initial_context_template: Option<String>, - #[doc = "Parameters of the datasource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<serde_json::Value>, - #[doc = "Gets or sets http request body"] - #[serde( - rename = "requestContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_content: Option<String>, - #[doc = "Gets or sets http request verb"] - #[serde( - rename = "requestVerb", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_verb: Option<String>, - #[doc = "Result selector applied on output of datasource result, for example jsonpath:$.value[?(@.properties.isEnabled == true)]."] - #[serde( - rename = "resultSelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_selector: Option<String>, - #[doc = "Format of the return results, for example. { \"Value\" : \"{{{id}}}\", \"DisplayValue\" : \"{{{name}}}\" }."] - #[serde( - rename = "resultTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_template: Option<String>, - #[doc = "Target of the datasource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<String>, + #[doc = "Pagination format supported by this data source(ContinuationToken/SkipTop)."] + #[serde( + rename = "callbackContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_context_template: Option<String>, + #[doc = "Subsequent calls needed?"] + #[serde( + rename = "callBackRequiredTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub call_back_required_template: Option<String>, + #[doc = "Name of the datasource."] + #[serde( + rename = "dataSourceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub data_source_name: Option<String>, + #[doc = "Endpoint ID of the datasource."] + #[serde( + rename = "endpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_id: Option<String>, + #[doc = "Endpoint URL of the datasource."] + #[serde( + rename = "endpointUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_url: Option<String>, + #[doc = "Defines the initial value of the query params"] + #[serde( + rename = "initialContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub initial_context_template: Option<String>, + #[doc = "Parameters of the datasource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<serde_json::Value>, + #[doc = "Gets or sets http request body"] + #[serde( + rename = "requestContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_content: Option<String>, + #[doc = "Gets or sets http request verb"] + #[serde( + rename = "requestVerb", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_verb: Option<String>, + #[doc = "Result selector applied on output of datasource result, for example jsonpath:$.value[?(@.properties.isEnabled == true)]."] + #[serde( + rename = "resultSelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_selector: Option<String>, + #[doc = "Format of the return results, for example. { \"Value\" : \"{{{id}}}\", \"DisplayValue\" : \"{{{name}}}\" }."] + #[serde( + rename = "resultTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_template: Option<String>, + #[doc = "Target of the datasource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<String>, } impl DataSourceBinding { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents binding of data source for the service endpoint request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataSourceBindingBase { - #[doc = "Pagination format supported by this data source(ContinuationToken/SkipTop)."] - #[serde( - rename = "callbackContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_context_template: Option<String>, - #[doc = "Subsequent calls needed?"] - #[serde( - rename = "callbackRequiredTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_required_template: Option<String>, - #[doc = "Gets or sets the name of the data source."] - #[serde( - rename = "dataSourceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub data_source_name: Option<String>, - #[doc = "Gets or sets the endpoint Id."] - #[serde( - rename = "endpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_id: Option<String>, - #[doc = "Gets or sets the url of the service endpoint."] - #[serde( - rename = "endpointUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_url: Option<String>, - #[doc = "Gets or sets the authorization headers."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub headers: Vec<AuthorizationHeader>, - #[doc = "Defines the initial value of the query params"] - #[serde( - rename = "initialContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub initial_context_template: Option<String>, - #[doc = "Gets or sets the parameters for the data source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<serde_json::Value>, - #[doc = "Gets or sets http request body"] - #[serde( - rename = "requestContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_content: Option<String>, - #[doc = "Gets or sets http request verb"] - #[serde( - rename = "requestVerb", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_verb: Option<String>, - #[doc = "Gets or sets the result selector."] - #[serde( - rename = "resultSelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_selector: Option<String>, - #[doc = "Gets or sets the result template."] - #[serde( - rename = "resultTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_template: Option<String>, - #[doc = "Gets or sets the target of the data source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<String>, + #[doc = "Pagination format supported by this data source(ContinuationToken/SkipTop)."] + #[serde( + rename = "callbackContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_context_template: Option<String>, + #[doc = "Subsequent calls needed?"] + #[serde( + rename = "callbackRequiredTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_required_template: Option<String>, + #[doc = "Gets or sets the name of the data source."] + #[serde( + rename = "dataSourceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub data_source_name: Option<String>, + #[doc = "Gets or sets the endpoint Id."] + #[serde( + rename = "endpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_id: Option<String>, + #[doc = "Gets or sets the url of the service endpoint."] + #[serde( + rename = "endpointUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_url: Option<String>, + #[doc = "Gets or sets the authorization headers."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub headers: Vec<AuthorizationHeader>, + #[doc = "Defines the initial value of the query params"] + #[serde( + rename = "initialContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub initial_context_template: Option<String>, + #[doc = "Gets or sets the parameters for the data source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<serde_json::Value>, + #[doc = "Gets or sets http request body"] + #[serde( + rename = "requestContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_content: Option<String>, + #[doc = "Gets or sets http request verb"] + #[serde( + rename = "requestVerb", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_verb: Option<String>, + #[doc = "Gets or sets the result selector."] + #[serde( + rename = "resultSelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_selector: Option<String>, + #[doc = "Gets or sets the result template."] + #[serde( + rename = "resultTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_template: Option<String>, + #[doc = "Gets or sets the target of the data source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<String>, } impl DataSourceBindingBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DefinitionEnvironmentReference { - #[doc = "Definition environment ID."] - #[serde( - rename = "definitionEnvironmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_environment_id: Option<i32>, - #[doc = "Definition environment name."] - #[serde( - rename = "definitionEnvironmentName", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_environment_name: Option<String>, - #[doc = "ReleaseDefinition ID."] - #[serde( - rename = "releaseDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_definition_id: Option<i32>, - #[doc = "ReleaseDefinition name."] - #[serde( - rename = "releaseDefinitionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_definition_name: Option<String>, + #[doc = "Definition environment ID."] + #[serde( + rename = "definitionEnvironmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_environment_id: Option<i32>, + #[doc = "Definition environment name."] + #[serde( + rename = "definitionEnvironmentName", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_environment_name: Option<String>, + #[doc = "ReleaseDefinition ID."] + #[serde( + rename = "releaseDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_definition_id: Option<i32>, + #[doc = "ReleaseDefinition name."] + #[serde( + rename = "releaseDefinitionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_definition_name: Option<String>, } impl DefinitionEnvironmentReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Demand { - #[doc = "Gets and sets the name of demand."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets and sets the value of demand."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Gets and sets the name of demand."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets and sets the value of demand."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl Demand { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeployPhase { - #[doc = "Gets and sets the name of deploy phase."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Indicates the deploy phase type."] - #[serde(rename = "phaseType", default, skip_serializing_if = "Option::is_none")] - pub phase_type: Option<deploy_phase::PhaseType>, - #[doc = "Gets and sets the rank of deploy phase."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option<i32>, - #[doc = "Gets and sets the reference name of deploy phase."] - #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] - pub ref_name: Option<String>, - #[doc = "Gets and sets the workflow tasks for the deploy phase."] - #[serde( - rename = "workflowTasks", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub workflow_tasks: Vec<WorkflowTask>, + #[doc = "Gets and sets the name of deploy phase."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Indicates the deploy phase type."] + #[serde(rename = "phaseType", default, skip_serializing_if = "Option::is_none")] + pub phase_type: Option<deploy_phase::PhaseType>, + #[doc = "Gets and sets the rank of deploy phase."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option<i32>, + #[doc = "Gets and sets the reference name of deploy phase."] + #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] + pub ref_name: Option<String>, + #[doc = "Gets and sets the workflow tasks for the deploy phase."] + #[serde( + rename = "workflowTasks", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub workflow_tasks: Vec<WorkflowTask>, } impl DeployPhase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod deploy_phase { - use super::*; - #[doc = "Indicates the deploy phase type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum PhaseType { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "agentBasedDeployment")] - AgentBasedDeployment, - #[serde(rename = "runOnServer")] - RunOnServer, - #[serde(rename = "machineGroupBasedDeployment")] - MachineGroupBasedDeployment, - #[serde(rename = "deploymentGates")] - DeploymentGates, - } + use super::*; + #[doc = "Indicates the deploy phase type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum PhaseType { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "agentBasedDeployment")] + AgentBasedDeployment, + #[serde(rename = "runOnServer")] + RunOnServer, + #[serde(rename = "machineGroupBasedDeployment")] + MachineGroupBasedDeployment, + #[serde(rename = "deploymentGates")] + DeploymentGates, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Deployment { - #[doc = "Gets attempt number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Gets the date on which deployment is complete."] - #[serde( - rename = "completedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_on: Option<time::OffsetDateTime>, - #[doc = "Gets the list of condition associated with deployment."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub conditions: Vec<Condition>, - #[doc = "Gets release definition environment id."] - #[serde( - rename = "definitionEnvironmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_environment_id: Option<i32>, - #[doc = "Gets status of the deployment."] - #[serde( - rename = "deploymentStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub deployment_status: Option<deployment::DeploymentStatus>, - #[doc = "Gets the unique identifier for deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = ""] - #[serde( - rename = "lastModifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_modified_by: Option<IdentityRef>, - #[doc = "Gets the date on which deployment is last modified."] - #[serde( - rename = "lastModifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified_on: Option<time::OffsetDateTime>, - #[doc = "Gets operation status of deployment."] - #[serde( - rename = "operationStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_status: Option<deployment::OperationStatus>, - #[doc = "Gets list of PostDeployApprovals."] - #[serde( - rename = "postDeployApprovals", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub post_deploy_approvals: Vec<ReleaseApproval>, - #[doc = "Gets list of PreDeployApprovals."] - #[serde( - rename = "preDeployApprovals", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub pre_deploy_approvals: Vec<ReleaseApproval>, - #[doc = ""] - #[serde( - rename = "projectReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_reference: Option<ProjectReference>, - #[doc = "Gets the date on which deployment is queued."] - #[serde( - rename = "queuedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub queued_on: Option<time::OffsetDateTime>, - #[doc = "Gets reason of deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<deployment::Reason>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ReleaseReference>, - #[doc = ""] - #[serde( - rename = "releaseDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_definition: Option<ReleaseDefinitionShallowReference>, - #[doc = ""] - #[serde( - rename = "releaseEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment: Option<ReleaseEnvironmentShallowReference>, - #[doc = ""] - #[serde( - rename = "requestedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_by: Option<IdentityRef>, - #[doc = ""] - #[serde( - rename = "requestedFor", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_for: Option<IdentityRef>, - #[doc = "Gets the date on which deployment is scheduled."] - #[serde( - rename = "scheduledDeploymentTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub scheduled_deployment_time: Option<time::OffsetDateTime>, - #[doc = "Gets the date on which deployment is started."] - #[serde( - rename = "startedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_on: Option<time::OffsetDateTime>, + #[doc = "Gets attempt number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Gets the date on which deployment is complete."] + #[serde( + rename = "completedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_on: Option<time::OffsetDateTime>, + #[doc = "Gets the list of condition associated with deployment."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub conditions: Vec<Condition>, + #[doc = "Gets release definition environment id."] + #[serde( + rename = "definitionEnvironmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_environment_id: Option<i32>, + #[doc = "Gets status of the deployment."] + #[serde( + rename = "deploymentStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub deployment_status: Option<deployment::DeploymentStatus>, + #[doc = "Gets the unique identifier for deployment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = ""] + #[serde( + rename = "lastModifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_modified_by: Option<IdentityRef>, + #[doc = "Gets the date on which deployment is last modified."] + #[serde( + rename = "lastModifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified_on: Option<time::OffsetDateTime>, + #[doc = "Gets operation status of deployment."] + #[serde( + rename = "operationStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_status: Option<deployment::OperationStatus>, + #[doc = "Gets list of PostDeployApprovals."] + #[serde( + rename = "postDeployApprovals", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub post_deploy_approvals: Vec<ReleaseApproval>, + #[doc = "Gets list of PreDeployApprovals."] + #[serde( + rename = "preDeployApprovals", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub pre_deploy_approvals: Vec<ReleaseApproval>, + #[doc = ""] + #[serde( + rename = "projectReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_reference: Option<ProjectReference>, + #[doc = "Gets the date on which deployment is queued."] + #[serde( + rename = "queuedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub queued_on: Option<time::OffsetDateTime>, + #[doc = "Gets reason of deployment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<deployment::Reason>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ReleaseReference>, + #[doc = ""] + #[serde( + rename = "releaseDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_definition: Option<ReleaseDefinitionShallowReference>, + #[doc = ""] + #[serde( + rename = "releaseEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment: Option<ReleaseEnvironmentShallowReference>, + #[doc = ""] + #[serde( + rename = "requestedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_by: Option<IdentityRef>, + #[doc = ""] + #[serde( + rename = "requestedFor", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_for: Option<IdentityRef>, + #[doc = "Gets the date on which deployment is scheduled."] + #[serde( + rename = "scheduledDeploymentTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub scheduled_deployment_time: Option<time::OffsetDateTime>, + #[doc = "Gets the date on which deployment is started."] + #[serde( + rename = "startedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_on: Option<time::OffsetDateTime>, } impl Deployment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod deployment { - use super::*; - #[doc = "Gets status of the deployment."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DeploymentStatus { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "notDeployed")] - NotDeployed, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "partiallySucceeded")] - PartiallySucceeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "all")] - All, - } - #[doc = "Gets operation status of deployment."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum OperationStatus { - Undefined, - Queued, - Scheduled, - Pending, - Approved, - Rejected, - Deferred, - QueuedForAgent, - PhaseInProgress, - PhaseSucceeded, - PhasePartiallySucceeded, - PhaseFailed, - Canceled, - PhaseCanceled, - ManualInterventionPending, - QueuedForPipeline, - Cancelling, - EvaluatingGates, - GateFailed, - All, - } - #[doc = "Gets reason of deployment."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Reason { - #[serde(rename = "none")] - None, - #[serde(rename = "manual")] - Manual, - #[serde(rename = "automated")] - Automated, - #[serde(rename = "scheduled")] - Scheduled, - #[serde(rename = "redeployTrigger")] - RedeployTrigger, - } + use super::*; + #[doc = "Gets status of the deployment."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DeploymentStatus { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "notDeployed")] + NotDeployed, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "partiallySucceeded")] + PartiallySucceeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "all")] + All, + } + #[doc = "Gets operation status of deployment."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum OperationStatus { + Undefined, + Queued, + Scheduled, + Pending, + Approved, + Rejected, + Deferred, + QueuedForAgent, + PhaseInProgress, + PhaseSucceeded, + PhasePartiallySucceeded, + PhaseFailed, + Canceled, + PhaseCanceled, + ManualInterventionPending, + QueuedForPipeline, + Cancelling, + EvaluatingGates, + GateFailed, + All, + } + #[doc = "Gets reason of deployment."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Reason { + #[serde(rename = "none")] + None, + #[serde(rename = "manual")] + Manual, + #[serde(rename = "automated")] + Automated, + #[serde(rename = "scheduled")] + Scheduled, + #[serde(rename = "redeployTrigger")] + RedeployTrigger, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentApprovalCompletedEvent { - #[serde(flatten)] - pub deployment_event: DeploymentEvent, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub approval: Option<ReleaseApproval>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<Release>, + #[serde(flatten)] + pub deployment_event: DeploymentEvent, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub approval: Option<ReleaseApproval>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<Release>, } impl DeploymentApprovalCompletedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentApprovalPendingEvent { - #[serde(flatten)] - pub deployment_event: DeploymentEvent, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub approval: Option<ReleaseApproval>, - #[doc = ""] - #[serde( - rename = "approvalOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub approval_options: Option<ApprovalOptions>, - #[serde( - rename = "completedApprovals", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub completed_approvals: Vec<ReleaseApproval>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deployment: Option<Deployment>, - #[serde( - rename = "isMultipleRankApproval", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_multiple_rank_approval: Option<bool>, - #[serde( - rename = "pendingApprovals", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub pending_approvals: Vec<ReleaseApproval>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<Release>, + #[serde(flatten)] + pub deployment_event: DeploymentEvent, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub approval: Option<ReleaseApproval>, + #[doc = ""] + #[serde( + rename = "approvalOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub approval_options: Option<ApprovalOptions>, + #[serde( + rename = "completedApprovals", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub completed_approvals: Vec<ReleaseApproval>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deployment: Option<Deployment>, + #[serde( + rename = "isMultipleRankApproval", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_multiple_rank_approval: Option<bool>, + #[serde( + rename = "pendingApprovals", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub pending_approvals: Vec<ReleaseApproval>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<Release>, } impl DeploymentApprovalPendingEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentAttempt { - #[doc = "Deployment attempt."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "ID of the deployment."] - #[serde( - rename = "deploymentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub deployment_id: Option<i32>, - #[doc = "Specifies whether deployment has started or not."] - #[serde( - rename = "hasStarted", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_started: Option<bool>, - #[doc = "ID of deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "All the issues related to the deployment."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub issues: Vec<Issue>, - #[doc = ""] - #[serde( - rename = "lastModifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_modified_by: Option<IdentityRef>, - #[doc = "Time when this deployment last modified."] - #[serde( - rename = "lastModifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified_on: Option<time::OffsetDateTime>, - #[doc = "Deployment operation status."] - #[serde( - rename = "operationStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_status: Option<deployment_attempt::OperationStatus>, - #[doc = ""] - #[serde( - rename = "postDeploymentGates", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_deployment_gates: Option<ReleaseGates>, - #[doc = ""] - #[serde( - rename = "preDeploymentGates", - default, - skip_serializing_if = "Option::is_none" - )] - pub pre_deployment_gates: Option<ReleaseGates>, - #[doc = "When this deployment queued on."] - #[serde( - rename = "queuedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub queued_on: Option<time::OffsetDateTime>, - #[doc = "Reason for the deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<deployment_attempt::Reason>, - #[doc = "List of release deployphases executed in this deployment."] - #[serde( - rename = "releaseDeployPhases", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub release_deploy_phases: Vec<ReleaseDeployPhase>, - #[doc = ""] - #[serde( - rename = "requestedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_by: Option<IdentityRef>, - #[doc = ""] - #[serde( - rename = "requestedFor", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_for: Option<IdentityRef>, - #[doc = "status of the deployment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<deployment_attempt::Status>, + #[doc = "Deployment attempt."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "ID of the deployment."] + #[serde( + rename = "deploymentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub deployment_id: Option<i32>, + #[doc = "Specifies whether deployment has started or not."] + #[serde( + rename = "hasStarted", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_started: Option<bool>, + #[doc = "ID of deployment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "All the issues related to the deployment."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub issues: Vec<Issue>, + #[doc = ""] + #[serde( + rename = "lastModifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_modified_by: Option<IdentityRef>, + #[doc = "Time when this deployment last modified."] + #[serde( + rename = "lastModifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified_on: Option<time::OffsetDateTime>, + #[doc = "Deployment operation status."] + #[serde( + rename = "operationStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_status: Option<deployment_attempt::OperationStatus>, + #[doc = ""] + #[serde( + rename = "postDeploymentGates", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_deployment_gates: Option<ReleaseGates>, + #[doc = ""] + #[serde( + rename = "preDeploymentGates", + default, + skip_serializing_if = "Option::is_none" + )] + pub pre_deployment_gates: Option<ReleaseGates>, + #[doc = "When this deployment queued on."] + #[serde( + rename = "queuedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub queued_on: Option<time::OffsetDateTime>, + #[doc = "Reason for the deployment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<deployment_attempt::Reason>, + #[doc = "List of release deployphases executed in this deployment."] + #[serde( + rename = "releaseDeployPhases", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub release_deploy_phases: Vec<ReleaseDeployPhase>, + #[doc = ""] + #[serde( + rename = "requestedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_by: Option<IdentityRef>, + #[doc = ""] + #[serde( + rename = "requestedFor", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_for: Option<IdentityRef>, + #[doc = "status of the deployment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<deployment_attempt::Status>, } impl DeploymentAttempt { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod deployment_attempt { - use super::*; - #[doc = "Deployment operation status."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum OperationStatus { - Undefined, - Queued, - Scheduled, - Pending, - Approved, - Rejected, - Deferred, - QueuedForAgent, - PhaseInProgress, - PhaseSucceeded, - PhasePartiallySucceeded, - PhaseFailed, - Canceled, - PhaseCanceled, - ManualInterventionPending, - QueuedForPipeline, - Cancelling, - EvaluatingGates, - GateFailed, - All, - } - #[doc = "Reason for the deployment."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Reason { - #[serde(rename = "none")] - None, - #[serde(rename = "manual")] - Manual, - #[serde(rename = "automated")] - Automated, - #[serde(rename = "scheduled")] - Scheduled, - #[serde(rename = "redeployTrigger")] - RedeployTrigger, - } - #[doc = "status of the deployment."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "notDeployed")] - NotDeployed, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "partiallySucceeded")] - PartiallySucceeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "Deployment operation status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum OperationStatus { + Undefined, + Queued, + Scheduled, + Pending, + Approved, + Rejected, + Deferred, + QueuedForAgent, + PhaseInProgress, + PhaseSucceeded, + PhasePartiallySucceeded, + PhaseFailed, + Canceled, + PhaseCanceled, + ManualInterventionPending, + QueuedForPipeline, + Cancelling, + EvaluatingGates, + GateFailed, + All, + } + #[doc = "Reason for the deployment."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Reason { + #[serde(rename = "none")] + None, + #[serde(rename = "manual")] + Manual, + #[serde(rename = "automated")] + Automated, + #[serde(rename = "scheduled")] + Scheduled, + #[serde(rename = "redeployTrigger")] + RedeployTrigger, + } + #[doc = "status of the deployment."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "notDeployed")] + NotDeployed, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "partiallySucceeded")] + PartiallySucceeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentAuthorizationInfo { - #[doc = "Authorization header type, typically either RevalidateApproverIdentity or OnBehalfOf."] - #[serde( - rename = "authorizationHeaderFor", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_header_for: Option<deployment_authorization_info::AuthorizationHeaderFor>, - #[doc = "List of resources."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub resources: Vec<String>, - #[doc = "ID of the tenant."] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option<String>, - #[doc = "Access token key."] - #[serde( - rename = "vstsAccessTokenKey", - default, - skip_serializing_if = "Option::is_none" - )] - pub vsts_access_token_key: Option<String>, + #[doc = "Authorization header type, typically either RevalidateApproverIdentity or OnBehalfOf."] + #[serde( + rename = "authorizationHeaderFor", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorization_header_for: Option<deployment_authorization_info::AuthorizationHeaderFor>, + #[doc = "List of resources."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub resources: Vec<String>, + #[doc = "ID of the tenant."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option<String>, + #[doc = "Access token key."] + #[serde( + rename = "vstsAccessTokenKey", + default, + skip_serializing_if = "Option::is_none" + )] + pub vsts_access_token_key: Option<String>, } impl DeploymentAuthorizationInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod deployment_authorization_info { - use super::*; - #[doc = "Authorization header type, typically either RevalidateApproverIdentity or OnBehalfOf."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AuthorizationHeaderFor { - #[serde(rename = "revalidateApproverIdentity")] - RevalidateApproverIdentity, - #[serde(rename = "onBehalfOf")] - OnBehalfOf, - } + use super::*; + #[doc = "Authorization header type, typically either RevalidateApproverIdentity or OnBehalfOf."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AuthorizationHeaderFor { + #[serde(rename = "revalidateApproverIdentity")] + RevalidateApproverIdentity, + #[serde(rename = "onBehalfOf")] + OnBehalfOf, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentCompletedEvent { - #[serde(flatten)] - pub deployment_event: DeploymentEvent, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deployment: Option<Deployment>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option<ReleaseEnvironment>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, + #[serde(flatten)] + pub deployment_event: DeploymentEvent, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deployment: Option<Deployment>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option<ReleaseEnvironment>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, } impl DeploymentCompletedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentEvent { - #[serde(flatten)] - pub release_event: ReleaseEvent, - #[serde(rename = "attemptId", default, skip_serializing_if = "Option::is_none")] - pub attempt_id: Option<i32>, - #[serde(rename = "stageName", default, skip_serializing_if = "Option::is_none")] - pub stage_name: Option<String>, + #[serde(flatten)] + pub release_event: ReleaseEvent, + #[serde(rename = "attemptId", default, skip_serializing_if = "Option::is_none")] + pub attempt_id: Option<i32>, + #[serde(rename = "stageName", default, skip_serializing_if = "Option::is_none")] + pub stage_name: Option<String>, } impl DeploymentEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentInput { - #[serde(flatten)] - pub base_deployment_input: BaseDeploymentInput, - #[doc = ""] - #[serde( - rename = "artifactsDownloadInput", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifacts_download_input: Option<ArtifactsDownloadInput>, - #[doc = "List demands that needs to meet to execute the job."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub demands: Vec<Demand>, - #[doc = "Indicates whether to include access token in deployment job or not."] - #[serde( - rename = "enableAccessToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub enable_access_token: Option<bool>, - #[doc = "Id of the pool on which job get executed."] - #[serde(rename = "queueId", default, skip_serializing_if = "Option::is_none")] - pub queue_id: Option<i32>, - #[doc = "Indicates whether artifacts downloaded while job execution or not."] - #[serde( - rename = "skipArtifactsDownload", - default, - skip_serializing_if = "Option::is_none" - )] - pub skip_artifacts_download: Option<bool>, + #[serde(flatten)] + pub base_deployment_input: BaseDeploymentInput, + #[doc = ""] + #[serde( + rename = "artifactsDownloadInput", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifacts_download_input: Option<ArtifactsDownloadInput>, + #[doc = "List demands that needs to meet to execute the job."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub demands: Vec<Demand>, + #[doc = "Indicates whether to include access token in deployment job or not."] + #[serde( + rename = "enableAccessToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub enable_access_token: Option<bool>, + #[doc = "Id of the pool on which job get executed."] + #[serde(rename = "queueId", default, skip_serializing_if = "Option::is_none")] + pub queue_id: Option<i32>, + #[doc = "Indicates whether artifacts downloaded while job execution or not."] + #[serde( + rename = "skipArtifactsDownload", + default, + skip_serializing_if = "Option::is_none" + )] + pub skip_artifacts_download: Option<bool>, } impl DeploymentInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentJob { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job: Option<ReleaseTask>, - #[doc = "List of executed tasks with in job."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tasks: Vec<ReleaseTask>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub job: Option<ReleaseTask>, + #[doc = "List of executed tasks with in job."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tasks: Vec<ReleaseTask>, } impl DeploymentJob { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Deployment>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Deployment>, } impl DeploymentList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentManualInterventionPendingEvent { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deployment: Option<Deployment>, - #[serde( - rename = "emailRecipients", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub email_recipients: Vec<String>, - #[doc = ""] - #[serde( - rename = "environmentOwner", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_owner: Option<IdentityRef>, - #[doc = ""] - #[serde( - rename = "manualIntervention", - default, - skip_serializing_if = "Option::is_none" - )] - pub manual_intervention: Option<ManualIntervention>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<Release>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deployment: Option<Deployment>, + #[serde( + rename = "emailRecipients", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub email_recipients: Vec<String>, + #[doc = ""] + #[serde( + rename = "environmentOwner", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_owner: Option<IdentityRef>, + #[doc = ""] + #[serde( + rename = "manualIntervention", + default, + skip_serializing_if = "Option::is_none" + )] + pub manual_intervention: Option<ManualIntervention>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<Release>, } impl DeploymentManualInterventionPendingEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentQueryParameters { - #[doc = "Query deployments based specified artifact source id."] - #[serde( - rename = "artifactSourceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_source_id: Option<String>, - #[doc = "Query deployments based specified artifact type id."] - #[serde( - rename = "artifactTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type_id: Option<String>, - #[doc = "Query deployments based specified artifact versions."] - #[serde( - rename = "artifactVersions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub artifact_versions: Vec<String>, - #[doc = "Query deployments number of deployments per environment."] - #[serde( - rename = "deploymentsPerEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub deployments_per_environment: Option<i32>, - #[doc = "Query deployment based on deployment status."] - #[serde( - rename = "deploymentStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub deployment_status: Option<deployment_query_parameters::DeploymentStatus>, - #[doc = "Query deployments of specified environments."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub environments: Vec<DefinitionEnvironmentReference>, - #[doc = "Query deployments based specified expands."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub expands: Option<deployment_query_parameters::Expands>, - #[doc = "Specify deleted deployments should return or not."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "Query deployment based on deployment operation status."] - #[serde( - rename = "operationStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_status: Option<deployment_query_parameters::OperationStatus>, - #[doc = "Query deployments based query type."] - #[serde(rename = "queryType", default, skip_serializing_if = "Option::is_none")] - pub query_type: Option<deployment_query_parameters::QueryType>, - #[doc = "Query deployments based specified source branch."] - #[serde( - rename = "sourceBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_branch: Option<String>, + #[doc = "Query deployments based specified artifact source id."] + #[serde( + rename = "artifactSourceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_source_id: Option<String>, + #[doc = "Query deployments based specified artifact type id."] + #[serde( + rename = "artifactTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type_id: Option<String>, + #[doc = "Query deployments based specified artifact versions."] + #[serde( + rename = "artifactVersions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub artifact_versions: Vec<String>, + #[doc = "Query deployments number of deployments per environment."] + #[serde( + rename = "deploymentsPerEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub deployments_per_environment: Option<i32>, + #[doc = "Query deployment based on deployment status."] + #[serde( + rename = "deploymentStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub deployment_status: Option<deployment_query_parameters::DeploymentStatus>, + #[doc = "Query deployments of specified environments."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub environments: Vec<DefinitionEnvironmentReference>, + #[doc = "Query deployments based specified expands."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub expands: Option<deployment_query_parameters::Expands>, + #[doc = "Specify deleted deployments should return or not."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "Query deployment based on deployment operation status."] + #[serde( + rename = "operationStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_status: Option<deployment_query_parameters::OperationStatus>, + #[doc = "Query deployments based query type."] + #[serde(rename = "queryType", default, skip_serializing_if = "Option::is_none")] + pub query_type: Option<deployment_query_parameters::QueryType>, + #[doc = "Query deployments based specified source branch."] + #[serde( + rename = "sourceBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_branch: Option<String>, } impl DeploymentQueryParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod deployment_query_parameters { - use super::*; - #[doc = "Query deployment based on deployment status."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DeploymentStatus { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "notDeployed")] - NotDeployed, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "partiallySucceeded")] - PartiallySucceeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "all")] - All, - } - #[doc = "Query deployments based specified expands."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Expands { - #[serde(rename = "all")] - All, - #[serde(rename = "deploymentOnly")] - DeploymentOnly, - #[serde(rename = "approvals")] - Approvals, - #[serde(rename = "artifacts")] - Artifacts, - } - #[doc = "Query deployment based on deployment operation status."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum OperationStatus { - Undefined, - Queued, - Scheduled, - Pending, - Approved, - Rejected, - Deferred, - QueuedForAgent, - PhaseInProgress, - PhaseSucceeded, - PhasePartiallySucceeded, - PhaseFailed, - Canceled, - PhaseCanceled, - ManualInterventionPending, - QueuedForPipeline, - Cancelling, - EvaluatingGates, - GateFailed, - All, - } - #[doc = "Query deployments based query type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum QueryType { - #[serde(rename = "regular")] - Regular, - #[serde(rename = "failingSince")] - FailingSince, - } + use super::*; + #[doc = "Query deployment based on deployment status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DeploymentStatus { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "notDeployed")] + NotDeployed, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "partiallySucceeded")] + PartiallySucceeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "all")] + All, + } + #[doc = "Query deployments based specified expands."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Expands { + #[serde(rename = "all")] + All, + #[serde(rename = "deploymentOnly")] + DeploymentOnly, + #[serde(rename = "approvals")] + Approvals, + #[serde(rename = "artifacts")] + Artifacts, + } + #[doc = "Query deployment based on deployment operation status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum OperationStatus { + Undefined, + Queued, + Scheduled, + Pending, + Approved, + Rejected, + Deferred, + QueuedForAgent, + PhaseInProgress, + PhaseSucceeded, + PhasePartiallySucceeded, + PhaseFailed, + Canceled, + PhaseCanceled, + ManualInterventionPending, + QueuedForPipeline, + Cancelling, + EvaluatingGates, + GateFailed, + All, + } + #[doc = "Query deployments based query type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum QueryType { + #[serde(rename = "regular")] + Regular, + #[serde(rename = "failingSince")] + FailingSince, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeploymentStartedEvent { - #[serde(flatten)] - pub deployment_event: DeploymentEvent, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option<ReleaseEnvironment>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<Release>, + #[serde(flatten)] + pub deployment_event: DeploymentEvent, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option<ReleaseEnvironment>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<Release>, } impl DeploymentStartedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EmailRecipients { - #[doc = "List of email addresses."] - #[serde( - rename = "emailAddresses", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub email_addresses: Vec<String>, - #[doc = "List of TFS IDs guids."] - #[serde( - rename = "tfsIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tfs_ids: Vec<String>, + #[doc = "List of email addresses."] + #[serde( + rename = "emailAddresses", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub email_addresses: Vec<String>, + #[doc = "List of TFS IDs guids."] + #[serde( + rename = "tfsIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tfs_ids: Vec<String>, } impl EmailRecipients { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines policy on environment queuing at Release Management side queue. We will send to Environment Runner [creating pre-deploy and other steps] only when the policies mentioned are satisfied."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentExecutionPolicy { - #[doc = "This policy decides, how many environments would be with Environment Runner."] - #[serde( - rename = "concurrencyCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub concurrency_count: Option<i32>, - #[doc = "Queue depth in the EnvironmentQueue table, this table keeps the environment entries till Environment Runner is free [as per it's policy] to take another environment for running."] - #[serde( - rename = "queueDepthCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub queue_depth_count: Option<i32>, + #[doc = "This policy decides, how many environments would be with Environment Runner."] + #[serde( + rename = "concurrencyCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub concurrency_count: Option<i32>, + #[doc = "Queue depth in the EnvironmentQueue table, this table keeps the environment entries till Environment Runner is free [as per it's policy] to take another environment for running."] + #[serde( + rename = "queueDepthCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub queue_depth_count: Option<i32>, } impl EnvironmentExecutionPolicy { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentOptions { - #[doc = "Gets and sets as the auto link workitems or not."] - #[serde( - rename = "autoLinkWorkItems", - default, - skip_serializing_if = "Option::is_none" - )] - pub auto_link_work_items: Option<bool>, - #[doc = "Gets and sets as the badge enabled or not."] - #[serde( - rename = "badgeEnabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub badge_enabled: Option<bool>, - #[doc = "Gets and sets as the publish deployment status or not."] - #[serde( - rename = "publishDeploymentStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub publish_deployment_status: Option<bool>, - #[doc = "Gets and sets as the.pull request deployment enabled or not."] - #[serde( - rename = "pullRequestDeploymentEnabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_deployment_enabled: Option<bool>, + #[doc = "Gets and sets as the auto link workitems or not."] + #[serde( + rename = "autoLinkWorkItems", + default, + skip_serializing_if = "Option::is_none" + )] + pub auto_link_work_items: Option<bool>, + #[doc = "Gets and sets as the badge enabled or not."] + #[serde( + rename = "badgeEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub badge_enabled: Option<bool>, + #[doc = "Gets and sets as the publish deployment status or not."] + #[serde( + rename = "publishDeploymentStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub publish_deployment_status: Option<bool>, + #[doc = "Gets and sets as the.pull request deployment enabled or not."] + #[serde( + rename = "pullRequestDeploymentEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_deployment_enabled: Option<bool>, } impl EnvironmentOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentRetentionPolicy { - #[doc = "Gets and sets the number of days to keep environment."] - #[serde( - rename = "daysToKeep", - default, - skip_serializing_if = "Option::is_none" - )] - pub days_to_keep: Option<i32>, - #[doc = "Gets and sets the number of releases to keep."] - #[serde( - rename = "releasesToKeep", - default, - skip_serializing_if = "Option::is_none" - )] - pub releases_to_keep: Option<i32>, - #[doc = "Gets and sets as the build to be retained or not."] - #[serde( - rename = "retainBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub retain_build: Option<bool>, + #[doc = "Gets and sets the number of days to keep environment."] + #[serde( + rename = "daysToKeep", + default, + skip_serializing_if = "Option::is_none" + )] + pub days_to_keep: Option<i32>, + #[doc = "Gets and sets the number of releases to keep."] + #[serde( + rename = "releasesToKeep", + default, + skip_serializing_if = "Option::is_none" + )] + pub releases_to_keep: Option<i32>, + #[doc = "Gets and sets as the build to be retained or not."] + #[serde( + rename = "retainBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub retain_build: Option<bool>, } impl EnvironmentRetentionPolicy { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentTrigger { - #[doc = "Definition environment ID on which this trigger applicable."] - #[serde( - rename = "definitionEnvironmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_environment_id: Option<i32>, - #[doc = "ReleaseDefinition ID on which this trigger applicable."] - #[serde( - rename = "releaseDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_definition_id: Option<i32>, - #[doc = "Gets or sets the trigger content."] - #[serde( - rename = "triggerContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub trigger_content: Option<String>, - #[doc = "Gets or sets the trigger type."] - #[serde( - rename = "triggerType", - default, - skip_serializing_if = "Option::is_none" - )] - pub trigger_type: Option<environment_trigger::TriggerType>, + #[doc = "Definition environment ID on which this trigger applicable."] + #[serde( + rename = "definitionEnvironmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_environment_id: Option<i32>, + #[doc = "ReleaseDefinition ID on which this trigger applicable."] + #[serde( + rename = "releaseDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_definition_id: Option<i32>, + #[doc = "Gets or sets the trigger content."] + #[serde( + rename = "triggerContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub trigger_content: Option<String>, + #[doc = "Gets or sets the trigger type."] + #[serde( + rename = "triggerType", + default, + skip_serializing_if = "Option::is_none" + )] + pub trigger_type: Option<environment_trigger::TriggerType>, } impl EnvironmentTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod environment_trigger { - use super::*; - #[doc = "Gets or sets the trigger type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TriggerType { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "deploymentGroupRedeploy")] - DeploymentGroupRedeploy, - #[serde(rename = "rollbackRedeploy")] - RollbackRedeploy, - } + use super::*; + #[doc = "Gets or sets the trigger type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum TriggerType { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "deploymentGroupRedeploy")] + DeploymentGroupRedeploy, + #[serde(rename = "rollbackRedeploy")] + RollbackRedeploy, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentTriggerContent { - #[doc = "Gets or sets action."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub action: Option<String>, - #[doc = "Gets or sets list of event types."] - #[serde( - rename = "eventTypes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub event_types: Vec<String>, + #[doc = "Gets or sets action."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub action: Option<String>, + #[doc = "Gets or sets list of event types."] + #[serde( + rename = "eventTypes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub event_types: Vec<String>, } impl EnvironmentTriggerContent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExecutionInput { - #[doc = "Parallel execution type, for example MultiConfiguration or MultiMachine."] - #[serde( - rename = "parallelExecutionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub parallel_execution_type: Option<execution_input::ParallelExecutionType>, + #[doc = "Parallel execution type, for example MultiConfiguration or MultiMachine."] + #[serde( + rename = "parallelExecutionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub parallel_execution_type: Option<execution_input::ParallelExecutionType>, } impl ExecutionInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod execution_input { - use super::*; - #[doc = "Parallel execution type, for example MultiConfiguration or MultiMachine."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ParallelExecutionType { - #[serde(rename = "none")] - None, - #[serde(rename = "multiConfiguration")] - MultiConfiguration, - #[serde(rename = "multiMachine")] - MultiMachine, - } + use super::*; + #[doc = "Parallel execution type, for example MultiConfiguration or MultiMachine."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ParallelExecutionType { + #[serde(rename = "none")] + None, + #[serde(rename = "multiConfiguration")] + MultiConfiguration, + #[serde(rename = "multiMachine")] + MultiMachine, + } } #[doc = "Class to represent favorite entry."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FavoriteItem { - #[doc = "Application specific data for the entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<String>, - #[doc = "Unique Id of the entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Display text for favorite entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Application specific favorite entry type. Empty or Null represents that Favorite item is a Folder."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Application specific data for the entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<String>, + #[doc = "Unique Id of the the entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Display text for favorite entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Application specific favorite entry type. Empty or Null represents that Favorite item is a Folder."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl FavoriteItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Folder { - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Time when this folder created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Description of the folder."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = ""] - #[serde( - rename = "lastChangedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_changed_by: Option<IdentityRef>, - #[doc = "Time when this folder last changed."] - #[serde( - rename = "lastChangedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_changed_date: Option<time::OffsetDateTime>, - #[doc = "path of the folder."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "Time when this folder created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Description of the folder."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = ""] + #[serde( + rename = "lastChangedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_changed_by: Option<IdentityRef>, + #[doc = "Time when this folder last changed."] + #[serde( + rename = "lastChangedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_changed_date: Option<time::OffsetDateTime>, + #[doc = "path of the folder."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl Folder { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FolderList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Folder>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Folder>, } impl FolderList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GateUpdateMetadata { - #[doc = "Comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Name of gate to be ignored."] - #[serde( - rename = "gatesToIgnore", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub gates_to_ignore: Vec<String>, + #[doc = "Comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Name of gate to be ignored."] + #[serde( + rename = "gatesToIgnore", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub gates_to_ignore: Vec<String>, } impl GateUpdateMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GatesDeployPhase { - #[serde(flatten)] - pub deploy_phase: DeployPhase, - #[doc = ""] - #[serde( - rename = "deploymentInput", - default, - skip_serializing_if = "Option::is_none" - )] - pub deployment_input: Option<GatesDeploymentInput>, + #[serde(flatten)] + pub deploy_phase: DeployPhase, + #[doc = ""] + #[serde( + rename = "deploymentInput", + default, + skip_serializing_if = "Option::is_none" + )] + pub deployment_input: Option<GatesDeploymentInput>, } impl GatesDeployPhase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GatesDeploymentInput { - #[serde(flatten)] - pub base_deployment_input: BaseDeploymentInput, - #[doc = "Gates minimum success duration."] - #[serde( - rename = "minimumSuccessDuration", - default, - skip_serializing_if = "Option::is_none" - )] - pub minimum_success_duration: Option<i32>, - #[doc = "Gates sampling interval."] - #[serde( - rename = "samplingInterval", - default, - skip_serializing_if = "Option::is_none" - )] - pub sampling_interval: Option<i32>, - #[doc = "Gates stabilization time."] - #[serde( - rename = "stabilizationTime", - default, - skip_serializing_if = "Option::is_none" - )] - pub stabilization_time: Option<i32>, + #[serde(flatten)] + pub base_deployment_input: BaseDeploymentInput, + #[doc = "Gates minimum success duration."] + #[serde( + rename = "minimumSuccessDuration", + default, + skip_serializing_if = "Option::is_none" + )] + pub minimum_success_duration: Option<i32>, + #[doc = "Gates sampling interval."] + #[serde( + rename = "samplingInterval", + default, + skip_serializing_if = "Option::is_none" + )] + pub sampling_interval: Option<i32>, + #[doc = "Gates stabilization time."] + #[serde( + rename = "stabilizationTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub stabilization_time: Option<i32>, } impl GatesDeploymentInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitArtifactDownloadInput { - #[serde(flatten)] - pub artifact_download_input_base: ArtifactDownloadInputBase, + #[serde(flatten)] + pub artifact_download_input_base: ArtifactDownloadInputBase, } impl GitArtifactDownloadInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitHubArtifactDownloadInput { - #[serde(flatten)] - pub artifact_download_input_base: ArtifactDownloadInputBase, + #[serde(flatten)] + pub artifact_download_input_base: ArtifactDownloadInputBase, } impl GitHubArtifactDownloadInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IgnoredGate { - #[doc = "Gets the date on which gate is last ignored."] - #[serde( - rename = "lastModifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified_on: Option<time::OffsetDateTime>, - #[doc = "Name of gate ignored."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Gets the date on which gate is last ignored."] + #[serde( + rename = "lastModifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified_on: Option<time::OffsetDateTime>, + #[doc = "Name of gate ignored."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl IgnoredGate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes an input for subscriptions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputDescriptor { - #[doc = "The ids of all inputs that the value of this input is dependent on."] - #[serde( - rename = "dependencyInputIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dependency_input_ids: Vec<String>, - #[doc = "Description of what this input is used for"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group."] - #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] - pub group_name: Option<String>, - #[doc = "If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change."] - #[serde( - rename = "hasDynamicValueInformation", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_dynamic_value_information: Option<bool>, - #[doc = "Identifier for the subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Mode in which the value of this input should be entered"] - #[serde(rename = "inputMode", default, skip_serializing_if = "Option::is_none")] - pub input_mode: Option<input_descriptor::InputMode>, - #[doc = "Gets whether this input is confidential, such as for a password or application key"] - #[serde( - rename = "isConfidential", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_confidential: Option<bool>, - #[doc = "Localized name which can be shown as a label for the subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Custom properties for the input which can be used by the service provider"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "Gets whether this input is included in the default generated action description."] - #[serde( - rename = "useInDefaultDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub use_in_default_description: Option<bool>, - #[doc = "Describes what values are valid for a subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub validation: Option<InputValidation>, - #[doc = "A hint for input value. It can be used in the UI as the input placeholder."] - #[serde(rename = "valueHint", default, skip_serializing_if = "Option::is_none")] - pub value_hint: Option<String>, - #[doc = "Information about the possible/allowed values for a given subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub values: Option<InputValues>, + #[doc = "The ids of all inputs that the value of this input is dependent on."] + #[serde( + rename = "dependencyInputIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dependency_input_ids: Vec<String>, + #[doc = "Description of what this input is used for"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group."] + #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] + pub group_name: Option<String>, + #[doc = "If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change."] + #[serde( + rename = "hasDynamicValueInformation", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_dynamic_value_information: Option<bool>, + #[doc = "Identifier for the subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Mode in which the value of this input should be entered"] + #[serde(rename = "inputMode", default, skip_serializing_if = "Option::is_none")] + pub input_mode: Option<input_descriptor::InputMode>, + #[doc = "Gets whether this input is confidential, such as for a password or application key"] + #[serde( + rename = "isConfidential", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_confidential: Option<bool>, + #[doc = "Localized name which can be shown as a label for the subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Custom properties for the input which can be used by the service provider"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "Gets whether this input is included in the default generated action description."] + #[serde( + rename = "useInDefaultDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub use_in_default_description: Option<bool>, + #[doc = "Describes what values are valid for a subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub validation: Option<InputValidation>, + #[doc = "A hint for input value. It can be used in the UI as the input placeholder."] + #[serde(rename = "valueHint", default, skip_serializing_if = "Option::is_none")] + pub value_hint: Option<String>, + #[doc = "Information about the possible/allowed values for a given subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option<InputValues>, } impl InputDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod input_descriptor { - use super::*; - #[doc = "Mode in which the value of this input should be entered"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum InputMode { - #[serde(rename = "none")] - None, - #[serde(rename = "textBox")] - TextBox, - #[serde(rename = "passwordBox")] - PasswordBox, - #[serde(rename = "combo")] - Combo, - #[serde(rename = "radioButtons")] - RadioButtons, - #[serde(rename = "checkBox")] - CheckBox, - #[serde(rename = "textArea")] - TextArea, - } + use super::*; + #[doc = "Mode in which the value of this input should be entered"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum InputMode { + #[serde(rename = "none")] + None, + #[serde(rename = "textBox")] + TextBox, + #[serde(rename = "passwordBox")] + PasswordBox, + #[serde(rename = "combo")] + Combo, + #[serde(rename = "radioButtons")] + RadioButtons, + #[serde(rename = "checkBox")] + CheckBox, + #[serde(rename = "textArea")] + TextArea, + } } #[doc = "Describes what values are valid for a subscription input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValidation { - #[doc = "Gets or sets the data type to validate."] - #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] - pub data_type: Option<input_validation::DataType>, - #[doc = "Gets or sets if this is a required field."] - #[serde( - rename = "isRequired", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_required: Option<bool>, - #[doc = "Gets or sets the maximum length of this descriptor."] - #[serde(rename = "maxLength", default, skip_serializing_if = "Option::is_none")] - pub max_length: Option<i32>, - #[doc = "Gets or sets the minimum value for this descriptor."] - #[serde(rename = "maxValue", default, skip_serializing_if = "Option::is_none")] - pub max_value: Option<String>, - #[doc = "Gets or sets the minimum length of this descriptor."] - #[serde(rename = "minLength", default, skip_serializing_if = "Option::is_none")] - pub min_length: Option<i32>, - #[doc = "Gets or sets the minimum value for this descriptor."] - #[serde(rename = "minValue", default, skip_serializing_if = "Option::is_none")] - pub min_value: Option<String>, - #[doc = "Gets or sets the pattern to validate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pattern: Option<String>, - #[doc = "Gets or sets the error on pattern mismatch."] - #[serde( - rename = "patternMismatchErrorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub pattern_mismatch_error_message: Option<String>, + #[doc = "Gets or sets the data data type to validate."] + #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] + pub data_type: Option<input_validation::DataType>, + #[doc = "Gets or sets if this is a required field."] + #[serde( + rename = "isRequired", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_required: Option<bool>, + #[doc = "Gets or sets the maximum length of this descriptor."] + #[serde(rename = "maxLength", default, skip_serializing_if = "Option::is_none")] + pub max_length: Option<i32>, + #[doc = "Gets or sets the minimum value for this descriptor."] + #[serde(rename = "maxValue", default, skip_serializing_if = "Option::is_none")] + pub max_value: Option<String>, + #[doc = "Gets or sets the minimum length of this descriptor."] + #[serde(rename = "minLength", default, skip_serializing_if = "Option::is_none")] + pub min_length: Option<i32>, + #[doc = "Gets or sets the minimum value for this descriptor."] + #[serde(rename = "minValue", default, skip_serializing_if = "Option::is_none")] + pub min_value: Option<String>, + #[doc = "Gets or sets the pattern to validate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pattern: Option<String>, + #[doc = "Gets or sets the error on pattern mismatch."] + #[serde( + rename = "patternMismatchErrorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub pattern_mismatch_error_message: Option<String>, } impl InputValidation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod input_validation { - use super::*; - #[doc = "Gets or sets the data type to validate."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DataType { - #[serde(rename = "none")] - None, - #[serde(rename = "string")] - String, - #[serde(rename = "number")] - Number, - #[serde(rename = "boolean")] - Boolean, - #[serde(rename = "guid")] - Guid, - #[serde(rename = "uri")] - Uri, - } + use super::*; + #[doc = "Gets or sets the data data type to validate."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DataType { + #[serde(rename = "none")] + None, + #[serde(rename = "string")] + String, + #[serde(rename = "number")] + Number, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "guid")] + Guid, + #[serde(rename = "uri")] + Uri, + } } #[doc = "Information about a single value for an input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValue { - #[doc = "Any other data about this input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "The text to show for the display of this value"] - #[serde( - rename = "displayValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_value: Option<String>, - #[doc = "The value to store for this input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Any other data about this input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "The text to show for the display of this value"] + #[serde( + rename = "displayValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_value: Option<String>, + #[doc = "The value to store for this input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl InputValue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Information about the possible/allowed values for a given subscription input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValues { - #[doc = "The default value to use for this input"] - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<String>, - #[doc = "Error information related to a subscription input value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option<InputValuesError>, - #[doc = "The id of the input"] - #[serde(rename = "inputId", default, skip_serializing_if = "Option::is_none")] - pub input_id: Option<String>, - #[doc = "Should this input be disabled"] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False)"] - #[serde( - rename = "isLimitedToPossibleValues", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_limited_to_possible_values: Option<bool>, - #[doc = "Should this input be made read-only"] - #[serde( - rename = "isReadOnly", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_read_only: Option<bool>, - #[doc = "Possible values that this input can take"] - #[serde( - rename = "possibleValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub possible_values: Vec<InputValue>, + #[doc = "The default value to use for this input"] + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<String>, + #[doc = "Error information related to a subscription input value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option<InputValuesError>, + #[doc = "The id of the input"] + #[serde(rename = "inputId", default, skip_serializing_if = "Option::is_none")] + pub input_id: Option<String>, + #[doc = "Should this input be disabled"] + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[doc = "Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False)"] + #[serde( + rename = "isLimitedToPossibleValues", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_limited_to_possible_values: Option<bool>, + #[doc = "Should this input be made read-only"] + #[serde( + rename = "isReadOnly", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_read_only: Option<bool>, + #[doc = "Possible values that this input can take"] + #[serde( + rename = "possibleValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub possible_values: Vec<InputValue>, } impl InputValues { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Error information related to a subscription input value."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValuesError { - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, } impl InputValuesError { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValuesQuery { - #[serde( - rename = "currentValues", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_values: Option<serde_json::Value>, - #[doc = "The input values to return on input, and the result from the consumer on output."] - #[serde( - rename = "inputValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_values: Vec<InputValues>, - #[doc = "Subscription containing information about the publisher/consumer and the current input values"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option<serde_json::Value>, + #[serde( + rename = "currentValues", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_values: Option<serde_json::Value>, + #[doc = "The input values to return on input, and the result from the consumer on output."] + #[serde( + rename = "inputValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_values: Vec<InputValues>, + #[doc = "Subscription containing information about the publisher/consumer and the current input values"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option<serde_json::Value>, } impl InputValuesQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Issue { - #[doc = "Issue data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "Issue type, for example error, warning or info."] - #[serde(rename = "issueType", default, skip_serializing_if = "Option::is_none")] - pub issue_type: Option<String>, - #[doc = "Issue message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, + #[doc = "Issue data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "Issue type, for example error, warning or info."] + #[serde(rename = "issueType", default, skip_serializing_if = "Option::is_none")] + pub issue_type: Option<String>, + #[doc = "Issue message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, } impl Issue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JenkinsArtifactDownloadInput { - #[serde(flatten)] - pub artifact_download_input_base: ArtifactDownloadInputBase, + #[serde(flatten)] + pub artifact_download_input_base: ArtifactDownloadInputBase, } impl JenkinsArtifactDownloadInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MachineGroupBasedDeployPhase { - #[serde(flatten)] - pub deploy_phase: DeployPhase, - #[doc = ""] - #[serde( - rename = "deploymentInput", - default, - skip_serializing_if = "Option::is_none" - )] - pub deployment_input: Option<MachineGroupDeploymentInput>, + #[serde(flatten)] + pub deploy_phase: DeployPhase, + #[doc = ""] + #[serde( + rename = "deploymentInput", + default, + skip_serializing_if = "Option::is_none" + )] + pub deployment_input: Option<MachineGroupDeploymentInput>, } impl MachineGroupBasedDeployPhase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MachineGroupDeploymentInput { - #[serde(flatten)] - pub deployment_input: DeploymentInput, - #[doc = "Deployment group health option."] - #[serde( - rename = "deploymentHealthOption", - default, - skip_serializing_if = "Option::is_none" - )] - pub deployment_health_option: Option<String>, - #[doc = "Minimum percentage of the targets guaranteed to be healthy."] - #[serde( - rename = "healthPercent", - default, - skip_serializing_if = "Option::is_none" - )] - pub health_percent: Option<i32>, - #[doc = "Deployment target tag filter."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, + #[serde(flatten)] + pub deployment_input: DeploymentInput, + #[doc = "Deployment group health option."] + #[serde( + rename = "deploymentHealthOption", + default, + skip_serializing_if = "Option::is_none" + )] + pub deployment_health_option: Option<String>, + #[doc = "Minimum percentage of the targets guaranteed to be healthy."] + #[serde( + rename = "healthPercent", + default, + skip_serializing_if = "Option::is_none" + )] + pub health_percent: Option<i32>, + #[doc = "Deployment target tag filter."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, } impl MachineGroupDeploymentInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MailMessage { - #[doc = "Body of mail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub body: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cc: Option<EmailRecipients>, - #[doc = "Reply to."] - #[serde(rename = "inReplyTo", default, skip_serializing_if = "Option::is_none")] - pub in_reply_to: Option<String>, - #[doc = "Message ID of the mail."] - #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")] - pub message_id: Option<String>, - #[doc = "Data when should be replied to mail."] - #[serde( - rename = "replyBy", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub reply_by: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde(rename = "replyTo", default, skip_serializing_if = "Option::is_none")] - pub reply_to: Option<EmailRecipients>, - #[doc = "List of mail section types."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub sections: Vec<serde_json::Value>, - #[doc = "Mail sender type."] - #[serde( - rename = "senderType", - default, - skip_serializing_if = "Option::is_none" - )] - pub sender_type: Option<mail_message::SenderType>, - #[doc = "Subject of the mail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subject: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub to: Option<EmailRecipients>, + #[doc = "Body of mail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub body: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cc: Option<EmailRecipients>, + #[doc = "Reply to."] + #[serde(rename = "inReplyTo", default, skip_serializing_if = "Option::is_none")] + pub in_reply_to: Option<String>, + #[doc = "Message ID of the mail."] + #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")] + pub message_id: Option<String>, + #[doc = "Data when should be replied to mail."] + #[serde( + rename = "replyBy", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub reply_by: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(rename = "replyTo", default, skip_serializing_if = "Option::is_none")] + pub reply_to: Option<EmailRecipients>, + #[doc = "List of mail section types."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub sections: Vec<serde_json::Value>, + #[doc = "Mail sender type."] + #[serde( + rename = "senderType", + default, + skip_serializing_if = "Option::is_none" + )] + pub sender_type: Option<mail_message::SenderType>, + #[doc = "Subject of the mail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subject: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub to: Option<EmailRecipients>, } impl MailMessage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod mail_message { - use super::*; - #[doc = "Mail sender type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SenderType { - #[serde(rename = "serviceAccount")] - ServiceAccount, - #[serde(rename = "requestingUser")] - RequestingUser, - } + use super::*; + #[doc = "Mail sender type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SenderType { + #[serde(rename = "serviceAccount")] + ServiceAccount, + #[serde(rename = "requestingUser")] + RequestingUser, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ManualIntervention { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub approver: Option<IdentityRef>, - #[doc = "Gets or sets comments for approval."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comments: Option<String>, - #[doc = "Gets date on which it got created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Gets the unique identifier for manual intervention."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Gets or sets instructions for approval."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub instructions: Option<String>, - #[doc = "Gets date on which it got modified."] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Gets or sets the name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ReleaseShallowReference>, - #[doc = ""] - #[serde( - rename = "releaseDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_definition: Option<ReleaseDefinitionShallowReference>, - #[doc = ""] - #[serde( - rename = "releaseEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment: Option<ReleaseEnvironmentShallowReference>, - #[doc = "Gets or sets the status of the manual intervention."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<manual_intervention::Status>, - #[doc = "Get task instance identifier."] - #[serde( - rename = "taskInstanceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub task_instance_id: Option<String>, - #[doc = "Gets url to access the manual intervention."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub approver: Option<IdentityRef>, + #[doc = "Gets or sets comments for approval."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comments: Option<String>, + #[doc = "Gets date on which it got created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Gets the unique identifier for manual intervention."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Gets or sets instructions for approval."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub instructions: Option<String>, + #[doc = "Gets date on which it got modified."] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Gets or sets the name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ReleaseShallowReference>, + #[doc = ""] + #[serde( + rename = "releaseDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_definition: Option<ReleaseDefinitionShallowReference>, + #[doc = ""] + #[serde( + rename = "releaseEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment: Option<ReleaseEnvironmentShallowReference>, + #[doc = "Gets or sets the status of the manual intervention."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<manual_intervention::Status>, + #[doc = "Get task instance identifier."] + #[serde( + rename = "taskInstanceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub task_instance_id: Option<String>, + #[doc = "Gets url to access the manual intervention."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ManualIntervention { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod manual_intervention { - use super::*; - #[doc = "Gets or sets the status of the manual intervention."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "approved")] - Approved, - #[serde(rename = "canceled")] - Canceled, - } + use super::*; + #[doc = "Gets or sets the status of the manual intervention."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "canceled")] + Canceled, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ManualInterventionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ManualIntervention>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ManualIntervention>, } impl ManualInterventionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ManualInterventionUpdateMetadata { - #[doc = "Sets the comment for manual intervention update."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Sets the status of the manual intervention."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<manual_intervention_update_metadata::Status>, + #[doc = "Sets the comment for manual intervention update."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Sets the status of the manual intervention."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<manual_intervention_update_metadata::Status>, } impl ManualInterventionUpdateMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod manual_intervention_update_metadata { - use super::*; - #[doc = "Sets the status of the manual intervention."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "approved")] - Approved, - #[serde(rename = "canceled")] - Canceled, - } + use super::*; + #[doc = "Sets the status of the manual intervention."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "canceled")] + Canceled, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MappingDetails { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mappings: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mappings: Option<serde_json::Value>, } impl MappingDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Metric { - #[doc = "Name of the Metric."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Value of the Metric."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<i32>, + #[doc = "Name of the Metric."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Value of the Metric."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<i32>, } impl Metric { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MultiConfigInput { - #[serde(flatten)] - pub parallel_execution_input_base: ParallelExecutionInputBase, - #[doc = "Multipliers for parallel execution of deployment, for example x86,x64."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub multipliers: Option<String>, + #[serde(flatten)] + pub parallel_execution_input_base: ParallelExecutionInputBase, + #[doc = "Multipliers for parallel execution of deployment, for example x86,x64."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub multipliers: Option<String>, } impl MultiConfigInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MultiMachineInput { - #[serde(flatten)] - pub parallel_execution_input_base: ParallelExecutionInputBase, + #[serde(flatten)] + pub parallel_execution_input_base: ParallelExecutionInputBase, } impl MultiMachineInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OrgPipelineReleaseSettings { - #[doc = "Defines whether user can manage pipeline settings."] - #[serde( - rename = "hasManagePipelinePoliciesPermission", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_manage_pipeline_policies_permission: Option<bool>, - #[doc = "EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project."] - #[serde( - rename = "orgEnforceJobAuthScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub org_enforce_job_auth_scope: Option<bool>, + #[doc = "Defines whether user can manage pipeline settings."] + #[serde( + rename = "hasManagePipelinePoliciesPermission", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_manage_pipeline_policies_permission: Option<bool>, + #[doc = "EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project."] + #[serde( + rename = "orgEnforceJobAuthScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub org_enforce_job_auth_scope: Option<bool>, } impl OrgPipelineReleaseSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OrgPipelineReleaseSettingsUpdateParameters { - #[doc = "EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project."] - #[serde( - rename = "orgEnforceJobAuthScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub org_enforce_job_auth_scope: Option<bool>, + #[doc = "EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project."] + #[serde( + rename = "orgEnforceJobAuthScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub org_enforce_job_auth_scope: Option<bool>, } impl OrgPipelineReleaseSettingsUpdateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageTrigger { - #[serde(flatten)] - pub release_trigger_base: ReleaseTriggerBase, - #[doc = "Package trigger alias."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub alias: Option<String>, + #[serde(flatten)] + pub release_trigger_base: ReleaseTriggerBase, + #[doc = "Package trigger alias."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, } impl PackageTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ParallelExecutionInputBase { - #[serde(flatten)] - pub execution_input: ExecutionInput, - #[doc = "Indicate whether continue execution of deployment on error or not."] - #[serde( - rename = "continueOnError", - default, - skip_serializing_if = "Option::is_none" - )] - pub continue_on_error: Option<bool>, - #[doc = "Maximum number of agents used while parallel execution."] - #[serde( - rename = "maxNumberOfAgents", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_number_of_agents: Option<i32>, + #[serde(flatten)] + pub execution_input: ExecutionInput, + #[doc = "Indicate whether continue execution of deployment on error or not."] + #[serde( + rename = "continueOnError", + default, + skip_serializing_if = "Option::is_none" + )] + pub continue_on_error: Option<bool>, + #[doc = "Maximum number of agents used while parallel execution."] + #[serde( + rename = "maxNumberOfAgents", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_number_of_agents: Option<i32>, } impl ParallelExecutionInputBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelineProcess { - #[doc = "Pipeline process type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<pipeline_process::Type>, + #[doc = "Pipeline process type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<pipeline_process::Type>, } impl PipelineProcess { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod pipeline_process { - use super::*; - #[doc = "Pipeline process type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "designer")] - Designer, - #[serde(rename = "yaml")] - Yaml, - } + use super::*; + #[doc = "Pipeline process type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "designer")] + Designer, + #[serde(rename = "yaml")] + Yaml, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessParameters { - #[serde( - rename = "dataSourceBindings", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub data_source_bindings: Vec<DataSourceBindingBase>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub inputs: Vec<TaskInputDefinitionBase>, - #[serde( - rename = "sourceDefinitions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub source_definitions: Vec<TaskSourceDefinitionBase>, + #[serde( + rename = "dataSourceBindings", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub data_source_bindings: Vec<DataSourceBindingBase>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub inputs: Vec<TaskInputDefinitionBase>, + #[serde( + rename = "sourceDefinitions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub source_definitions: Vec<TaskSourceDefinitionBase>, } impl ProcessParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectPipelineReleaseSettings { - #[doc = "EnforceJobAuthScope setting at project level. If enabled, scope of access for all release pipelines reduces to the current project."] - #[serde( - rename = "enforceJobAuthScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub enforce_job_auth_scope: Option<bool>, - #[doc = "Defines whether user can manage pipeline settings."] - #[serde( - rename = "hasManageSettingsPermission", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_manage_settings_permission: Option<bool>, - #[doc = "EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project."] - #[serde( - rename = "orgEnforceJobAuthScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub org_enforce_job_auth_scope: Option<bool>, - #[doc = "Defines whether project is public."] - #[serde( - rename = "publicProject", - default, - skip_serializing_if = "Option::is_none" - )] - pub public_project: Option<bool>, + #[doc = "EnforceJobAuthScope setting at project level. If enabled, scope of access for all release pipelines reduces to the current project."] + #[serde( + rename = "enforceJobAuthScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub enforce_job_auth_scope: Option<bool>, + #[doc = "Defines whether user can manage pipeline settings."] + #[serde( + rename = "hasManageSettingsPermission", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_manage_settings_permission: Option<bool>, + #[doc = "EnforceJobAuthScope setting at organisaion level. If enabled, scope of access for all release pipelines in the organisation reduces to the current project."] + #[serde( + rename = "orgEnforceJobAuthScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub org_enforce_job_auth_scope: Option<bool>, + #[doc = "Defines whether project is public."] + #[serde( + rename = "publicProject", + default, + skip_serializing_if = "Option::is_none" + )] + pub public_project: Option<bool>, } impl ProjectPipelineReleaseSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectPipelineReleaseSettingsUpdateParameters { - #[doc = "EnforceJobAuthScope setting at project level. If enabled, scope of access for all release pipelines reduces to the current project."] - #[serde( - rename = "enforceJobAuthScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub enforce_job_auth_scope: Option<bool>, + #[doc = "EnforceJobAuthScope setting at project level. If enabled, scope of access for all release pipelines reduces to the current project."] + #[serde( + rename = "enforceJobAuthScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub enforce_job_auth_scope: Option<bool>, } impl ProjectPipelineReleaseSettingsUpdateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectReference { - #[doc = "Gets the unique identifier of this field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Gets name of project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Gets the unique identifier of this field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Gets name of project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ProjectReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PropertiesCollection { - #[doc = "The count of properties in the collection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<serde_json::Value>, - #[doc = "The set of keys in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub keys: Vec<String>, - #[doc = "The set of values in the collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<String>, + #[doc = "The count of properties in the collection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<serde_json::Value>, + #[doc = "The set of keys in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub keys: Vec<String>, + #[doc = "The set of values in the collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<String>, } impl PropertiesCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PropertySelector { - #[doc = "List of properties."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub properties: Vec<String>, - #[doc = "Property selector type."] - #[serde( - rename = "selectorType", - default, - skip_serializing_if = "Option::is_none" - )] - pub selector_type: Option<property_selector::SelectorType>, + #[doc = "List of properties."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub properties: Vec<String>, + #[doc = "Property selector type."] + #[serde( + rename = "selectorType", + default, + skip_serializing_if = "Option::is_none" + )] + pub selector_type: Option<property_selector::SelectorType>, } impl PropertySelector { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod property_selector { - use super::*; - #[doc = "Property selector type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SelectorType { - #[serde(rename = "inclusion")] - Inclusion, - #[serde(rename = "exclusion")] - Exclusion, - } + use super::*; + #[doc = "Property selector type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SelectorType { + #[serde(rename = "inclusion")] + Inclusion, + #[serde(rename = "exclusion")] + Exclusion, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PullRequestConfiguration { - #[doc = ""] - #[serde( - rename = "codeRepositoryReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub code_repository_reference: Option<CodeRepositoryReference>, - #[doc = "In case of Source based artifacts, Code reference will be present in Artifact details."] - #[serde( - rename = "useArtifactReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub use_artifact_reference: Option<bool>, + #[doc = ""] + #[serde( + rename = "codeRepositoryReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub code_repository_reference: Option<CodeRepositoryReference>, + #[doc = "In case of Source based artifacts, Code reference will be present in Artifact details."] + #[serde( + rename = "useArtifactReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub use_artifact_reference: Option<bool>, } impl PullRequestConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PullRequestFilter { - #[doc = "List of tags."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[doc = "Target branch of pull request."] - #[serde( - rename = "targetBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_branch: Option<String>, + #[doc = "List of tags."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[doc = "Target branch of pull request."] + #[serde( + rename = "targetBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_branch: Option<String>, } impl PullRequestFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PullRequestTrigger { - #[serde(flatten)] - pub release_trigger_base: ReleaseTriggerBase, - #[doc = "Artifact alias trigger is linked to."] - #[serde( - rename = "artifactAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_alias: Option<String>, - #[doc = ""] - #[serde( - rename = "pullRequestConfiguration", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_configuration: Option<PullRequestConfiguration>, - #[doc = "Policy name using which status will be published to pull request."] - #[serde( - rename = "statusPolicyName", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_policy_name: Option<String>, - #[doc = "List of filters applied while trigger."] - #[serde( - rename = "triggerConditions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub trigger_conditions: Vec<PullRequestFilter>, + #[serde(flatten)] + pub release_trigger_base: ReleaseTriggerBase, + #[doc = "Artifact alias trigger is linked to."] + #[serde( + rename = "artifactAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_alias: Option<String>, + #[doc = ""] + #[serde( + rename = "pullRequestConfiguration", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_configuration: Option<PullRequestConfiguration>, + #[doc = "Policy name using which status will be published to pull request."] + #[serde( + rename = "statusPolicyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_policy_name: Option<String>, + #[doc = "List of filters applied while trigger."] + #[serde( + rename = "triggerConditions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub trigger_conditions: Vec<PullRequestFilter>, } impl PullRequestTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueuedReleaseData { - #[doc = "Project ID of the release."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "Release queue position."] - #[serde( - rename = "queuePosition", - default, - skip_serializing_if = "Option::is_none" - )] - pub queue_position: Option<i32>, - #[doc = "Queued release ID."] - #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] - pub release_id: Option<i32>, + #[doc = "Project ID of the release."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "Release queue position."] + #[serde( + rename = "queuePosition", + default, + skip_serializing_if = "Option::is_none" + )] + pub queue_position: Option<i32>, + #[doc = "Queued release ID."] + #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] + pub release_id: Option<i32>, } impl QueuedReleaseData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RealtimeReleaseDefinitionEvent { - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, } impl RealtimeReleaseDefinitionEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RealtimeReleaseEvent { - #[serde( - rename = "environmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_id: Option<i32>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] - pub release_id: Option<i32>, + #[serde( + rename = "environmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_id: Option<i32>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] + pub release_id: Option<i32>, } impl RealtimeReleaseEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Release { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Gets or sets the list of artifacts."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub artifacts: Vec<Artifact>, - #[doc = "Gets or sets comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = ""] - #[serde( - rename = "createdFor", - default, - skip_serializing_if = "Option::is_none" - )] - pub created_for: Option<IdentityRef>, - #[doc = "Gets date on which it got created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Gets revision number of definition snapshot."] - #[serde( - rename = "definitionSnapshotRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_snapshot_revision: Option<i32>, - #[doc = "Gets or sets description of release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Gets list of environments."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub environments: Vec<ReleaseEnvironment>, - #[doc = "Gets the unique identifier of this field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Whether to exclude the release from retention policies."] - #[serde( - rename = "keepForever", - default, - skip_serializing_if = "Option::is_none" - )] - pub keep_forever: Option<bool>, - #[doc = "Gets logs container url."] - #[serde( - rename = "logsContainerUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub logs_container_url: Option<String>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "Gets date on which it got modified."] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Gets name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets pool name."] - #[serde(rename = "poolName", default, skip_serializing_if = "Option::is_none")] - pub pool_name: Option<String>, - #[doc = ""] - #[serde( - rename = "projectReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_reference: Option<ProjectReference>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "Gets reason of release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<release::Reason>, - #[doc = ""] - #[serde( - rename = "releaseDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_definition: Option<ReleaseDefinitionShallowReference>, - #[doc = "Gets or sets the release definition revision."] - #[serde( - rename = "releaseDefinitionRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_definition_revision: Option<i32>, - #[doc = "Gets release name format."] - #[serde( - rename = "releaseNameFormat", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_name_format: Option<String>, - #[doc = "Gets status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<release::Status>, - #[doc = "Gets or sets list of tags."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[serde( - rename = "triggeringArtifactAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub triggering_artifact_alias: Option<String>, - #[doc = "Gets the list of variable groups."] - #[serde( - rename = "variableGroups", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub variable_groups: Vec<VariableGroup>, - #[doc = "Gets or sets the dictionary of variables."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Gets or sets the list of artifacts."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub artifacts: Vec<Artifact>, + #[doc = "Gets or sets comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = ""] + #[serde( + rename = "createdFor", + default, + skip_serializing_if = "Option::is_none" + )] + pub created_for: Option<IdentityRef>, + #[doc = "Gets date on which it got created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Gets revision number of definition snapshot."] + #[serde( + rename = "definitionSnapshotRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_snapshot_revision: Option<i32>, + #[doc = "Gets or sets description of release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Gets list of environments."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub environments: Vec<ReleaseEnvironment>, + #[doc = "Gets the unique identifier of this field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Whether to exclude the release from retention policies."] + #[serde( + rename = "keepForever", + default, + skip_serializing_if = "Option::is_none" + )] + pub keep_forever: Option<bool>, + #[doc = "Gets logs container url."] + #[serde( + rename = "logsContainerUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub logs_container_url: Option<String>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "Gets date on which it got modified."] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Gets name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets pool name."] + #[serde(rename = "poolName", default, skip_serializing_if = "Option::is_none")] + pub pool_name: Option<String>, + #[doc = ""] + #[serde( + rename = "projectReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_reference: Option<ProjectReference>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "Gets reason of release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<release::Reason>, + #[doc = ""] + #[serde( + rename = "releaseDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_definition: Option<ReleaseDefinitionShallowReference>, + #[doc = "Gets or sets the release definition revision."] + #[serde( + rename = "releaseDefinitionRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_definition_revision: Option<i32>, + #[doc = "Gets release name format."] + #[serde( + rename = "releaseNameFormat", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_name_format: Option<String>, + #[doc = "Gets status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<release::Status>, + #[doc = "Gets or sets list of tags."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[serde( + rename = "triggeringArtifactAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub triggering_artifact_alias: Option<String>, + #[doc = "Gets the list of variable groups."] + #[serde( + rename = "variableGroups", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub variable_groups: Vec<VariableGroup>, + #[doc = "Gets or sets the dictionary of variables."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl Release { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release { - use super::*; - #[doc = "Gets reason of release."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Reason { - #[serde(rename = "none")] - None, - #[serde(rename = "manual")] - Manual, - #[serde(rename = "continuousIntegration")] - ContinuousIntegration, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "pullRequest")] - PullRequest, - } - #[doc = "Gets status."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "draft")] - Draft, - #[serde(rename = "active")] - Active, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[doc = "Gets reason of release."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Reason { + #[serde(rename = "none")] + None, + #[serde(rename = "manual")] + Manual, + #[serde(rename = "continuousIntegration")] + ContinuousIntegration, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "pullRequest")] + PullRequest, + } + #[doc = "Gets status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "draft")] + Draft, + #[serde(rename = "active")] + Active, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseAbandonedEvent { - #[serde(flatten)] - pub release_event: ReleaseEvent, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<Release>, + #[serde(flatten)] + pub release_event: ReleaseEvent, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<Release>, } impl ReleaseAbandonedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseApproval { - #[doc = "Gets or sets the type of approval."] - #[serde( - rename = "approvalType", - default, - skip_serializing_if = "Option::is_none" - )] - pub approval_type: Option<release_approval::ApprovalType>, - #[doc = ""] - #[serde( - rename = "approvedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub approved_by: Option<IdentityRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub approver: Option<IdentityRef>, - #[doc = "Gets or sets attempt which specifies as which deployment attempt it belongs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Gets or sets comments for approval."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comments: Option<String>, - #[doc = "Gets date on which it got created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Gets history which specifies all approvals associated with this approval."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub history: Vec<ReleaseApprovalHistory>, - #[doc = "Gets the unique identifier of this field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Gets or sets as approval is automated or not."] - #[serde( - rename = "isAutomated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_automated: Option<bool>, - #[doc = "Gets date on which it got modified."] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Gets or sets rank which specifies the order of the approval. e.g. Same rank denotes parallel approval."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ReleaseShallowReference>, - #[doc = ""] - #[serde( - rename = "releaseDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_definition: Option<ReleaseDefinitionShallowReference>, - #[doc = ""] - #[serde( - rename = "releaseEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment: Option<ReleaseEnvironmentShallowReference>, - #[doc = "Gets the revision number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "Gets or sets the status of the approval."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<release_approval::Status>, - #[doc = "Gets url to access the approval."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Gets or sets the type of approval."] + #[serde( + rename = "approvalType", + default, + skip_serializing_if = "Option::is_none" + )] + pub approval_type: Option<release_approval::ApprovalType>, + #[doc = ""] + #[serde( + rename = "approvedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub approved_by: Option<IdentityRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub approver: Option<IdentityRef>, + #[doc = "Gets or sets attempt which specifies as which deployment attempt it belongs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Gets or sets comments for approval."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comments: Option<String>, + #[doc = "Gets date on which it got created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Gets history which specifies all approvals associated with this approval."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub history: Vec<ReleaseApprovalHistory>, + #[doc = "Gets the unique identifier of this field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Gets or sets as approval is automated or not."] + #[serde( + rename = "isAutomated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_automated: Option<bool>, + #[doc = "Gets date on which it got modified."] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Gets or sets rank which specifies the order of the approval. e.g. Same rank denotes parallel approval."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ReleaseShallowReference>, + #[doc = ""] + #[serde( + rename = "releaseDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_definition: Option<ReleaseDefinitionShallowReference>, + #[doc = ""] + #[serde( + rename = "releaseEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment: Option<ReleaseEnvironmentShallowReference>, + #[doc = "Gets the revision number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "Gets or sets the status of the approval."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<release_approval::Status>, + #[doc = "Gets url to access the approval."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ReleaseApproval { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_approval { - use super::*; - #[doc = "Gets or sets the type of approval."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ApprovalType { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "preDeploy")] - PreDeploy, - #[serde(rename = "postDeploy")] - PostDeploy, - #[serde(rename = "all")] - All, - } - #[doc = "Gets or sets the status of the approval."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "approved")] - Approved, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "reassigned")] - Reassigned, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - } + use super::*; + #[doc = "Gets or sets the type of approval."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ApprovalType { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "preDeploy")] + PreDeploy, + #[serde(rename = "postDeploy")] + PostDeploy, + #[serde(rename = "all")] + All, + } + #[doc = "Gets or sets the status of the approval."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "reassigned")] + Reassigned, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseApprovalHistory { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub approver: Option<IdentityRef>, - #[doc = ""] - #[serde(rename = "changedBy", default, skip_serializing_if = "Option::is_none")] - pub changed_by: Option<IdentityRef>, - #[doc = "Approval history comments."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comments: Option<String>, - #[doc = "Time when this approval created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Time when this approval modified."] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Approval history revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub approver: Option<IdentityRef>, + #[doc = ""] + #[serde(rename = "changedBy", default, skip_serializing_if = "Option::is_none")] + pub changed_by: Option<IdentityRef>, + #[doc = "Approval history comments."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comments: Option<String>, + #[doc = "Time when this approval created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Time when this approval modified."] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Approval history revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl ReleaseApprovalHistory { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseApprovalList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ReleaseApproval>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ReleaseApproval>, } impl ReleaseApprovalList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseApprovalPendingEvent { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub approval: Option<ReleaseApproval>, - #[doc = ""] - #[serde( - rename = "approvalOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub approval_options: Option<ApprovalOptions>, - #[serde( - rename = "completedApprovals", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub completed_approvals: Vec<ReleaseApproval>, - #[serde( - rename = "definitionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deployment: Option<Deployment>, - #[serde( - rename = "environmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_id: Option<i32>, - #[serde( - rename = "environmentName", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_name: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub environments: Vec<ReleaseEnvironment>, - #[serde( - rename = "isMultipleRankApproval", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_multiple_rank_approval: Option<bool>, - #[serde( - rename = "pendingApprovals", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub pending_approvals: Vec<ReleaseApproval>, - #[serde( - rename = "releaseCreator", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_creator: Option<String>, - #[serde( - rename = "releaseName", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[serde( - rename = "webAccessUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub web_access_uri: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub approval: Option<ReleaseApproval>, + #[doc = ""] + #[serde( + rename = "approvalOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub approval_options: Option<ApprovalOptions>, + #[serde( + rename = "completedApprovals", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub completed_approvals: Vec<ReleaseApproval>, + #[serde( + rename = "definitionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deployment: Option<Deployment>, + #[serde( + rename = "environmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_id: Option<i32>, + #[serde( + rename = "environmentName", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub environments: Vec<ReleaseEnvironment>, + #[serde( + rename = "isMultipleRankApproval", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_multiple_rank_approval: Option<bool>, + #[serde( + rename = "pendingApprovals", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub pending_approvals: Vec<ReleaseApproval>, + #[serde( + rename = "releaseCreator", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_creator: Option<String>, + #[serde( + rename = "releaseName", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[serde( + rename = "webAccessUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub web_access_uri: Option<String>, } impl ReleaseApprovalPendingEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseArtifact { - #[doc = ""] - #[serde( - rename = "artifactProvider", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_provider: Option<ArtifactProvider>, - #[doc = "Gets or sets the artifact type of ReleaseArtifact."] - #[serde( - rename = "artifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type: Option<String>, - #[doc = "Gets or sets the definition json of ReleaseArtifact."] - #[serde( - rename = "definitionData", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_data: Option<String>, - #[doc = "Gets or sets the definition id of ReleaseArtifact."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "Gets or sets the description of ReleaseArtifact."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Gets or sets the id of ReleaseArtifact."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Gets or sets the name of ReleaseArtifact."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the release id."] - #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] - pub release_id: Option<i32>, + #[doc = ""] + #[serde( + rename = "artifactProvider", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_provider: Option<ArtifactProvider>, + #[doc = "Gets or sets the artifact type of ReleaseArtifact."] + #[serde( + rename = "artifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type: Option<String>, + #[doc = "Gets or sets the definition json of ReleaseArtifact."] + #[serde( + rename = "definitionData", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_data: Option<String>, + #[doc = "Gets or sets the definition id of ReleaseArtifact."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "Gets or sets the description of ReleaseArtifact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Gets or sets the id of ReleaseArtifact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Gets or sets the name of ReleaseArtifact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the release id."] + #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] + pub release_id: Option<i32>, } impl ReleaseArtifact { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseCondition { - #[serde(flatten)] - pub condition: Condition, - #[doc = "The release condition result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<bool>, + #[serde(flatten)] + pub condition: Condition, + #[doc = "The release condition result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<bool>, } impl ReleaseCondition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseCreatedEvent { - #[serde(flatten)] - pub release_event: ReleaseEvent, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<Release>, + #[serde(flatten)] + pub release_event: ReleaseEvent, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<Release>, } impl ReleaseCreatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinition { - #[serde(flatten)] - pub release_definition_shallow_reference: ReleaseDefinitionShallowReference, - #[doc = "Gets or sets the list of artifacts."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub artifacts: Vec<Artifact>, - #[doc = "Gets or sets comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Gets date on which it got created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Gets or sets the description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Gets or sets the list of environments."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub environments: Vec<ReleaseDefinitionEnvironment>, - #[doc = "Whether release definition is deleted."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = ""] - #[serde( - rename = "lastRelease", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_release: Option<ReleaseReference>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "Gets date on which it got modified."] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "Gets or sets the release name format."] - #[serde( - rename = "releaseNameFormat", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_name_format: Option<String>, - #[doc = "Gets the revision number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "Gets or sets source of release definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<release_definition::Source>, - #[doc = "Gets or sets list of tags."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[doc = "Gets or sets the list of triggers."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub triggers: Vec<ReleaseTriggerBase>, - #[doc = "Gets or sets the list of variable groups."] - #[serde( - rename = "variableGroups", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub variable_groups: Vec<i32>, - #[doc = "Gets or sets the dictionary of variables."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[serde(flatten)] + pub release_definition_shallow_reference: ReleaseDefinitionShallowReference, + #[doc = "Gets or sets the list of artifacts."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub artifacts: Vec<Artifact>, + #[doc = "Gets or sets comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "Gets date on which it got created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Gets or sets the description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Gets or sets the list of environments."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub environments: Vec<ReleaseDefinitionEnvironment>, + #[doc = "Whether release definition is deleted."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = ""] + #[serde( + rename = "lastRelease", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_release: Option<ReleaseReference>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "Gets date on which it got modified."] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "Gets or sets the release name format."] + #[serde( + rename = "releaseNameFormat", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_name_format: Option<String>, + #[doc = "Gets the revision number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "Gets or sets source of release definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<release_definition::Source>, + #[doc = "Gets or sets list of tags."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[doc = "Gets or sets the list of triggers."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub triggers: Vec<ReleaseTriggerBase>, + #[doc = "Gets or sets the list of variable groups."] + #[serde( + rename = "variableGroups", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub variable_groups: Vec<i32>, + #[doc = "Gets or sets the dictionary of variables."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl ReleaseDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_definition { - use super::*; - #[doc = "Gets or sets source of release definition."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Source { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "restApi")] - RestApi, - #[serde(rename = "userInterface")] - UserInterface, - #[serde(rename = "ibiza")] - Ibiza, - #[serde(rename = "portalExtensionApi")] - PortalExtensionApi, - } + use super::*; + #[doc = "Gets or sets source of release definition."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Source { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "restApi")] + RestApi, + #[serde(rename = "userInterface")] + UserInterface, + #[serde(rename = "ibiza")] + Ibiza, + #[serde(rename = "portalExtensionApi")] + PortalExtensionApi, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionApprovalStep { - #[serde(flatten)] - pub release_definition_environment_step: ReleaseDefinitionEnvironmentStep, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub approver: Option<IdentityRef>, - #[doc = "Indicates whether the approval automated."] - #[serde( - rename = "isAutomated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_automated: Option<bool>, - #[doc = "Indicates whether the approval notification set."] - #[serde( - rename = "isNotificationOn", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_notification_on: Option<bool>, - #[doc = "Gets or sets the rank of approval step."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option<i32>, + #[serde(flatten)] + pub release_definition_environment_step: ReleaseDefinitionEnvironmentStep, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub approver: Option<IdentityRef>, + #[doc = "Indicates whether the approval automated."] + #[serde( + rename = "isAutomated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_automated: Option<bool>, + #[doc = "Indicates whether the approval notification set."] + #[serde( + rename = "isNotificationOn", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_notification_on: Option<bool>, + #[doc = "Gets or sets the rank of approval step."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option<i32>, } impl ReleaseDefinitionApprovalStep { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionApprovals { - #[doc = ""] - #[serde( - rename = "approvalOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub approval_options: Option<ApprovalOptions>, - #[doc = "Gets or sets the approvals."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub approvals: Vec<ReleaseDefinitionApprovalStep>, + #[doc = ""] + #[serde( + rename = "approvalOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub approval_options: Option<ApprovalOptions>, + #[doc = "Gets or sets the approvals."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub approvals: Vec<ReleaseDefinitionApprovalStep>, } impl ReleaseDefinitionApprovals { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionDeployStep { - #[serde(flatten)] - pub release_definition_environment_step: ReleaseDefinitionEnvironmentStep, - #[doc = "The list of steps for this definition."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tasks: Vec<WorkflowTask>, + #[serde(flatten)] + pub release_definition_environment_step: ReleaseDefinitionEnvironmentStep, + #[doc = "The list of steps for this definition."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tasks: Vec<WorkflowTask>, } impl ReleaseDefinitionDeployStep { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionEnvironment { - #[doc = "Gets or sets the BadgeUrl. BadgeUrl will be used when Badge will be enabled in Release Definition Environment."] - #[serde(rename = "badgeUrl", default, skip_serializing_if = "Option::is_none")] - pub badge_url: Option<String>, - #[doc = "Gets or sets the environment conditions."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub conditions: Vec<Condition>, - #[doc = ""] - #[serde( - rename = "currentRelease", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_release: Option<ReleaseShallowReference>, - #[doc = "Gets or sets the demands."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub demands: Vec<Demand>, - #[doc = "Gets or sets the deploy phases of environment."] - #[serde( - rename = "deployPhases", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub deploy_phases: Vec<DeployPhase>, - #[doc = ""] - #[serde( - rename = "deployStep", - default, - skip_serializing_if = "Option::is_none" - )] - pub deploy_step: Option<ReleaseDefinitionDeployStep>, - #[doc = ""] - #[serde( - rename = "environmentOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_options: Option<EnvironmentOptions>, - #[doc = "Gets or sets the triggers on environment."] - #[serde( - rename = "environmentTriggers", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub environment_triggers: Vec<EnvironmentTrigger>, - #[doc = "Defines policy on environment queuing at Release Management side queue. We will send to Environment Runner [creating pre-deploy and other steps] only when the policies mentioned are satisfied."] - #[serde( - rename = "executionPolicy", - default, - skip_serializing_if = "Option::is_none" - )] - pub execution_policy: Option<EnvironmentExecutionPolicy>, - #[doc = "Gets and sets the ID of the ReleaseDefinitionEnvironment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Gets and sets the name of the ReleaseDefinitionEnvironment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = ""] - #[serde( - rename = "postDeployApprovals", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_deploy_approvals: Option<ReleaseDefinitionApprovals>, - #[doc = ""] - #[serde( - rename = "postDeploymentGates", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_deployment_gates: Option<ReleaseDefinitionGatesStep>, - #[doc = ""] - #[serde( - rename = "preDeployApprovals", - default, - skip_serializing_if = "Option::is_none" - )] - pub pre_deploy_approvals: Option<ReleaseDefinitionApprovals>, - #[doc = ""] - #[serde( - rename = "preDeploymentGates", - default, - skip_serializing_if = "Option::is_none" - )] - pub pre_deployment_gates: Option<ReleaseDefinitionGatesStep>, - #[doc = ""] - #[serde( - rename = "processParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub process_parameters: Option<ProcessParameters>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "Gets or sets the queue ID."] - #[serde(rename = "queueId", default, skip_serializing_if = "Option::is_none")] - pub queue_id: Option<i32>, - #[doc = "Gets and sets the rank of the ReleaseDefinitionEnvironment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option<i32>, - #[doc = ""] - #[serde( - rename = "retentionPolicy", - default, - skip_serializing_if = "Option::is_none" - )] - pub retention_policy: Option<EnvironmentRetentionPolicy>, - #[doc = "Gets or sets the schedules"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub schedules: Vec<ReleaseSchedule>, - #[doc = "Gets or sets the variable groups."] - #[serde( - rename = "variableGroups", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub variable_groups: Vec<i32>, - #[doc = "Gets and sets the variables."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[doc = "Gets or sets the BadgeUrl. BadgeUrl will be used when Badge will be enabled in Release Definition Environment."] + #[serde(rename = "badgeUrl", default, skip_serializing_if = "Option::is_none")] + pub badge_url: Option<String>, + #[doc = "Gets or sets the environment conditions."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub conditions: Vec<Condition>, + #[doc = ""] + #[serde( + rename = "currentRelease", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_release: Option<ReleaseShallowReference>, + #[doc = "Gets or sets the demands."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub demands: Vec<Demand>, + #[doc = "Gets or sets the deploy phases of environment."] + #[serde( + rename = "deployPhases", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub deploy_phases: Vec<DeployPhase>, + #[doc = ""] + #[serde( + rename = "deployStep", + default, + skip_serializing_if = "Option::is_none" + )] + pub deploy_step: Option<ReleaseDefinitionDeployStep>, + #[doc = ""] + #[serde( + rename = "environmentOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_options: Option<EnvironmentOptions>, + #[doc = "Gets or sets the triggers on environment."] + #[serde( + rename = "environmentTriggers", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub environment_triggers: Vec<EnvironmentTrigger>, + #[doc = "Defines policy on environment queuing at Release Management side queue. We will send to Environment Runner [creating pre-deploy and other steps] only when the policies mentioned are satisfied."] + #[serde( + rename = "executionPolicy", + default, + skip_serializing_if = "Option::is_none" + )] + pub execution_policy: Option<EnvironmentExecutionPolicy>, + #[doc = "Gets and sets the ID of the ReleaseDefinitionEnvironment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Gets and sets the name of the ReleaseDefinitionEnvironment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = ""] + #[serde( + rename = "postDeployApprovals", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_deploy_approvals: Option<ReleaseDefinitionApprovals>, + #[doc = ""] + #[serde( + rename = "postDeploymentGates", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_deployment_gates: Option<ReleaseDefinitionGatesStep>, + #[doc = ""] + #[serde( + rename = "preDeployApprovals", + default, + skip_serializing_if = "Option::is_none" + )] + pub pre_deploy_approvals: Option<ReleaseDefinitionApprovals>, + #[doc = ""] + #[serde( + rename = "preDeploymentGates", + default, + skip_serializing_if = "Option::is_none" + )] + pub pre_deployment_gates: Option<ReleaseDefinitionGatesStep>, + #[doc = ""] + #[serde( + rename = "processParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub process_parameters: Option<ProcessParameters>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "Gets or sets the queue ID."] + #[serde(rename = "queueId", default, skip_serializing_if = "Option::is_none")] + pub queue_id: Option<i32>, + #[doc = "Gets and sets the rank of the ReleaseDefinitionEnvironment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option<i32>, + #[doc = ""] + #[serde( + rename = "retentionPolicy", + default, + skip_serializing_if = "Option::is_none" + )] + pub retention_policy: Option<EnvironmentRetentionPolicy>, + #[doc = "Gets or sets the schedules"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub schedules: Vec<ReleaseSchedule>, + #[doc = "Gets or sets the variable groups."] + #[serde( + rename = "variableGroups", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub variable_groups: Vec<i32>, + #[doc = "Gets and sets the variables."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl ReleaseDefinitionEnvironment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionEnvironmentStep { - #[doc = "ID of the approval or deploy step."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, + #[doc = "ID of the approval or deploy step."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, } impl ReleaseDefinitionEnvironmentStep { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionEnvironmentSummary { - #[doc = "ID of ReleaseDefinition environment summary."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "List of release shallow reference deployed using this ReleaseDefinition."] - #[serde( - rename = "lastReleases", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub last_releases: Vec<ReleaseShallowReference>, - #[doc = "Name of ReleaseDefinition environment summary."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "ID of ReleaseDefinition environment summary."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "List of release shallow reference deployed using this ReleaseDefinition."] + #[serde( + rename = "lastReleases", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub last_releases: Vec<ReleaseShallowReference>, + #[doc = "Name of ReleaseDefinition environment summary."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ReleaseDefinitionEnvironmentSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionEnvironmentTemplate { - #[doc = "Indicates whether template can be deleted or not."] - #[serde(rename = "canDelete", default, skip_serializing_if = "Option::is_none")] - pub can_delete: Option<bool>, - #[doc = "Category of the ReleaseDefinition environment template."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option<String>, - #[doc = "Description of the ReleaseDefinition environment template."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option<ReleaseDefinitionEnvironment>, - #[doc = "ID of the task which used to display icon used for this template."] - #[serde( - rename = "iconTaskId", - default, - skip_serializing_if = "Option::is_none" - )] - pub icon_task_id: Option<String>, - #[doc = "Icon uri of the template."] - #[serde(rename = "iconUri", default, skip_serializing_if = "Option::is_none")] - pub icon_uri: Option<String>, - #[doc = "ID of the ReleaseDefinition environment template."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Indicates whether template deleted or not."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "Name of the ReleaseDefinition environment template."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Indicates whether template can be deleted or not."] + #[serde(rename = "canDelete", default, skip_serializing_if = "Option::is_none")] + pub can_delete: Option<bool>, + #[doc = "Category of the ReleaseDefinition environment template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option<String>, + #[doc = "Description of the ReleaseDefinition environment template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option<ReleaseDefinitionEnvironment>, + #[doc = "ID of the task which used to display icon used for this template."] + #[serde( + rename = "iconTaskId", + default, + skip_serializing_if = "Option::is_none" + )] + pub icon_task_id: Option<String>, + #[doc = "Icon uri of the template."] + #[serde(rename = "iconUri", default, skip_serializing_if = "Option::is_none")] + pub icon_uri: Option<String>, + #[doc = "ID of the ReleaseDefinition environment template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Indicates whether template deleted or not."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "Name of the ReleaseDefinition environment template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ReleaseDefinitionEnvironmentTemplate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionGate { - #[doc = "Gets or sets the gates workflow."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tasks: Vec<WorkflowTask>, + #[doc = "Gets or sets the gates workflow."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tasks: Vec<WorkflowTask>, } impl ReleaseDefinitionGate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionGatesOptions { - #[doc = "Gets or sets as the gates enabled or not."] - #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_enabled: Option<bool>, - #[doc = "Gets or sets the minimum duration for steady results after a successful gates evaluation."] - #[serde( - rename = "minimumSuccessDuration", - default, - skip_serializing_if = "Option::is_none" - )] - pub minimum_success_duration: Option<i32>, - #[doc = "Gets or sets the time between re-evaluation of gates."] - #[serde( - rename = "samplingInterval", - default, - skip_serializing_if = "Option::is_none" - )] - pub sampling_interval: Option<i32>, - #[doc = "Gets or sets the delay before evaluation."] - #[serde( - rename = "stabilizationTime", - default, - skip_serializing_if = "Option::is_none" - )] - pub stabilization_time: Option<i32>, - #[doc = "Gets or sets the timeout after which gates fail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timeout: Option<i32>, + #[doc = "Gets or sets as the gates enabled or not."] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option<bool>, + #[doc = "Gets or sets the minimum duration for steady results after a successful gates evaluation."] + #[serde( + rename = "minimumSuccessDuration", + default, + skip_serializing_if = "Option::is_none" + )] + pub minimum_success_duration: Option<i32>, + #[doc = "Gets or sets the time between re-evaluation of gates."] + #[serde( + rename = "samplingInterval", + default, + skip_serializing_if = "Option::is_none" + )] + pub sampling_interval: Option<i32>, + #[doc = "Gets or sets the delay before evaluation."] + #[serde( + rename = "stabilizationTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub stabilization_time: Option<i32>, + #[doc = "Gets or sets the timeout after which gates fail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout: Option<i32>, } impl ReleaseDefinitionGatesOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionGatesStep { - #[doc = "Gets or sets the gates."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub gates: Vec<ReleaseDefinitionGate>, - #[doc = ""] - #[serde( - rename = "gatesOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub gates_options: Option<ReleaseDefinitionGatesOptions>, - #[doc = "ID of the ReleaseDefinitionGateStep."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, + #[doc = "Gets or sets the gates."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub gates: Vec<ReleaseDefinitionGate>, + #[doc = ""] + #[serde( + rename = "gatesOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub gates_options: Option<ReleaseDefinitionGatesOptions>, + #[doc = "ID of the ReleaseDefinitionGateStep."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, } impl ReleaseDefinitionGatesStep { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ReleaseDefinition>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ReleaseDefinition>, } impl ReleaseDefinitionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionRevision { - #[doc = "Gets api-version for revision object."] - #[serde( - rename = "apiVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub api_version: Option<String>, - #[doc = ""] - #[serde(rename = "changedBy", default, skip_serializing_if = "Option::is_none")] - pub changed_by: Option<IdentityRef>, - #[doc = "Gets date on which ReleaseDefinition changed."] - #[serde( - rename = "changedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub changed_date: Option<time::OffsetDateTime>, - #[doc = "Gets type of change."] - #[serde( - rename = "changeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_type: Option<release_definition_revision::ChangeType>, - #[doc = "Gets comments for revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Get id of the definition."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "Gets definition URL."] - #[serde( - rename = "definitionUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_url: Option<String>, - #[doc = "Get revision number of the definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[doc = "Gets api-version for revision object."] + #[serde( + rename = "apiVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub api_version: Option<String>, + #[doc = ""] + #[serde(rename = "changedBy", default, skip_serializing_if = "Option::is_none")] + pub changed_by: Option<IdentityRef>, + #[doc = "Gets date on which ReleaseDefinition changed."] + #[serde( + rename = "changedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub changed_date: Option<time::OffsetDateTime>, + #[doc = "Gets type of change."] + #[serde( + rename = "changeType", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_type: Option<release_definition_revision::ChangeType>, + #[doc = "Gets comments for revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Get id of the definition."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "Gets definition URL."] + #[serde( + rename = "definitionUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_url: Option<String>, + #[doc = "Get revision number of the definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl ReleaseDefinitionRevision { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_definition_revision { - use super::*; - #[doc = "Gets type of change."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ChangeType { - #[serde(rename = "add")] - Add, - #[serde(rename = "update")] - Update, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "undelete")] - Undelete, - } + use super::*; + #[doc = "Gets type of change."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ChangeType { + #[serde(rename = "add")] + Add, + #[serde(rename = "update")] + Update, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "undelete")] + Undelete, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionRevisionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ReleaseDefinitionRevision>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ReleaseDefinitionRevision>, } impl ReleaseDefinitionRevisionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionShallowReference { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Gets the unique identifier of release definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Gets or sets the name of the release definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the path of the release definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = ""] - #[serde( - rename = "projectReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_reference: Option<ProjectReference>, - #[doc = "Gets the REST API url to access the release definition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Gets the unique identifier of release definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Gets or sets the name of the release definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the path of the release definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = ""] + #[serde( + rename = "projectReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_reference: Option<ProjectReference>, + #[doc = "Gets the REST API url to access the release definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ReleaseDefinitionShallowReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionSummary { - #[doc = "List of Release Definition environment summary."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub environments: Vec<ReleaseDefinitionEnvironmentSummary>, - #[doc = ""] - #[serde( - rename = "releaseDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_definition: Option<ReleaseDefinitionShallowReference>, - #[doc = "List of releases deployed using this Release Definition."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub releases: Vec<Release>, + #[doc = "List of Release Definition environment summary."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub environments: Vec<ReleaseDefinitionEnvironmentSummary>, + #[doc = ""] + #[serde( + rename = "releaseDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_definition: Option<ReleaseDefinitionShallowReference>, + #[doc = "List of releases deployed using this Release Definition."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub releases: Vec<Release>, } impl ReleaseDefinitionSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDefinitionUndeleteParameter { - #[doc = "Gets or sets comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, + #[doc = "Gets or sets comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, } impl ReleaseDefinitionUndeleteParameter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseDeployPhase { - #[doc = "Deployment jobs of the phase."] - #[serde( - rename = "deploymentJobs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub deployment_jobs: Vec<DeploymentJob>, - #[doc = "Phase execution error logs."] - #[serde(rename = "errorLog", default, skip_serializing_if = "Option::is_none")] - pub error_log: Option<String>, - #[doc = "List of manual intervention tasks execution information in phase."] - #[serde( - rename = "manualInterventions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub manual_interventions: Vec<ManualIntervention>, - #[doc = "Name of the phase."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "ID of the phase."] - #[serde(rename = "phaseId", default, skip_serializing_if = "Option::is_none")] - pub phase_id: Option<String>, - #[doc = "Type of the phase."] - #[serde(rename = "phaseType", default, skip_serializing_if = "Option::is_none")] - pub phase_type: Option<release_deploy_phase::PhaseType>, - #[doc = "Rank of the phase."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option<i32>, - #[doc = "Run Plan ID of the phase."] - #[serde(rename = "runPlanId", default, skip_serializing_if = "Option::is_none")] - pub run_plan_id: Option<String>, - #[doc = "Phase start time."] - #[serde( - rename = "startedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_on: Option<time::OffsetDateTime>, - #[doc = "Status of the phase."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<release_deploy_phase::Status>, + #[doc = "Deployment jobs of the phase."] + #[serde( + rename = "deploymentJobs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub deployment_jobs: Vec<DeploymentJob>, + #[doc = "Phase execution error logs."] + #[serde(rename = "errorLog", default, skip_serializing_if = "Option::is_none")] + pub error_log: Option<String>, + #[doc = "List of manual intervention tasks execution information in phase."] + #[serde( + rename = "manualInterventions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub manual_interventions: Vec<ManualIntervention>, + #[doc = "Name of the phase."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "ID of the phase."] + #[serde(rename = "phaseId", default, skip_serializing_if = "Option::is_none")] + pub phase_id: Option<String>, + #[doc = "Type of the phase."] + #[serde(rename = "phaseType", default, skip_serializing_if = "Option::is_none")] + pub phase_type: Option<release_deploy_phase::PhaseType>, + #[doc = "Rank of the phase."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option<i32>, + #[doc = "Run Plan ID of the phase."] + #[serde(rename = "runPlanId", default, skip_serializing_if = "Option::is_none")] + pub run_plan_id: Option<String>, + #[doc = "Phase start time."] + #[serde( + rename = "startedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_on: Option<time::OffsetDateTime>, + #[doc = "Status of the phase."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<release_deploy_phase::Status>, } impl ReleaseDeployPhase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_deploy_phase { - use super::*; - #[doc = "Type of the phase."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum PhaseType { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "agentBasedDeployment")] - AgentBasedDeployment, - #[serde(rename = "runOnServer")] - RunOnServer, - #[serde(rename = "machineGroupBasedDeployment")] - MachineGroupBasedDeployment, - #[serde(rename = "deploymentGates")] - DeploymentGates, - } - #[doc = "Status of the phase."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "notStarted")] - NotStarted, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "partiallySucceeded")] - PartiallySucceeded, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "cancelling")] - Cancelling, - } + use super::*; + #[doc = "Type of the phase."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum PhaseType { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "agentBasedDeployment")] + AgentBasedDeployment, + #[serde(rename = "runOnServer")] + RunOnServer, + #[serde(rename = "machineGroupBasedDeployment")] + MachineGroupBasedDeployment, + #[serde(rename = "deploymentGates")] + DeploymentGates, + } + #[doc = "Status of the phase."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "notStarted")] + NotStarted, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "partiallySucceeded")] + PartiallySucceeded, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "cancelling")] + Cancelling, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseEnvironment { - #[doc = "Gets list of conditions."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub conditions: Vec<ReleaseCondition>, - #[doc = "Gets date on which it got created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Gets definition environment id."] - #[serde( - rename = "definitionEnvironmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_environment_id: Option<i32>, - #[doc = "Gets list of deploy phases snapshot."] - #[serde( - rename = "deployPhasesSnapshot", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub deploy_phases_snapshot: Vec<DeployPhase>, - #[doc = "Gets deploy steps."] - #[serde( - rename = "deploySteps", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub deploy_steps: Vec<DeploymentAttempt>, - #[doc = ""] - #[serde( - rename = "environmentOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_options: Option<EnvironmentOptions>, - #[doc = "Gets the unique identifier of this field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Gets date on which it got modified."] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Gets name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets next scheduled UTC time."] - #[serde( - rename = "nextScheduledUtcTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub next_scheduled_utc_time: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = ""] - #[serde( - rename = "postApprovalsSnapshot", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_approvals_snapshot: Option<ReleaseDefinitionApprovals>, - #[doc = "Gets list of post deploy approvals."] - #[serde( - rename = "postDeployApprovals", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub post_deploy_approvals: Vec<ReleaseApproval>, - #[doc = ""] - #[serde( - rename = "postDeploymentGatesSnapshot", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_deployment_gates_snapshot: Option<ReleaseDefinitionGatesStep>, - #[doc = ""] - #[serde( - rename = "preApprovalsSnapshot", - default, - skip_serializing_if = "Option::is_none" - )] - pub pre_approvals_snapshot: Option<ReleaseDefinitionApprovals>, - #[doc = "Gets list of pre deploy approvals."] - #[serde( - rename = "preDeployApprovals", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub pre_deploy_approvals: Vec<ReleaseApproval>, - #[doc = ""] - #[serde( - rename = "preDeploymentGatesSnapshot", - default, - skip_serializing_if = "Option::is_none" - )] - pub pre_deployment_gates_snapshot: Option<ReleaseDefinitionGatesStep>, - #[doc = ""] - #[serde( - rename = "processParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub process_parameters: Option<ProcessParameters>, - #[doc = "Gets rank."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ReleaseShallowReference>, - #[doc = ""] - #[serde( - rename = "releaseCreatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_created_by: Option<IdentityRef>, - #[doc = ""] - #[serde( - rename = "releaseDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_definition: Option<ReleaseDefinitionShallowReference>, - #[doc = "Gets release id."] - #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] - pub release_id: Option<i32>, - #[doc = "Gets schedule deployment time of release environment."] - #[serde( - rename = "scheduledDeploymentTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub scheduled_deployment_time: Option<time::OffsetDateTime>, - #[doc = "Gets list of schedules."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub schedules: Vec<ReleaseSchedule>, - #[doc = "Gets environment status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<release_environment::Status>, - #[doc = "Gets time to deploy."] - #[serde( - rename = "timeToDeploy", - default, - skip_serializing_if = "Option::is_none" - )] - pub time_to_deploy: Option<f64>, - #[doc = "Gets trigger reason."] - #[serde( - rename = "triggerReason", - default, - skip_serializing_if = "Option::is_none" - )] - pub trigger_reason: Option<String>, - #[doc = "Gets the list of variable groups."] - #[serde( - rename = "variableGroups", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub variable_groups: Vec<VariableGroup>, - #[doc = "Gets the dictionary of variables."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[doc = "Gets list of conditions."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub conditions: Vec<ReleaseCondition>, + #[doc = "Gets date on which it got created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Gets definition environment id."] + #[serde( + rename = "definitionEnvironmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_environment_id: Option<i32>, + #[doc = "Gets list of deploy phases snapshot."] + #[serde( + rename = "deployPhasesSnapshot", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub deploy_phases_snapshot: Vec<DeployPhase>, + #[doc = "Gets deploy steps."] + #[serde( + rename = "deploySteps", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub deploy_steps: Vec<DeploymentAttempt>, + #[doc = ""] + #[serde( + rename = "environmentOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_options: Option<EnvironmentOptions>, + #[doc = "Gets the unique identifier of this field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Gets date on which it got modified."] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Gets name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets next scheduled UTC time."] + #[serde( + rename = "nextScheduledUtcTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub next_scheduled_utc_time: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = ""] + #[serde( + rename = "postApprovalsSnapshot", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_approvals_snapshot: Option<ReleaseDefinitionApprovals>, + #[doc = "Gets list of post deploy approvals."] + #[serde( + rename = "postDeployApprovals", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub post_deploy_approvals: Vec<ReleaseApproval>, + #[doc = ""] + #[serde( + rename = "postDeploymentGatesSnapshot", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_deployment_gates_snapshot: Option<ReleaseDefinitionGatesStep>, + #[doc = ""] + #[serde( + rename = "preApprovalsSnapshot", + default, + skip_serializing_if = "Option::is_none" + )] + pub pre_approvals_snapshot: Option<ReleaseDefinitionApprovals>, + #[doc = "Gets list of pre deploy approvals."] + #[serde( + rename = "preDeployApprovals", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub pre_deploy_approvals: Vec<ReleaseApproval>, + #[doc = ""] + #[serde( + rename = "preDeploymentGatesSnapshot", + default, + skip_serializing_if = "Option::is_none" + )] + pub pre_deployment_gates_snapshot: Option<ReleaseDefinitionGatesStep>, + #[doc = ""] + #[serde( + rename = "processParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub process_parameters: Option<ProcessParameters>, + #[doc = "Gets rank."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ReleaseShallowReference>, + #[doc = ""] + #[serde( + rename = "releaseCreatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_created_by: Option<IdentityRef>, + #[doc = ""] + #[serde( + rename = "releaseDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_definition: Option<ReleaseDefinitionShallowReference>, + #[doc = "Gets release id."] + #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] + pub release_id: Option<i32>, + #[doc = "Gets schedule deployment time of release environment."] + #[serde( + rename = "scheduledDeploymentTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub scheduled_deployment_time: Option<time::OffsetDateTime>, + #[doc = "Gets list of schedules."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub schedules: Vec<ReleaseSchedule>, + #[doc = "Gets environment status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<release_environment::Status>, + #[doc = "Gets time to deploy."] + #[serde( + rename = "timeToDeploy", + default, + skip_serializing_if = "Option::is_none" + )] + pub time_to_deploy: Option<f64>, + #[doc = "Gets trigger reason."] + #[serde( + rename = "triggerReason", + default, + skip_serializing_if = "Option::is_none" + )] + pub trigger_reason: Option<String>, + #[doc = "Gets the list of variable groups."] + #[serde( + rename = "variableGroups", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub variable_groups: Vec<VariableGroup>, + #[doc = "Gets the dictionary of variables."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl ReleaseEnvironment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_environment { - use super::*; - #[doc = "Gets environment status."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "notStarted")] - NotStarted, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "scheduled")] - Scheduled, - #[serde(rename = "partiallySucceeded")] - PartiallySucceeded, - } + use super::*; + #[doc = "Gets environment status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "notStarted")] + NotStarted, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "scheduled")] + Scheduled, + #[serde(rename = "partiallySucceeded")] + PartiallySucceeded, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseEnvironmentCompletedEvent { - #[serde( - rename = "createdByName", - default, - skip_serializing_if = "Option::is_none" - )] - pub created_by_name: Option<String>, - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[serde( - rename = "definitionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option<ReleaseEnvironment>, - #[serde( - rename = "environmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_id: Option<i32>, - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<release_environment_completed_event::Reason>, - #[doc = ""] - #[serde( - rename = "releaseCreatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_created_by: Option<IdentityRef>, - #[serde( - rename = "releaseLogsUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_logs_uri: Option<String>, - #[serde( - rename = "releaseName", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[serde( - rename = "webAccessUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub web_access_uri: Option<String>, + #[serde( + rename = "createdByName", + default, + skip_serializing_if = "Option::is_none" + )] + pub created_by_name: Option<String>, + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[serde( + rename = "definitionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option<ReleaseEnvironment>, + #[serde( + rename = "environmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_id: Option<i32>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<release_environment_completed_event::Reason>, + #[doc = ""] + #[serde( + rename = "releaseCreatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_created_by: Option<IdentityRef>, + #[serde( + rename = "releaseLogsUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_logs_uri: Option<String>, + #[serde( + rename = "releaseName", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[serde( + rename = "webAccessUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub web_access_uri: Option<String>, } impl ReleaseEnvironmentCompletedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_environment_completed_event { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Reason { - #[serde(rename = "none")] - None, - #[serde(rename = "manual")] - Manual, - #[serde(rename = "automated")] - Automated, - #[serde(rename = "scheduled")] - Scheduled, - #[serde(rename = "redeployTrigger")] - RedeployTrigger, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Reason { + #[serde(rename = "none")] + None, + #[serde(rename = "manual")] + Manual, + #[serde(rename = "automated")] + Automated, + #[serde(rename = "scheduled")] + Scheduled, + #[serde(rename = "redeployTrigger")] + RedeployTrigger, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseEnvironmentShallowReference { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Gets the unique identifier of release environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Gets or sets the name of the release environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets the REST API url to access the release environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Gets the unique identifier of release environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Gets or sets the name of the release environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets the REST API url to access the release environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ReleaseEnvironmentShallowReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseEnvironmentStatusUpdatedEvent { - #[serde(flatten)] - pub realtime_release_definition_event: RealtimeReleaseDefinitionEvent, - #[serde( - rename = "environmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_id: Option<i32>, - #[serde( - rename = "environmentStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_status: Option<release_environment_status_updated_event::EnvironmentStatus>, - #[serde( - rename = "latestDeploymentOperationStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_deployment_operation_status: - Option<release_environment_status_updated_event::LatestDeploymentOperationStatus>, - #[serde( - rename = "latestDeploymentStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_deployment_status: - Option<release_environment_status_updated_event::LatestDeploymentStatus>, - #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] - pub release_id: Option<i32>, + #[serde(flatten)] + pub realtime_release_definition_event: RealtimeReleaseDefinitionEvent, + #[serde( + rename = "environmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_id: Option<i32>, + #[serde( + rename = "environmentStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_status: Option<release_environment_status_updated_event::EnvironmentStatus>, + #[serde( + rename = "latestDeploymentOperationStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_deployment_operation_status: + Option<release_environment_status_updated_event::LatestDeploymentOperationStatus>, + #[serde( + rename = "latestDeploymentStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_deployment_status: + Option<release_environment_status_updated_event::LatestDeploymentStatus>, + #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] + pub release_id: Option<i32>, } impl ReleaseEnvironmentStatusUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_environment_status_updated_event { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum EnvironmentStatus { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "notStarted")] - NotStarted, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "scheduled")] - Scheduled, - #[serde(rename = "partiallySucceeded")] - PartiallySucceeded, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum LatestDeploymentOperationStatus { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "scheduled")] - Scheduled, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "approved")] - Approved, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "deferred")] - Deferred, - #[serde(rename = "queuedForAgent")] - QueuedForAgent, - #[serde(rename = "phaseInProgress")] - PhaseInProgress, - #[serde(rename = "phaseSucceeded")] - PhaseSucceeded, - #[serde(rename = "phasePartiallySucceeded")] - PhasePartiallySucceeded, - #[serde(rename = "phaseFailed")] - PhaseFailed, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "phaseCanceled")] - PhaseCanceled, - #[serde(rename = "manualInterventionPending")] - ManualInterventionPending, - #[serde(rename = "queuedForPipeline")] - QueuedForPipeline, - #[serde(rename = "cancelling")] - Cancelling, - #[serde(rename = "evaluatingGates")] - EvaluatingGates, - #[serde(rename = "gateFailed")] - GateFailed, - #[serde(rename = "all")] - All, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum LatestDeploymentStatus { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "notDeployed")] - NotDeployed, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "partiallySucceeded")] - PartiallySucceeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "all")] - All, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum EnvironmentStatus { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "notStarted")] + NotStarted, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "scheduled")] + Scheduled, + #[serde(rename = "partiallySucceeded")] + PartiallySucceeded, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum LatestDeploymentOperationStatus { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "scheduled")] + Scheduled, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "deferred")] + Deferred, + #[serde(rename = "queuedForAgent")] + QueuedForAgent, + #[serde(rename = "phaseInProgress")] + PhaseInProgress, + #[serde(rename = "phaseSucceeded")] + PhaseSucceeded, + #[serde(rename = "phasePartiallySucceeded")] + PhasePartiallySucceeded, + #[serde(rename = "phaseFailed")] + PhaseFailed, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "phaseCanceled")] + PhaseCanceled, + #[serde(rename = "manualInterventionPending")] + ManualInterventionPending, + #[serde(rename = "queuedForPipeline")] + QueuedForPipeline, + #[serde(rename = "cancelling")] + Cancelling, + #[serde(rename = "evaluatingGates")] + EvaluatingGates, + #[serde(rename = "gateFailed")] + GateFailed, + #[serde(rename = "all")] + All, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum LatestDeploymentStatus { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "notDeployed")] + NotDeployed, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "partiallySucceeded")] + PartiallySucceeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseEnvironmentUpdateMetadata { - #[doc = "Gets or sets comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Gets or sets scheduled deployment time."] - #[serde( - rename = "scheduledDeploymentTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub scheduled_deployment_time: Option<time::OffsetDateTime>, - #[doc = "Gets or sets status of environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<release_environment_update_metadata::Status>, - #[doc = "Sets list of environment variables to be overridden at deployment time."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[doc = "Gets or sets comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Gets or sets scheduled deployment time."] + #[serde( + rename = "scheduledDeploymentTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub scheduled_deployment_time: Option<time::OffsetDateTime>, + #[doc = "Gets or sets status of environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<release_environment_update_metadata::Status>, + #[doc = "Sets list of environment variables to be overridden at deployment time."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl ReleaseEnvironmentUpdateMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_environment_update_metadata { - use super::*; - #[doc = "Gets or sets status of environment."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "notStarted")] - NotStarted, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "scheduled")] - Scheduled, - #[serde(rename = "partiallySucceeded")] - PartiallySucceeded, - } + use super::*; + #[doc = "Gets or sets status of environment."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "notStarted")] + NotStarted, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "scheduled")] + Scheduled, + #[serde(rename = "partiallySucceeded")] + PartiallySucceeded, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseEvent { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ReleaseEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseGates { - #[doc = "Contains the gates job details of each evaluation."] - #[serde( - rename = "deploymentJobs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub deployment_jobs: Vec<DeploymentJob>, - #[doc = "ID of release gates."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "List of ignored gates."] - #[serde( - rename = "ignoredGates", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ignored_gates: Vec<IgnoredGate>, - #[doc = "Gates last modified time."] - #[serde( - rename = "lastModifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified_on: Option<time::OffsetDateTime>, - #[doc = "Run plan ID of the gates."] - #[serde(rename = "runPlanId", default, skip_serializing_if = "Option::is_none")] - pub run_plan_id: Option<String>, - #[doc = "Gates stabilization completed date and time."] - #[serde( - rename = "stabilizationCompletedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub stabilization_completed_on: Option<time::OffsetDateTime>, - #[doc = "Gates evaluation started time."] - #[serde( - rename = "startedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_on: Option<time::OffsetDateTime>, - #[doc = "Status of release gates."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<release_gates::Status>, - #[doc = "Date and time at which all gates executed successfully."] - #[serde( - rename = "succeedingSince", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub succeeding_since: Option<time::OffsetDateTime>, + #[doc = "Contains the gates job details of each evaluation."] + #[serde( + rename = "deploymentJobs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub deployment_jobs: Vec<DeploymentJob>, + #[doc = "ID of release gates."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "List of ignored gates."] + #[serde( + rename = "ignoredGates", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ignored_gates: Vec<IgnoredGate>, + #[doc = "Gates last modified time."] + #[serde( + rename = "lastModifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified_on: Option<time::OffsetDateTime>, + #[doc = "Run plan ID of the gates."] + #[serde(rename = "runPlanId", default, skip_serializing_if = "Option::is_none")] + pub run_plan_id: Option<String>, + #[doc = "Gates stabilization completed date and time."] + #[serde( + rename = "stabilizationCompletedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub stabilization_completed_on: Option<time::OffsetDateTime>, + #[doc = "Gates evaluation started time."] + #[serde( + rename = "startedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_on: Option<time::OffsetDateTime>, + #[doc = "Status of release gates."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<release_gates::Status>, + #[doc = "Date and time at which all gates executed successfully."] + #[serde( + rename = "succeedingSince", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub succeeding_since: Option<time::OffsetDateTime>, } impl ReleaseGates { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_gates { - use super::*; - #[doc = "Status of release gates."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "none")] - None, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - } + use super::*; + #[doc = "Status of release gates."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "none")] + None, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseGatesPhase { - #[serde(flatten)] - pub release_deploy_phase: ReleaseDeployPhase, - #[doc = "List of ignored gates."] - #[serde( - rename = "ignoredGates", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ignored_gates: Vec<IgnoredGate>, - #[doc = "Date and time at which stabilization of gates completed."] - #[serde( - rename = "stabilizationCompletedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub stabilization_completed_on: Option<time::OffsetDateTime>, - #[doc = "Date and time at which all gates executed successfully."] - #[serde( - rename = "succeedingSince", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub succeeding_since: Option<time::OffsetDateTime>, + #[serde(flatten)] + pub release_deploy_phase: ReleaseDeployPhase, + #[doc = "List of ignored gates."] + #[serde( + rename = "ignoredGates", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ignored_gates: Vec<IgnoredGate>, + #[doc = "Date and time at which stabilization of gates completed."] + #[serde( + rename = "stabilizationCompletedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub stabilization_completed_on: Option<time::OffsetDateTime>, + #[doc = "Date and time at which all gates executed successfully."] + #[serde( + rename = "succeedingSince", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub succeeding_since: Option<time::OffsetDateTime>, } impl ReleaseGatesPhase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Release>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Release>, } impl ReleaseList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseManagementInputValue { - #[doc = "The text to show for the display of this value."] - #[serde( - rename = "displayValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_value: Option<String>, - #[doc = "The value to store for this input."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "The text to show for the display of this value."] + #[serde( + rename = "displayValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_value: Option<String>, + #[doc = "The value to store for this input."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl ReleaseManagementInputValue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseNotCreatedEvent { - #[doc = ""] - #[serde( - rename = "definitionReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_reference: Option<ReleaseDefinitionShallowReference>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[serde( - rename = "releaseReason", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_reason: Option<release_not_created_event::ReleaseReason>, - #[doc = ""] - #[serde( - rename = "requestedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_by: Option<IdentityRef>, + #[doc = ""] + #[serde( + rename = "definitionReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_reference: Option<ReleaseDefinitionShallowReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[serde( + rename = "releaseReason", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_reason: Option<release_not_created_event::ReleaseReason>, + #[doc = ""] + #[serde( + rename = "requestedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_by: Option<IdentityRef>, } impl ReleaseNotCreatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_not_created_event { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ReleaseReason { - #[serde(rename = "none")] - None, - #[serde(rename = "manual")] - Manual, - #[serde(rename = "continuousIntegration")] - ContinuousIntegration, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "pullRequest")] - PullRequest, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ReleaseReason { + #[serde(rename = "none")] + None, + #[serde(rename = "manual")] + Manual, + #[serde(rename = "continuousIntegration")] + ContinuousIntegration, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "pullRequest")] + PullRequest, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseReference { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Gets list of artifacts."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub artifacts: Vec<Artifact>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Gets date on when this release created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Gets description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "ID of the Release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "Gets name of release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets reason for release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<release_reference::Reason>, - #[doc = ""] - #[serde( - rename = "releaseDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_definition: Option<ReleaseDefinitionShallowReference>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Gets list of artifacts."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub artifacts: Vec<Artifact>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "Gets date on when this release created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Gets description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "ID of the Release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "Gets name of release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets reason for release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<release_reference::Reason>, + #[doc = ""] + #[serde( + rename = "releaseDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_definition: Option<ReleaseDefinitionShallowReference>, } impl ReleaseReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_reference { - use super::*; - #[doc = "Gets reason for release."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Reason { - #[serde(rename = "none")] - None, - #[serde(rename = "manual")] - Manual, - #[serde(rename = "continuousIntegration")] - ContinuousIntegration, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "pullRequest")] - PullRequest, - } + use super::*; + #[doc = "Gets reason for release."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Reason { + #[serde(rename = "none")] + None, + #[serde(rename = "manual")] + Manual, + #[serde(rename = "continuousIntegration")] + ContinuousIntegration, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "pullRequest")] + PullRequest, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseRevision { - #[doc = ""] - #[serde(rename = "changedBy", default, skip_serializing_if = "Option::is_none")] - pub changed_by: Option<IdentityRef>, - #[doc = "Change date of the revision."] - #[serde( - rename = "changedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub changed_date: Option<time::OffsetDateTime>, - #[doc = "Change details of the revision."] - #[serde( - rename = "changeDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_details: Option<String>, - #[doc = "Change details of the revision. Typically ChangeDetails values are Add and Update."] - #[serde( - rename = "changeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_type: Option<String>, - #[doc = "Comment of the revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Release ID of which this revision belongs."] - #[serde( - rename = "definitionSnapshotRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_snapshot_revision: Option<i32>, - #[doc = "Gets or sets the release ID of which this revision belongs."] - #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] - pub release_id: Option<i32>, + #[doc = ""] + #[serde(rename = "changedBy", default, skip_serializing_if = "Option::is_none")] + pub changed_by: Option<IdentityRef>, + #[doc = "Change date of the revision."] + #[serde( + rename = "changedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub changed_date: Option<time::OffsetDateTime>, + #[doc = "Change details of the revision."] + #[serde( + rename = "changeDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_details: Option<String>, + #[doc = "Change details of the revision. Typically ChangeDetails values are Add and Update."] + #[serde( + rename = "changeType", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_type: Option<String>, + #[doc = "Comment of the revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Release ID of which this revision belongs."] + #[serde( + rename = "definitionSnapshotRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_snapshot_revision: Option<i32>, + #[doc = "Gets or sets the release ID of which this revision belongs."] + #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] + pub release_id: Option<i32>, } impl ReleaseRevision { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseSchedule { - #[doc = "Days of the week to release."] - #[serde( - rename = "daysToRelease", - default, - skip_serializing_if = "Option::is_none" - )] - pub days_to_release: Option<release_schedule::DaysToRelease>, - #[doc = "Team Foundation Job Definition Job Id."] - #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] - pub job_id: Option<String>, - #[doc = "Flag to determine if this schedule should only release if the associated artifact has been changed or release definition changed."] - #[serde( - rename = "scheduleOnlyWithChanges", - default, - skip_serializing_if = "Option::is_none" - )] - pub schedule_only_with_changes: Option<bool>, - #[doc = "Local time zone hour to start."] - #[serde( - rename = "startHours", - default, - skip_serializing_if = "Option::is_none" - )] - pub start_hours: Option<i32>, - #[doc = "Local time zone minute to start."] - #[serde( - rename = "startMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub start_minutes: Option<i32>, - #[doc = "Time zone Id of release schedule, such as 'UTC'."] - #[serde( - rename = "timeZoneId", - default, - skip_serializing_if = "Option::is_none" - )] - pub time_zone_id: Option<String>, + #[doc = "Days of the week to release."] + #[serde( + rename = "daysToRelease", + default, + skip_serializing_if = "Option::is_none" + )] + pub days_to_release: Option<release_schedule::DaysToRelease>, + #[doc = "Team Foundation Job Definition Job Id."] + #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")] + pub job_id: Option<String>, + #[doc = "Flag to determine if this schedule should only release if the associated artifact has been changed or release definition changed."] + #[serde( + rename = "scheduleOnlyWithChanges", + default, + skip_serializing_if = "Option::is_none" + )] + pub schedule_only_with_changes: Option<bool>, + #[doc = "Local time zone hour to start."] + #[serde( + rename = "startHours", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_hours: Option<i32>, + #[doc = "Local time zone minute to start."] + #[serde( + rename = "startMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_minutes: Option<i32>, + #[doc = "Time zone Id of release schedule, such as 'UTC'."] + #[serde( + rename = "timeZoneId", + default, + skip_serializing_if = "Option::is_none" + )] + pub time_zone_id: Option<String>, } impl ReleaseSchedule { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_schedule { - use super::*; - #[doc = "Days of the week to release."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DaysToRelease { - #[serde(rename = "none")] - None, - #[serde(rename = "monday")] - Monday, - #[serde(rename = "tuesday")] - Tuesday, - #[serde(rename = "wednesday")] - Wednesday, - #[serde(rename = "thursday")] - Thursday, - #[serde(rename = "friday")] - Friday, - #[serde(rename = "saturday")] - Saturday, - #[serde(rename = "sunday")] - Sunday, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "Days of the week to release."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DaysToRelease { + #[serde(rename = "none")] + None, + #[serde(rename = "monday")] + Monday, + #[serde(rename = "tuesday")] + Tuesday, + #[serde(rename = "wednesday")] + Wednesday, + #[serde(rename = "thursday")] + Thursday, + #[serde(rename = "friday")] + Friday, + #[serde(rename = "saturday")] + Saturday, + #[serde(rename = "sunday")] + Sunday, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseSettings { - #[doc = ""] - #[serde( - rename = "complianceSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub compliance_settings: Option<ComplianceSettings>, - #[doc = ""] - #[serde( - rename = "retentionSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub retention_settings: Option<RetentionSettings>, + #[doc = ""] + #[serde( + rename = "complianceSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub compliance_settings: Option<ComplianceSettings>, + #[doc = ""] + #[serde( + rename = "retentionSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub retention_settings: Option<RetentionSettings>, } impl ReleaseSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseShallowReference { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Gets the unique identifier of release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Gets or sets the name of the release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets the REST API url to access the release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Gets the unique identifier of release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Gets or sets the name of the release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets the REST API url to access the release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ReleaseShallowReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseStartEnvironmentMetadata { - #[doc = "Sets release definition environment id."] - #[serde( - rename = "definitionEnvironmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_environment_id: Option<i32>, - #[doc = "Sets list of environments variables to be overridden at deployment time."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[doc = "Sets release definition environment id."] + #[serde( + rename = "definitionEnvironmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_environment_id: Option<i32>, + #[doc = "Sets list of environments variables to be overridden at deployment time."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl ReleaseStartEnvironmentMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseStartMetadata { - #[doc = "Sets list of artifact to create a release."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub artifacts: Vec<ArtifactMetadata>, - #[doc = "Sets definition Id to create a release."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "Sets description to create a release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Sets list of environments meta data."] - #[serde( - rename = "environmentsMetadata", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub environments_metadata: Vec<ReleaseStartEnvironmentMetadata>, - #[doc = "Sets 'true' to create release in draft mode, 'false' otherwise."] - #[serde(rename = "isDraft", default, skip_serializing_if = "Option::is_none")] - pub is_draft: Option<bool>, - #[doc = "Sets list of environments to manual as condition."] - #[serde( - rename = "manualEnvironments", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub manual_environments: Vec<String>, - #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<PropertiesCollection>, - #[doc = "Sets reason to create a release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option<release_start_metadata::Reason>, - #[doc = "Sets list of release variables to be overridden at deployment time."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[doc = "Sets list of artifact to create a release."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub artifacts: Vec<ArtifactMetadata>, + #[doc = "Sets definition Id to create a release."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "Sets description to create a release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Sets list of environments meta data."] + #[serde( + rename = "environmentsMetadata", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub environments_metadata: Vec<ReleaseStartEnvironmentMetadata>, + #[doc = "Sets 'true' to create release in draft mode, 'false' otherwise."] + #[serde(rename = "isDraft", default, skip_serializing_if = "Option::is_none")] + pub is_draft: Option<bool>, + #[doc = "Sets list of environments to manual as condition."] + #[serde( + rename = "manualEnvironments", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub manual_environments: Vec<String>, + #[doc = "The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a `TypeCode != TypeCode.Object`) except for `DBNull` are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<PropertiesCollection>, + #[doc = "Sets reason to create a release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option<release_start_metadata::Reason>, + #[doc = "Sets list of release variables to be overridden at deployment time."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl ReleaseStartMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_start_metadata { - use super::*; - #[doc = "Sets reason to create a release."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Reason { - #[serde(rename = "none")] - None, - #[serde(rename = "manual")] - Manual, - #[serde(rename = "continuousIntegration")] - ContinuousIntegration, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "pullRequest")] - PullRequest, - } + use super::*; + #[doc = "Sets reason to create a release."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Reason { + #[serde(rename = "none")] + None, + #[serde(rename = "manual")] + Manual, + #[serde(rename = "continuousIntegration")] + ContinuousIntegration, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "pullRequest")] + PullRequest, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseTask { - #[doc = "Agent name on which task executed."] - #[serde(rename = "agentName", default, skip_serializing_if = "Option::is_none")] - pub agent_name: Option<String>, - #[doc = "Finish time of the release task."] - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = "ID of the release task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "List of issues occurred while execution of task."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub issues: Vec<Issue>, - #[doc = "Number of lines log release task has."] - #[serde(rename = "lineCount", default, skip_serializing_if = "Option::is_none")] - pub line_count: Option<i64>, - #[doc = "Log URL of the task."] - #[serde(rename = "logUrl", default, skip_serializing_if = "Option::is_none")] - pub log_url: Option<String>, - #[doc = "Name of the task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Task execution complete precent."] - #[serde( - rename = "percentComplete", - default, - skip_serializing_if = "Option::is_none" - )] - pub percent_complete: Option<i32>, - #[doc = "Rank of the release task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option<i32>, - #[doc = "Result code of the task."] - #[serde( - rename = "resultCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_code: Option<String>, - #[doc = "ID of the release task."] - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, - #[doc = "Status of release task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<release_task::Status>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub task: Option<WorkflowTaskReference>, - #[doc = "Timeline record ID of the release task."] - #[serde( - rename = "timelineRecordId", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeline_record_id: Option<String>, + #[doc = "Agent name on which task executed."] + #[serde(rename = "agentName", default, skip_serializing_if = "Option::is_none")] + pub agent_name: Option<String>, + #[doc = "Finish time of the release task."] + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[doc = "ID of the release task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "List of issues occurred while execution of task."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub issues: Vec<Issue>, + #[doc = "Number of lines log release task has."] + #[serde(rename = "lineCount", default, skip_serializing_if = "Option::is_none")] + pub line_count: Option<i64>, + #[doc = "Log URL of the task."] + #[serde(rename = "logUrl", default, skip_serializing_if = "Option::is_none")] + pub log_url: Option<String>, + #[doc = "Name of the task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Task execution complete precent."] + #[serde( + rename = "percentComplete", + default, + skip_serializing_if = "Option::is_none" + )] + pub percent_complete: Option<i32>, + #[doc = "Rank of the release task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option<i32>, + #[doc = "Result code of the task."] + #[serde( + rename = "resultCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_code: Option<String>, + #[doc = "ID of the release task."] + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, + #[doc = "Status of release task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<release_task::Status>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub task: Option<WorkflowTaskReference>, + #[doc = "Timeline record ID of the release task."] + #[serde( + rename = "timelineRecordId", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeline_record_id: Option<String>, } impl ReleaseTask { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_task { - use super::*; - #[doc = "Status of release task."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "success")] - Success, - #[serde(rename = "failure")] - Failure, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "partiallySucceeded")] - PartiallySucceeded, - } + use super::*; + #[doc = "Status of release task."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "success")] + Success, + #[serde(rename = "failure")] + Failure, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "partiallySucceeded")] + PartiallySucceeded, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseTaskAttachment { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Data and time when it created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "Data and time when modified."] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Name of the task attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Record ID of the task."] - #[serde(rename = "recordId", default, skip_serializing_if = "Option::is_none")] - pub record_id: Option<String>, - #[doc = "Timeline ID of the task."] - #[serde( - rename = "timelineId", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeline_id: Option<String>, - #[doc = "Type of task attachment."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Data and time when it created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "Data and time when modified."] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Name of the task attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Record ID of the task."] + #[serde(rename = "recordId", default, skip_serializing_if = "Option::is_none")] + pub record_id: Option<String>, + #[doc = "Timeline ID of the task."] + #[serde( + rename = "timelineId", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeline_id: Option<String>, + #[doc = "Type of task attachment."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl ReleaseTaskAttachment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseTaskAttachmentList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ReleaseTaskAttachment>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ReleaseTaskAttachment>, } impl ReleaseTaskAttachmentList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseTaskLogUpdatedEvent { - #[serde(flatten)] - pub realtime_release_event: RealtimeReleaseEvent, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub lines: Vec<String>, - #[serde( - rename = "stepRecordId", - default, - skip_serializing_if = "Option::is_none" - )] - pub step_record_id: Option<String>, - #[serde( - rename = "timelineRecordId", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeline_record_id: Option<String>, + #[serde(flatten)] + pub realtime_release_event: RealtimeReleaseEvent, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub lines: Vec<String>, + #[serde( + rename = "stepRecordId", + default, + skip_serializing_if = "Option::is_none" + )] + pub step_record_id: Option<String>, + #[serde( + rename = "timelineRecordId", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeline_record_id: Option<String>, } impl ReleaseTaskLogUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseTasksUpdatedEvent { - #[serde(flatten)] - pub realtime_release_event: RealtimeReleaseEvent, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job: Option<ReleaseTask>, - #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] - pub plan_id: Option<String>, - #[serde( - rename = "releaseStepId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_step_id: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tasks: Vec<ReleaseTask>, + #[serde(flatten)] + pub realtime_release_event: RealtimeReleaseEvent, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub job: Option<ReleaseTask>, + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option<String>, + #[serde( + rename = "releaseStepId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_step_id: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tasks: Vec<ReleaseTask>, } impl ReleaseTasksUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseTriggerBase { - #[doc = "Type of release trigger."] - #[serde( - rename = "triggerType", - default, - skip_serializing_if = "Option::is_none" - )] - pub trigger_type: Option<release_trigger_base::TriggerType>, + #[doc = "Type of release trigger."] + #[serde( + rename = "triggerType", + default, + skip_serializing_if = "Option::is_none" + )] + pub trigger_type: Option<release_trigger_base::TriggerType>, } impl ReleaseTriggerBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_trigger_base { - use super::*; - #[doc = "Type of release trigger."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TriggerType { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "artifactSource")] - ArtifactSource, - #[serde(rename = "schedule")] - Schedule, - #[serde(rename = "sourceRepo")] - SourceRepo, - #[serde(rename = "containerImage")] - ContainerImage, - #[serde(rename = "package")] - Package, - #[serde(rename = "pullRequest")] - PullRequest, - } + use super::*; + #[doc = "Type of release trigger."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum TriggerType { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "artifactSource")] + ArtifactSource, + #[serde(rename = "schedule")] + Schedule, + #[serde(rename = "sourceRepo")] + SourceRepo, + #[serde(rename = "containerImage")] + ContainerImage, + #[serde(rename = "package")] + Package, + #[serde(rename = "pullRequest")] + PullRequest, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseUpdateMetadata { - #[doc = "Sets comment for release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Set 'true' to exclude the release from retention policies."] - #[serde( - rename = "keepForever", - default, - skip_serializing_if = "Option::is_none" - )] - pub keep_forever: Option<bool>, - #[doc = "Sets list of manual environments."] - #[serde( - rename = "manualEnvironments", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub manual_environments: Vec<String>, - #[doc = "Sets name of the release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Sets status of the release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<release_update_metadata::Status>, + #[doc = "Sets comment for release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Set 'true' to exclude the release from retention policies."] + #[serde( + rename = "keepForever", + default, + skip_serializing_if = "Option::is_none" + )] + pub keep_forever: Option<bool>, + #[doc = "Sets list of manual environments."] + #[serde( + rename = "manualEnvironments", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub manual_environments: Vec<String>, + #[doc = "Sets name of the release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Sets status of the release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<release_update_metadata::Status>, } impl ReleaseUpdateMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod release_update_metadata { - use super::*; - #[doc = "Sets status of the release."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "undefined")] - Undefined, - #[serde(rename = "draft")] - Draft, - #[serde(rename = "active")] - Active, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[doc = "Sets status of the release."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "undefined")] + Undefined, + #[serde(rename = "draft")] + Draft, + #[serde(rename = "active")] + Active, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseUpdatedEvent { - #[serde(flatten)] - pub realtime_release_event: RealtimeReleaseEvent, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<Release>, + #[serde(flatten)] + pub realtime_release_event: RealtimeReleaseEvent, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<Release>, } impl ReleaseUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseWorkItemRef { - #[doc = "Gets or sets the ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Gets or sets the provider."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub provider: Option<String>, - #[doc = "Gets or sets the state."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "Gets or sets the title."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[doc = "Gets or sets the type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "Gets or sets the workitem url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Gets or sets the ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Gets or sets the provider."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option<String>, + #[doc = "Gets or sets the state."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "Gets or sets the title."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[doc = "Gets or sets the type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "Gets or sets the workitem url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ReleaseWorkItemRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to a resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceReference { - #[doc = "An alias to be used when referencing the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub alias: Option<String>, + #[doc = "An alias to be used when referencing the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, } impl ResourceReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetentionPolicy { - #[doc = "Indicates the number of days to keep deployment."] - #[serde( - rename = "daysToKeep", - default, - skip_serializing_if = "Option::is_none" - )] - pub days_to_keep: Option<i32>, + #[doc = "Indicates the number of days to keep deployment."] + #[serde( + rename = "daysToKeep", + default, + skip_serializing_if = "Option::is_none" + )] + pub days_to_keep: Option<i32>, } impl RetentionPolicy { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RetentionSettings { - #[doc = "Number of days to keep deleted releases."] - #[serde( - rename = "daysToKeepDeletedReleases", - default, - skip_serializing_if = "Option::is_none" - )] - pub days_to_keep_deleted_releases: Option<i32>, - #[doc = ""] - #[serde( - rename = "defaultEnvironmentRetentionPolicy", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_environment_retention_policy: Option<EnvironmentRetentionPolicy>, - #[doc = ""] - #[serde( - rename = "maximumEnvironmentRetentionPolicy", - default, - skip_serializing_if = "Option::is_none" - )] - pub maximum_environment_retention_policy: Option<EnvironmentRetentionPolicy>, + #[doc = "Number of days to keep deleted releases."] + #[serde( + rename = "daysToKeepDeletedReleases", + default, + skip_serializing_if = "Option::is_none" + )] + pub days_to_keep_deleted_releases: Option<i32>, + #[doc = ""] + #[serde( + rename = "defaultEnvironmentRetentionPolicy", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_environment_retention_policy: Option<EnvironmentRetentionPolicy>, + #[doc = ""] + #[serde( + rename = "maximumEnvironmentRetentionPolicy", + default, + skip_serializing_if = "Option::is_none" + )] + pub maximum_environment_retention_policy: Option<EnvironmentRetentionPolicy>, } impl RetentionSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunOnServerDeployPhase { - #[serde(flatten)] - pub deploy_phase: DeployPhase, - #[doc = ""] - #[serde( - rename = "deploymentInput", - default, - skip_serializing_if = "Option::is_none" - )] - pub deployment_input: Option<ServerDeploymentInput>, + #[serde(flatten)] + pub deploy_phase: DeployPhase, + #[doc = ""] + #[serde( + rename = "deploymentInput", + default, + skip_serializing_if = "Option::is_none" + )] + pub deployment_input: Option<ServerDeploymentInput>, } impl RunOnServerDeployPhase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ScheduledReleaseTrigger { - #[serde(flatten)] - pub release_trigger_base: ReleaseTriggerBase, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedule: Option<ReleaseSchedule>, + #[serde(flatten)] + pub release_trigger_base: ReleaseTriggerBase, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub schedule: Option<ReleaseSchedule>, } impl ScheduledReleaseTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServerDeploymentInput { - #[serde(flatten)] - pub base_deployment_input: BaseDeploymentInput, - #[doc = ""] - #[serde( - rename = "parallelExecution", - default, - skip_serializing_if = "Option::is_none" - )] - pub parallel_execution: Option<ExecutionInput>, + #[serde(flatten)] + pub base_deployment_input: BaseDeploymentInput, + #[doc = ""] + #[serde( + rename = "parallelExecution", + default, + skip_serializing_if = "Option::is_none" + )] + pub parallel_execution: Option<ExecutionInput>, } impl ServerDeploymentInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reference to a service endpoint."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointReference { - #[serde(flatten)] - pub resource_reference: ResourceReference, - #[doc = "The ID of the service endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[serde(flatten)] + pub resource_reference: ResourceReference, + #[doc = "The ID of the service endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl ServiceEndpointReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceIdInput { - #[doc = "ID of source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "ID of source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl SourceIdInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourcePullRequestVersion { - #[doc = "Pull Request Iteration Id for which the release will publish status."] - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<String>, - #[doc = "Pull Request Id for which the release will publish status."] - #[serde( - rename = "pullRequestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_id: Option<String>, - #[doc = "Date and time of the pull request merge creation. It is required to keep timeline record of Releases created by pull request."] - #[serde( - rename = "pullRequestMergedAt", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub pull_request_merged_at: Option<time::OffsetDateTime>, - #[doc = "Source branch of the Pull Request."] - #[serde( - rename = "sourceBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_branch: Option<String>, - #[doc = "Source branch commit Id of the Pull Request for which the release will publish status."] - #[serde( - rename = "sourceBranchCommitId", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_branch_commit_id: Option<String>, - #[doc = "Target branch of the Pull Request."] - #[serde( - rename = "targetBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_branch: Option<String>, + #[doc = "Pull Request Iteration Id for which the release will publish status."] + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<String>, + #[doc = "Pull Request Id for which the release will publish status."] + #[serde( + rename = "pullRequestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_id: Option<String>, + #[doc = "Date and time of the pull request merge creation. It is required to keep timeline record of Releases created by pull request."] + #[serde( + rename = "pullRequestMergedAt", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub pull_request_merged_at: Option<time::OffsetDateTime>, + #[doc = "Source branch of the Pull Request."] + #[serde( + rename = "sourceBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_branch: Option<String>, + #[doc = "Source branch commit Id of the Pull Request for which the release will publish status."] + #[serde( + rename = "sourceBranchCommitId", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_branch_commit_id: Option<String>, + #[doc = "Target branch of the Pull Request."] + #[serde( + rename = "targetBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_branch: Option<String>, } impl SourcePullRequestVersion { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceRepoTrigger { - #[serde(flatten)] - pub release_trigger_base: ReleaseTriggerBase, - #[doc = "Alias of the source repo trigger."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub alias: Option<String>, - #[serde( - rename = "branchFilters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub branch_filters: Vec<String>, + #[serde(flatten)] + pub release_trigger_base: ReleaseTriggerBase, + #[doc = "Alias of the source repo trigger."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub alias: Option<String>, + #[serde( + rename = "branchFilters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub branch_filters: Vec<String>, } impl SourceRepoTrigger { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SummaryMailSection { - #[doc = "Html content of summary mail."] - #[serde( - rename = "htmlContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub html_content: Option<String>, - #[doc = "Rank of the summary mail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option<i32>, - #[doc = "Summary mail section type. MailSectionType has section types."] - #[serde( - rename = "sectionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub section_type: Option<summary_mail_section::SectionType>, - #[doc = "Title of the summary mail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, + #[doc = "Html content of summary mail."] + #[serde( + rename = "htmlContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub html_content: Option<String>, + #[doc = "Rank of the summary mail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option<i32>, + #[doc = "Summary mail section type. MailSectionType has section types."] + #[serde( + rename = "sectionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub section_type: Option<summary_mail_section::SectionType>, + #[doc = "Title of the summary mail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, } impl SummaryMailSection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod summary_mail_section { - use super::*; - #[doc = "Summary mail section type. MailSectionType has section types."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SectionType { - #[serde(rename = "details")] - Details, - #[serde(rename = "environments")] - Environments, - #[serde(rename = "issues")] - Issues, - #[serde(rename = "testResults")] - TestResults, - #[serde(rename = "workItems")] - WorkItems, - #[serde(rename = "releaseInfo")] - ReleaseInfo, - } + use super::*; + #[doc = "Summary mail section type. MailSectionType has section types."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SectionType { + #[serde(rename = "details")] + Details, + #[serde(rename = "environments")] + Environments, + #[serde(rename = "issues")] + Issues, + #[serde(rename = "testResults")] + TestResults, + #[serde(rename = "workItems")] + WorkItems, + #[serde(rename = "releaseInfo")] + ReleaseInfo, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TagFilter { - #[doc = "Gets or sets the tag filter pattern."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pattern: Option<String>, + #[doc = "Gets or sets the tag filter pattern."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pattern: Option<String>, } impl TagFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskInputDefinitionBase { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub aliases: Vec<String>, - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<String>, - #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] - pub group_name: Option<String>, - #[serde( - rename = "helpMarkDown", - default, - skip_serializing_if = "Option::is_none" - )] - pub help_mark_down: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub label: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub options: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub required: Option<bool>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub validation: Option<TaskInputValidation>, - #[serde( - rename = "visibleRule", - default, - skip_serializing_if = "Option::is_none" - )] - pub visible_rule: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub aliases: Vec<String>, + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<String>, + #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] + pub group_name: Option<String>, + #[serde( + rename = "helpMarkDown", + default, + skip_serializing_if = "Option::is_none" + )] + pub help_mark_down: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub options: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub required: Option<bool>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub validation: Option<TaskInputValidation>, + #[serde( + rename = "visibleRule", + default, + skip_serializing_if = "Option::is_none" + )] + pub visible_rule: Option<String>, } impl TaskInputDefinitionBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskInputValidation { - #[doc = "Conditional expression"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub expression: Option<String>, - #[doc = "Message explaining how user can correct if validation fails"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, + #[doc = "Conditional expression"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub expression: Option<String>, + #[doc = "Message explaining how user can correct if validation fails"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, } impl TaskInputValidation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationPlanGroupReference { - #[doc = "Gets or sets the plan group."] - #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] - pub plan_group: Option<String>, - #[doc = "ID of the Project."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, + #[doc = "Gets or sets the plan group."] + #[serde(rename = "planGroup", default, skip_serializing_if = "Option::is_none")] + pub plan_group: Option<String>, + #[doc = "ID of the Project."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, } impl TaskOrchestrationPlanGroupReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskOrchestrationPlanGroupsStartedEvent { - #[serde( - rename = "planGroups", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub plan_groups: Vec<TaskOrchestrationPlanGroupReference>, + #[serde( + rename = "planGroups", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub plan_groups: Vec<TaskOrchestrationPlanGroupReference>, } impl TaskOrchestrationPlanGroupsStartedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskSourceDefinitionBase { - #[serde(rename = "authKey", default, skip_serializing_if = "Option::is_none")] - pub auth_key: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub endpoint: Option<String>, - #[serde( - rename = "keySelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub key_selector: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub selector: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<String>, + #[serde(rename = "authKey", default, skip_serializing_if = "Option::is_none")] + pub auth_key: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub endpoint: Option<String>, + #[serde( + rename = "keySelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub key_selector: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub selector: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<String>, } impl TaskSourceDefinitionBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcArtifactDownloadInput { - #[serde(flatten)] - pub artifact_download_input_base: ArtifactDownloadInputBase, + #[serde(flatten)] + pub artifact_download_input_base: ArtifactDownloadInputBase, } impl TfvcArtifactDownloadInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimeZone { - #[doc = "Display name of the time zone."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Id of the time zone."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[doc = "Display name of the time zone."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Id of the time zone."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl TimeZone { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimeZoneList { - #[doc = ""] - #[serde( - rename = "utcTimeZone", - default, - skip_serializing_if = "Option::is_none" - )] - pub utc_time_zone: Option<TimeZone>, - #[doc = "List of valid timezones."] - #[serde( - rename = "validTimeZones", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub valid_time_zones: Vec<TimeZone>, + #[doc = ""] + #[serde( + rename = "utcTimeZone", + default, + skip_serializing_if = "Option::is_none" + )] + pub utc_time_zone: Option<TimeZone>, + #[doc = "List of valid timezones."] + #[serde( + rename = "validTimeZones", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub valid_time_zones: Vec<TimeZone>, } impl TimeZoneList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableGroup { - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Gets date on which it got created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Gets or sets description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Gets the unique identifier of this field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Denotes if a variable group is shared with other project or not."] - #[serde(rename = "isShared", default, skip_serializing_if = "Option::is_none")] - pub is_shared: Option<bool>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "Gets date on which it got modified."] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Gets or sets name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde( - rename = "providerData", - default, - skip_serializing_if = "Option::is_none" - )] - pub provider_data: Option<VariableGroupProviderData>, - #[doc = "Gets or sets type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "all project references where the variable group is shared with other projects."] - #[serde( - rename = "variableGroupProjectReferences", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub variable_group_project_references: Vec<VariableGroupProjectReference>, - #[doc = "Gets and sets the dictionary of variables."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub variables: Option<serde_json::Value>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "Gets date on which it got created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Gets or sets description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Gets the unique identifier of this field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Denotes if a variable group is shared with other project or not."] + #[serde(rename = "isShared", default, skip_serializing_if = "Option::is_none")] + pub is_shared: Option<bool>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "Gets date on which it got modified."] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Gets or sets name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde( + rename = "providerData", + default, + skip_serializing_if = "Option::is_none" + )] + pub provider_data: Option<VariableGroupProviderData>, + #[doc = "Gets or sets type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "all project references where the variable group is shared with other projects."] + #[serde( + rename = "variableGroupProjectReferences", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub variable_group_project_references: Vec<VariableGroupProjectReference>, + #[doc = "Gets and sets the dictionary of variables."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option<serde_json::Value>, } impl VariableGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A variable group reference is a shallow reference to variable group."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableGroupProjectReference { - #[doc = "Gets or sets description of the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Gets or sets name of the variable group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde( - rename = "projectReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_reference: Option<ProjectReference>, + #[doc = "Gets or sets description of the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Gets or sets name of the variable group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde( + rename = "projectReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_reference: Option<ProjectReference>, } impl VariableGroupProjectReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableGroupProviderData {} impl VariableGroupProviderData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VariableValue { - #[doc = "Gets or sets if the variable is read only or not."] - #[serde( - rename = "isReadOnly", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_read_only: Option<bool>, - #[doc = "Gets or sets as the variable is secret or not."] - #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] - pub is_secret: Option<bool>, - #[doc = "Gets or sets the value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Gets or sets if the variable is read only or not."] + #[serde( + rename = "isReadOnly", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_read_only: Option<bool>, + #[doc = "Gets or sets as the variable is secret or not."] + #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] + pub is_secret: Option<bool>, + #[doc = "Gets or sets the value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VariableValue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkflowTask { - #[doc = "Gets or sets as the task always run or not."] - #[serde(rename = "alwaysRun", default, skip_serializing_if = "Option::is_none")] - pub always_run: Option<bool>, - #[doc = "Gets or sets the task condition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub condition: Option<String>, - #[doc = "Gets or sets as the task continue run on error or not."] - #[serde( - rename = "continueOnError", - default, - skip_serializing_if = "Option::is_none" - )] - pub continue_on_error: Option<bool>, - #[doc = "Gets or sets the task definition type. Example:- 'Agent', DeploymentGroup', 'Server' or 'ServerGate'."] - #[serde( - rename = "definitionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_type: Option<String>, - #[doc = "Gets or sets as the task enabled or not."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option<bool>, - #[doc = "Gets or sets the task environment variables."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option<serde_json::Value>, - #[doc = "Gets or sets the task inputs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option<serde_json::Value>, - #[doc = "Gets or sets the name of the task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the task override inputs."] - #[serde( - rename = "overrideInputs", - default, - skip_serializing_if = "Option::is_none" - )] - pub override_inputs: Option<serde_json::Value>, - #[doc = "Gets or sets the reference name of the task."] - #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] - pub ref_name: Option<String>, - #[doc = "Gets or sets the task retryCount."] - #[serde( - rename = "retryCountOnTaskFailure", - default, - skip_serializing_if = "Option::is_none" - )] - pub retry_count_on_task_failure: Option<i32>, - #[doc = "Gets or sets the ID of the task."] - #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] - pub task_id: Option<String>, - #[doc = "Gets or sets the task timeout."] - #[serde( - rename = "timeoutInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub timeout_in_minutes: Option<i32>, - #[doc = "Gets or sets the version of the task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Gets or sets as the task always run or not."] + #[serde(rename = "alwaysRun", default, skip_serializing_if = "Option::is_none")] + pub always_run: Option<bool>, + #[doc = "Gets or sets the task condition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub condition: Option<String>, + #[doc = "Gets or sets as the task continue run on error or not."] + #[serde( + rename = "continueOnError", + default, + skip_serializing_if = "Option::is_none" + )] + pub continue_on_error: Option<bool>, + #[doc = "Gets or sets the task definition type. Example:- 'Agent', DeploymentGroup', 'Server' or 'ServerGate'."] + #[serde( + rename = "definitionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_type: Option<String>, + #[doc = "Gets or sets as the task enabled or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option<bool>, + #[doc = "Gets or sets the task environment variables."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option<serde_json::Value>, + #[doc = "Gets or sets the task inputs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inputs: Option<serde_json::Value>, + #[doc = "Gets or sets the name of the task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the task override inputs."] + #[serde( + rename = "overrideInputs", + default, + skip_serializing_if = "Option::is_none" + )] + pub override_inputs: Option<serde_json::Value>, + #[doc = "Gets or sets the reference name of the task."] + #[serde(rename = "refName", default, skip_serializing_if = "Option::is_none")] + pub ref_name: Option<String>, + #[doc = "Gets or sets the task retryCount."] + #[serde( + rename = "retryCountOnTaskFailure", + default, + skip_serializing_if = "Option::is_none" + )] + pub retry_count_on_task_failure: Option<i32>, + #[doc = "Gets or sets the ID of the task."] + #[serde(rename = "taskId", default, skip_serializing_if = "Option::is_none")] + pub task_id: Option<String>, + #[doc = "Gets or sets the task timeout."] + #[serde( + rename = "timeoutInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub timeout_in_minutes: Option<i32>, + #[doc = "Gets or sets the version of the task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl WorkflowTask { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkflowTaskReference { - #[doc = "Task identifier."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Version of the task."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Task identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Version of the task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl WorkflowTaskReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct YamlFileSource { - #[doc = "Gets or sets definition reference. e.g. {\"project\":{\"id\":\"fed755ea-49c5-4399-acea-fd5b5aa90a6c\",\"name\":\"myProject\"},\"definition\":{\"id\":\"1\",\"name\":\"mybuildDefinition\"},\"connection\":{\"id\":\"1\",\"name\":\"myConnection\"}}"] - #[serde( - rename = "sourceReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_reference: Option<serde_json::Value>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<yaml_file_source::Type>, + #[doc = "Gets or sets definition reference. e.g. {\"project\":{\"id\":\"fed755ea-49c5-4399-acea-fd5b5aa90a6c\",\"name\":\"myProject\"},\"definition\":{\"id\":\"1\",\"name\":\"mybuildDefinition\"},\"connection\":{\"id\":\"1\",\"name\":\"myConnection\"}}"] + #[serde( + rename = "sourceReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_reference: Option<serde_json::Value>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<yaml_file_source::Type>, } impl YamlFileSource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod yaml_file_source { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "none")] - None, - #[serde(rename = "tfsGit")] - TfsGit, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "none")] + None, + #[serde(rename = "tfsGit")] + TfsGit, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct YamlPipelineProcess { - #[serde(flatten)] - pub pipeline_process: PipelineProcess, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub errors: Vec<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filename: Option<String>, - #[doc = ""] - #[serde( - rename = "fileSource", - default, - skip_serializing_if = "Option::is_none" - )] - pub file_source: Option<YamlFileSource>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option<YamlPipelineProcessResources>, + #[serde(flatten)] + pub pipeline_process: PipelineProcess, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub errors: Vec<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filename: Option<String>, + #[doc = ""] + #[serde( + rename = "fileSource", + default, + skip_serializing_if = "Option::is_none" + )] + pub file_source: Option<YamlFileSource>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resources: Option<YamlPipelineProcessResources>, } impl YamlPipelineProcess { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct YamlPipelineProcessResources { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub endpoints: Vec<ServiceEndpointReference>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub queues: Vec<AgentPoolQueueReference>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub endpoints: Vec<ServiceEndpointReference>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub queues: Vec<AgentPoolQueueReference>, } impl YamlPipelineProcessResources { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct YamlSourceReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl YamlSourceReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/search/mod.rs b/azure_devops_rust_api/src/search/mod.rs index 6d922bb6..c71240f3 100644 --- a/azure_devops_rust_api/src/search/mod.rs +++ b/azure_devops_rust_api/src/search/mod.rs @@ -9,933 +9,929 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://almsearch.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + 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()) + } +} +pub mod package_search_results { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Provides a set of results for the search text."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The Package Search Request."] + pub fn fetch_package_search_results( + &self, + organization: impl Into<String>, + body: impl Into<models::PackageSearchRequest>, + ) -> fetch_package_search_results::RequestBuilder { + fetch_package_search_results::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + } + pub mod fetch_package_search_results { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PackageSearchResponseContent> { + let bytes = self.0.into_body().collect().await?; + let body: models::PackageSearchResponseContent = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn activity_id(&self) -> azure_core::Result<&str> { self + .0 + .get_str(&azure_core::headers::HeaderName::from_static("activityid")) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PackageSearchRequest, } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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 RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/search/packagesearchresults", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } -} -pub mod package_search_results { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Provides a set of results for the search text."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The Package Search Request."] - pub fn fetch_package_search_results( - &self, - organization: impl Into<String>, - body: impl Into<models::PackageSearchRequest>, - ) -> fetch_package_search_results::RequestBuilder { - fetch_package_search_results::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - } - pub mod fetch_package_search_results { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::PackageSearchResponseContent> { - let bytes = self.0.into_body().collect().await?; - let body: models::PackageSearchResponseContent = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn activity_id(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("activityid")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PackageSearchRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/search/packagesearchresults", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PackageSearchResponseContent>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PackageSearchResponseContent>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PackageSearchResponseContent>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::PackageSearchResponseContent>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } pub mod code_search_results { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Provides a set of results for the search text."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The Code Search Request."] + #[doc = "* `project`: Project ID or project name"] + pub fn fetch_code_search_results( + &self, + organization: impl Into<String>, + body: impl Into<models::CodeSearchRequest>, + project: impl Into<String>, + ) -> 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 fetch_code_search_results { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Provides a set of results for the search text."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The Code Search Request."] - #[doc = "* `project`: Project ID or project name"] - pub fn fetch_code_search_results( - &self, - organization: impl Into<String>, - body: impl Into<models::CodeSearchRequest>, - project: impl Into<String>, - ) -> 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 fetch_code_search_results { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CodeSearchResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::CodeSearchResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CodeSearchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/search/codesearchresults", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CodeSearchResponse>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CodeSearchResponse>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CodeSearchResponse> { + let bytes = self.0.into_body().collect().await?; + let body: models::CodeSearchResponse = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CodeSearchRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/search/codesearchresults", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CodeSearchResponse>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CodeSearchResponse>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod repositories { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Provides status of Repository."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `repository`: Repository ID or repository name."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + repository: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + repository: repository.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Provides status of Repository."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `repository`: Repository ID or repository name."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - repository: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - repository: repository.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RepositoryStatusResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::RepositoryStatusResponse = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) repository: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/search/status/repositories/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.repository - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RepositoryStatusResponse>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::RepositoryStatusResponse>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RepositoryStatusResponse> { + let bytes = self.0.into_body().collect().await?; + let body: models::RepositoryStatusResponse = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) repository: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/search/status/repositories/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.repository + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RepositoryStatusResponse>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RepositoryStatusResponse>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod tfvc { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Provides status of TFVC Repository."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Provides status of TFVC Repository."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TfvcRepositoryStatusResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcRepositoryStatusResponse = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/search/status/tfvc", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcRepositoryStatusResponse>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TfvcRepositoryStatusResponse>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcRepositoryStatusResponse> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcRepositoryStatusResponse = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/search/status/tfvc", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcRepositoryStatusResponse>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::TfvcRepositoryStatusResponse>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod wiki_search_results { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Provides a set of results for the search request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The Wiki Search Request."] + #[doc = "* `project`: Project ID or project name"] + pub fn fetch_wiki_search_results( + &self, + organization: impl Into<String>, + body: impl Into<models::WikiSearchRequest>, + project: impl Into<String>, + ) -> 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 fetch_wiki_search_results { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Provides a set of results for the search request."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The Wiki Search Request."] - #[doc = "* `project`: Project ID or project name"] - pub fn fetch_wiki_search_results( - &self, - organization: impl Into<String>, - body: impl Into<models::WikiSearchRequest>, - project: impl Into<String>, - ) -> 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 fetch_wiki_search_results { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiSearchResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiSearchResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WikiSearchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/search/wikisearchresults", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiSearchResponse>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiSearchResponse>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiSearchResponse> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiSearchResponse = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WikiSearchRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/search/wikisearchresults", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiSearchResponse>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WikiSearchResponse>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod work_item_search_results { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Provides a set of results for the search text."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The Work Item Search Request."] + #[doc = "* `project`: Project ID or project name"] + pub fn fetch_work_item_search_results( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemSearchRequest>, + project: impl Into<String>, + ) -> 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(), + } + } + } + pub mod fetch_work_item_search_results { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Provides a set of results for the search text."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The Work Item Search Request."] - #[doc = "* `project`: Project ID or project name"] - pub fn fetch_work_item_search_results( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemSearchRequest>, - project: impl Into<String>, - ) -> 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(), - } - } - } - pub mod fetch_work_item_search_results { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemSearchResponse> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemSearchResponse = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemSearchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/search/workitemsearchresults", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemSearchResponse>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemSearchResponse>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemSearchResponse> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemSearchResponse = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WorkItemSearchRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/search/workitemsearchresults", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemSearchResponse>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemSearchResponse>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/search/models.rs b/azure_devops_rust_api/src/search/models.rs index 708819ce..d3de578d 100644 --- a/azure_devops_rust_api/src/search/models.rs +++ b/azure_devops_rust_api/src/search/models.rs @@ -8,968 +8,933 @@ use std::str::FromStr; #[doc = "Defines the Board result that matched a Board search request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardResult { - #[doc = "Board Type of the board document."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub boardtype: Option<String>, - #[doc = "Defines the details of the collection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub collection: Option<Collection>, - #[doc = "Defines the details of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<Project>, - #[doc = "Defines the details of the team."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub team: Option<Team>, + #[doc = "Board Type of the board document."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub boardtype: Option<String>, + #[doc = "Defines the details of the collection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub collection: Option<Collection>, + #[doc = "Defines the details of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<Project>, + #[doc = "Defines the details of the team."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub team: Option<Team>, } impl BoardResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a Board search request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardSearchRequest { - #[serde(flatten)] - pub entity_search_request: EntitySearchRequest, + #[serde(flatten)] + pub entity_search_request: EntitySearchRequest, } impl BoardSearchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a Board search response item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardSearchResponse { - #[serde(flatten)] - pub entity_search_response: EntitySearchResponse, - #[doc = "Total number of matched Board documents."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "List of top matched Board documents."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<BoardResult>, + #[serde(flatten)] + pub entity_search_response: EntitySearchResponse, + #[doc = "Total number of matched Board documents."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "List of top matched Board documents."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<BoardResult>, } impl BoardSearchResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Information about the configured branch."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BranchInfo { - #[doc = "Name of the indexed branch"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Name of the indexed branch"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl BranchInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the code result containing information of the searched files and its metadata."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CodeResult { - #[doc = "Defines the details of the collection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub collection: Option<Collection>, - #[doc = "ContentId of the result file."] - #[serde(rename = "contentId", default, skip_serializing_if = "Option::is_none")] - pub content_id: Option<String>, - #[doc = "Name of the result file."] - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[doc = "Dictionary of field to hit offsets in the result file. Key identifies the area in which hits were found, for ex: file content/file name etc."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub matches: Option<serde_json::Value>, - #[doc = "Path at which result file is present."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Defines the details of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<Project>, - #[doc = "Defines the details of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<Repository>, - #[doc = "Versions of the result file."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub versions: Vec<Version>, + #[doc = "Defines the details of the collection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub collection: Option<Collection>, + #[doc = "ContentId of the result file."] + #[serde(rename = "contentId", default, skip_serializing_if = "Option::is_none")] + pub content_id: Option<String>, + #[doc = "Name of the result file."] + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[doc = "Dictionary of field to hit offsets in the result file. Key identifies the area in which hits were found, for ex: file content/file name etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub matches: Option<serde_json::Value>, + #[doc = "Path at which result file is present."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Defines the details of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<Project>, + #[doc = "Defines the details of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<Repository>, + #[doc = "Versions of the result file."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub versions: Vec<Version>, } impl CodeResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a code search request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CodeSearchRequest { - #[serde(flatten)] - pub entity_search_request: EntitySearchRequest, - #[doc = "Flag to opt for including matched code snippet in the result. Default behavior is false."] - #[serde( - rename = "includeSnippet", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_snippet: Option<bool>, + #[serde(flatten)] + pub entity_search_request: EntitySearchRequest, + #[doc = "Flag to opt for including matched code snippet in the result. Default behavior is false."] + #[serde( + rename = "includeSnippet", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_snippet: Option<bool>, } impl CodeSearchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a code search response item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CodeSearchResponse { - #[serde(flatten)] - pub entity_search_response: EntitySearchResponse, - #[doc = "Total number of matched files."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "List of matched files."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<CodeResult>, + #[serde(flatten)] + pub entity_search_response: EntitySearchResponse, + #[doc = "Total number of matched files."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "List of matched files."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<CodeResult>, } impl CodeSearchResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the details of the collection."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Collection { - #[doc = "Name of the collection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Name of the collection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl Collection { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CustomRepositoryBranchStatusResponse { - #[serde( - rename = "lastIndexedChangeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_indexed_change_id: Option<i64>, - #[serde( - rename = "lastIndexedChangeIdChangeTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_indexed_change_id_change_time: Option<time::OffsetDateTime>, - #[serde( - rename = "latestChangeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_change_id: Option<i64>, - #[serde( - rename = "latestChangeIdChangeTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub latest_change_id_change_time: Option<time::OffsetDateTime>, -} -impl CustomRepositoryBranchStatusResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the custom repository status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomRepositoryStatusResponse { - #[doc = "Repository Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "List of indexed top level folders info."] - #[serde( - rename = "indexedTopLevelFolders", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub indexed_top_level_folders: Vec<DepotInfo>, - #[doc = "Repository Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Repository Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "List of indexed top level folders info."] + #[serde( + rename = "indexedTopLevelFolders", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub indexed_top_level_folders: Vec<DepotInfo>, + #[doc = "Repository Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl CustomRepositoryStatusResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Information about the custom repository indexing freshness for configured branches and depots."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DepotInfo { - #[doc = "Name of the indexed top level folder (depot)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Name of the indexed top level folder (depot)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl DepotInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Base contract for search request types without scroll support."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EntitySearchRequest { - #[serde(flatten)] - pub entity_search_request_base: EntitySearchRequestBase, - #[doc = "Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy."] - #[serde( - rename = "$orderBy", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub order_by: Vec<SortOption>, - #[doc = "Number of results to be skipped."] - #[serde(rename = "$skip", default, skip_serializing_if = "Option::is_none")] - pub skip: Option<i32>, - #[doc = "Number of results to be returned."] - #[serde(rename = "$top", default, skip_serializing_if = "Option::is_none")] - pub top: Option<i32>, - #[doc = "Flag to opt for faceting in the result. Default behavior is false."] - #[serde( - rename = "includeFacets", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_facets: Option<bool>, + #[serde(flatten)] + pub entity_search_request_base: EntitySearchRequestBase, + #[doc = "Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy."] + #[serde( + rename = "$orderBy", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub order_by: Vec<SortOption>, + #[doc = "Number of results to be skipped."] + #[serde(rename = "$skip", default, skip_serializing_if = "Option::is_none")] + pub skip: Option<i32>, + #[doc = "Number of results to be returned."] + #[serde(rename = "$top", default, skip_serializing_if = "Option::is_none")] + pub top: Option<i32>, + #[doc = "Flag to opt for faceting in the result. Default behavior is false."] + #[serde( + rename = "includeFacets", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_facets: Option<bool>, } impl EntitySearchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Base class for search request types."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EntitySearchRequestBase { - #[doc = "Filters to be applied. Set it to null if there are no filters to be applied."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filters: Option<serde_json::Value>, - #[doc = "The search text."] - #[serde( - rename = "searchText", - default, - skip_serializing_if = "Option::is_none" - )] - pub search_text: Option<String>, + #[doc = "Filters to be applied. Set it to null if there are no filters to be applied."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filters: Option<serde_json::Value>, + #[doc = "The search text."] + #[serde( + rename = "searchText", + default, + skip_serializing_if = "Option::is_none" + )] + pub search_text: Option<String>, } impl EntitySearchRequestBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the base contract for search response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EntitySearchResponse { - #[doc = "A dictionary storing an array of <code>Filter</code> object against each facet."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub facets: Option<serde_json::Value>, - #[doc = "Numeric code indicating any additional information: 0 - Ok, 1 - Account is being reindexed, 2 - Account indexing has not started, 3 - Invalid Request, 4 - Prefix wildcard query not supported, 5 - MultiWords with code facet not supported, 6 - Account is being onboarded, 7 - Account is being onboarded or reindexed, 8 - Top value trimmed to maxresult allowed 9 - Branches are being indexed, 10 - Faceting not enabled, 11 - Work items not accessible, 19 - Phrase queries with code type filters not supported, 20 - Wildcard queries with code type filters not supported. Any other info code is used for internal purpose."] - #[serde(rename = "infoCode", default, skip_serializing_if = "Option::is_none")] - pub info_code: Option<i32>, + #[doc = "A dictionary storing an array of <code>Filter</code> object against each facet."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub facets: Option<serde_json::Value>, + #[doc = "Numeric code indicating any additional information: 0 - Ok, 1 - Account is being reindexed, 2 - Account indexing has not started, 3 - Invalid Request, 4 - Prefix wildcard query not supported, 5 - MultiWords with code facet not supported, 6 - Account is being onboarded, 7 - Account is being onboarded or reindexed, 8 - Top value trimmed to maxresult allowed 9 - Branches are being indexed, 10 - Faceting not enabled, 11 - Work items not accessible, 19 - Phrase queries with code type filters not supported, 20 - Wildcard queries with code type filters not supported. Any other info code is used for internal purpose."] + #[serde(rename = "infoCode", default, skip_serializing_if = "Option::is_none")] + pub info_code: Option<i32>, } impl EntitySearchResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the details of a feed."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FeedInfo { - #[doc = "Id of the collection."] - #[serde( - rename = "collectionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub collection_id: Option<String>, - #[doc = "Name of the collection."] - #[serde( - rename = "collectionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub collection_name: Option<String>, - #[doc = "Id of the feed."] - #[serde(rename = "feedId", default, skip_serializing_if = "Option::is_none")] - pub feed_id: Option<String>, - #[doc = "Name of the feed."] - #[serde(rename = "feedName", default, skip_serializing_if = "Option::is_none")] - pub feed_name: Option<String>, - #[doc = "Latest matched version of package in this Feed."] - #[serde( - rename = "latestMatchedVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_matched_version: Option<String>, - #[doc = "Latest version of package in this Feed."] - #[serde( - rename = "latestVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_version: Option<String>, - #[doc = "Url of package in this Feed."] - #[serde( - rename = "packageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub package_url: Option<String>, - #[doc = "List of views which contain the matched package."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub views: Vec<String>, + #[doc = "Id of the collection."] + #[serde( + rename = "collectionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub collection_id: Option<String>, + #[doc = "Name of the collection."] + #[serde( + rename = "collectionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub collection_name: Option<String>, + #[doc = "Id of the feed."] + #[serde(rename = "feedId", default, skip_serializing_if = "Option::is_none")] + pub feed_id: Option<String>, + #[doc = "Name of the feed."] + #[serde(rename = "feedName", default, skip_serializing_if = "Option::is_none")] + pub feed_name: Option<String>, + #[doc = "Latest matched version of package in this Feed."] + #[serde( + rename = "latestMatchedVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_matched_version: Option<String>, + #[doc = "Latest version of package in this Feed."] + #[serde( + rename = "latestVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_version: Option<String>, + #[doc = "Url of package in this Feed."] + #[serde( + rename = "packageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub package_url: Option<String>, + #[doc = "List of views which contain the matched package."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub views: Vec<String>, } impl FeedInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a filter bucket item representing the total matches of search result, name and id."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Filter { - #[doc = "Id of the filter bucket."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the filter bucket."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Count of matches in the filter bucket."] - #[serde( - rename = "resultCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_count: Option<i32>, + #[doc = "Id of the filter bucket."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the filter bucket."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Count of matches in the filter bucket."] + #[serde( + rename = "resultCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_count: Option<i32>, } impl Filter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes the position of a piece of text in a document."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Hit { - #[doc = "Gets or sets the start character offset of a piece of text."] - #[serde( - rename = "charOffset", - default, - skip_serializing_if = "Option::is_none" - )] - pub char_offset: Option<i32>, - #[doc = "Gets or sets an extract of code where the match appears. Usually it is the line where there is the match."] - #[serde( - rename = "codeSnippet", - default, - skip_serializing_if = "Option::is_none" - )] - pub code_snippet: Option<String>, - #[doc = "Gets or sets the column number where the match appears in the line."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub column: Option<i32>, - #[doc = "Gets or sets the length of a piece of text."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub length: Option<i32>, - #[doc = "Gets or sets the line number where the match appears in the file."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub line: Option<i32>, - #[doc = "Gets or sets the name of type of a piece of text."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Gets or sets the start character offset of a piece of text."] + #[serde( + rename = "charOffset", + default, + skip_serializing_if = "Option::is_none" + )] + pub char_offset: Option<i32>, + #[doc = "Gets or sets an extract of code where the match appears. Usually it is the line where there is the match."] + #[serde( + rename = "codeSnippet", + default, + skip_serializing_if = "Option::is_none" + )] + pub code_snippet: Option<String>, + #[doc = "Gets or sets the column number where the match appears in the line."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub column: Option<i32>, + #[doc = "Gets or sets the length of a piece of text."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub length: Option<i32>, + #[doc = "Gets or sets the line number where the match appears in the file."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub line: Option<i32>, + #[doc = "Gets or sets the name of type of a piece of text."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl Hit { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the matched terms in the field of the package result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageHit { - #[doc = "Reference name of the highlighted field."] - #[serde( - rename = "fieldReferenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub field_reference_name: Option<String>, - #[doc = "Matched/highlighted snippets of the field."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub highlights: Vec<String>, + #[doc = "Reference name of the highlighted field."] + #[serde( + rename = "fieldReferenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub field_reference_name: Option<String>, + #[doc = "Matched/highlighted snippets of the field."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub highlights: Vec<String>, } impl PackageHit { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the package result that matched a package search request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageResult { - #[doc = "Description of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "List of feeds which contain the matching package."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub feeds: Vec<FeedInfo>, - #[doc = "List of highlighted fields for the match."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub hits: Vec<PackageHit>, - #[doc = "Id of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the package."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Type of the package."] - #[serde( - rename = "protocolType", - default, - skip_serializing_if = "Option::is_none" - )] - pub protocol_type: Option<String>, + #[doc = "Description of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "List of feeds which contain the matching package."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub feeds: Vec<FeedInfo>, + #[doc = "List of highlighted fields for the match."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub hits: Vec<PackageHit>, + #[doc = "Id of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the package."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Type of the package."] + #[serde( + rename = "protocolType", + default, + skip_serializing_if = "Option::is_none" + )] + pub protocol_type: Option<String>, } impl PackageResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a package search request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageSearchRequest { - #[serde(flatten)] - pub entity_search_request: EntitySearchRequest, + #[serde(flatten)] + pub entity_search_request: EntitySearchRequest, } impl PackageSearchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageSearchResponse { - #[serde( - rename = "activityId", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub activity_id: Vec<String>, - #[doc = "Defines a response item that is returned for a package search request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub content: Option<PackageSearchResponseContent>, + #[serde( + rename = "activityId", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub activity_id: Vec<String>, + #[doc = "Defines a response item that is returned for a package search request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content: Option<PackageSearchResponseContent>, } impl PackageSearchResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a response item that is returned for a package search request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PackageSearchResponseContent { - #[serde(flatten)] - pub entity_search_response: EntitySearchResponse, - #[doc = "Total number of matched packages."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "List of matched packages."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<PackageResult>, + #[serde(flatten)] + pub entity_search_response: EntitySearchResponse, + #[doc = "Total number of matched packages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "List of matched packages."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<PackageResult>, } impl PackageSearchResponseContent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the details of the project."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Project { - #[doc = "Id of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Id of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl Project { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the details of the project."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectReference { - #[doc = "ID of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Visibility of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub visibility: Option<String>, + #[doc = "ID of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Visibility of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub visibility: Option<String>, } impl ProjectReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the details of the repository."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Repository { - #[doc = "Id of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Version control type of the result file."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<repository::Type>, + #[doc = "Id of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Version control type of the result file."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<repository::Type>, } impl Repository { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod repository { - use super::*; - #[doc = "Version control type of the result file."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "git")] - Git, - #[serde(rename = "tfvc")] - Tfvc, - #[serde(rename = "custom")] - Custom, - } + use super::*; + #[doc = "Version control type of the result file."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "git")] + Git, + #[serde(rename = "tfvc")] + Tfvc, + #[serde(rename = "custom")] + Custom, + } } #[doc = "Defines the repository status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RepositoryStatusResponse { - #[doc = "Repository Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "List of Indexed branches info."] - #[serde( - rename = "indexedBranches", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub indexed_branches: Vec<BranchInfo>, - #[doc = "Repository Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Repository Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "List of Indexed branches info."] + #[serde( + rename = "indexedBranches", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub indexed_branches: Vec<BranchInfo>, + #[doc = "Repository Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl RepositoryStatusResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a scroll code search request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ScrollSearchRequest { - #[serde(flatten)] - pub entity_search_request_base: EntitySearchRequestBase, - #[doc = "Scroll Id for scroll search query."] - #[serde(rename = "$scrollId", default, skip_serializing_if = "Option::is_none")] - pub scroll_id: Option<String>, - #[doc = "Size of data to return for scroll search query. Min value is 201."] - #[serde( - rename = "$scrollSize", - default, - skip_serializing_if = "Option::is_none" - )] - pub scroll_size: Option<i32>, + #[serde(flatten)] + pub entity_search_request_base: EntitySearchRequestBase, + #[doc = "Scroll Id for scroll search query."] + #[serde(rename = "$scrollId", default, skip_serializing_if = "Option::is_none")] + pub scroll_id: Option<String>, + #[doc = "Size of data to return for scroll search query. Min value is 201."] + #[serde( + rename = "$scrollSize", + default, + skip_serializing_if = "Option::is_none" + )] + pub scroll_size: Option<i32>, } impl ScrollSearchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the setting result that matched a setting search request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SettingResult { - #[doc = "Description of the settings page"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Icon name of the settings page"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub icon: Option<String>, - #[doc = "Contribution url route id of the corresponding settings page"] - #[serde(rename = "routeId", default, skip_serializing_if = "Option::is_none")] - pub route_id: Option<String>, - #[doc = "Contribution url route parameter of the corresponding settings page"] - #[serde( - rename = "routeParameterMapping", - default, - skip_serializing_if = "Option::is_none" - )] - pub route_parameter_mapping: Option<serde_json::Value>, - #[doc = "Scope of the settings page, either organization, project or user"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<setting_result::Scope>, - #[doc = "Title of the settings page"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, + #[doc = "Description of the settings page"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Icon name of the settings page"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icon: Option<String>, + #[doc = "Contribution url route id of the corresponding settings page"] + #[serde(rename = "routeId", default, skip_serializing_if = "Option::is_none")] + pub route_id: Option<String>, + #[doc = "Contribution url route parameter of the corresponding settings page"] + #[serde( + rename = "routeParameterMapping", + default, + skip_serializing_if = "Option::is_none" + )] + pub route_parameter_mapping: Option<serde_json::Value>, + #[doc = "Scope of the settings page, either organization, project or user"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<setting_result::Scope>, + #[doc = "Title of the settings page"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, } impl SettingResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod setting_result { - use super::*; - #[doc = "Scope of the settings page, either organization, project or user"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Scope { - #[serde(rename = "none")] - None, - #[serde(rename = "organization")] - Organization, - #[serde(rename = "project")] - Project, - #[serde(rename = "user")] - User, - } + use super::*; + #[doc = "Scope of the settings page, either organization, project or user"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Scope { + #[serde(rename = "none")] + None, + #[serde(rename = "organization")] + Organization, + #[serde(rename = "project")] + Project, + #[serde(rename = "user")] + User, + } } #[doc = "Defines a setting search request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SettingSearchRequest { - #[serde(flatten)] - pub entity_search_request: EntitySearchRequest, + #[serde(flatten)] + pub entity_search_request: EntitySearchRequest, } impl SettingSearchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a setting search response item"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SettingSearchResponse { - #[serde(flatten)] - pub entity_search_response: EntitySearchResponse, - #[doc = "Total number of matched setting documents."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "List of top matched setting documents."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<SettingResult>, + #[serde(flatten)] + pub entity_search_response: EntitySearchResponse, + #[doc = "Total number of matched setting documents."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "List of top matched setting documents."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<SettingResult>, } impl SettingSearchResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines how to sort the result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SortOption { - #[doc = "Field name on which sorting should be done."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub field: Option<String>, - #[doc = "Order (ASC/DESC) in which the results should be sorted."] - #[serde(rename = "sortOrder", default, skip_serializing_if = "Option::is_none")] - pub sort_order: Option<String>, + #[doc = "Field name on which sorting should be done."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub field: Option<String>, + #[doc = "Order (ASC/DESC) in which the results should be sorted."] + #[serde(rename = "sortOrder", default, skip_serializing_if = "Option::is_none")] + pub sort_order: Option<String>, } impl SortOption { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the details of the team."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Team { - #[doc = "Id of the team."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the Team."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Id of the team."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the Team."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl Team { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the TFVC repository status."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcRepositoryStatusResponse { - #[doc = "Repository Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "List of Indexing Information for TFVC repository"] - #[serde( - rename = "indexingInformation", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub indexing_information: Vec<BranchInfo>, - #[doc = "Repository Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Repository Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "List of Indexing Information for TFVC repository"] + #[serde( + rename = "indexingInformation", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub indexing_information: Vec<BranchInfo>, + #[doc = "Repository Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TfvcRepositoryStatusResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes the details pertaining to a version of the result file."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Version { - #[doc = "Name of the branch."] - #[serde( - rename = "branchName", - default, - skip_serializing_if = "Option::is_none" - )] - pub branch_name: Option<String>, - #[doc = "ChangeId in the given branch associated with this match."] - #[serde(rename = "changeId", default, skip_serializing_if = "Option::is_none")] - pub change_id: Option<String>, + #[doc = "Name of the branch."] + #[serde( + rename = "branchName", + default, + skip_serializing_if = "Option::is_none" + )] + pub branch_name: Option<String>, + #[doc = "ChangeId in the given branch associated with this match."] + #[serde(rename = "changeId", default, skip_serializing_if = "Option::is_none")] + pub change_id: Option<String>, } impl Version { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the details of wiki."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Wiki { - #[doc = "Id of the wiki."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Mapped path for the wiki."] - #[serde( - rename = "mappedPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub mapped_path: Option<String>, - #[doc = "Name of the wiki."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Version for wiki."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, + #[doc = "Id of the wiki."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Mapped path for the wiki."] + #[serde( + rename = "mappedPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub mapped_path: Option<String>, + #[doc = "Name of the wiki."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Version for wiki."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, } impl Wiki { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the matched terms in the field of the wiki result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiHit { - #[doc = "Reference name of the highlighted field."] - #[serde( - rename = "fieldReferenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub field_reference_name: Option<String>, - #[doc = "Matched/highlighted snippets of the field."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub highlights: Vec<String>, + #[doc = "Reference name of the highlighted field."] + #[serde( + rename = "fieldReferenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub field_reference_name: Option<String>, + #[doc = "Matched/highlighted snippets of the field."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub highlights: Vec<String>, } impl WikiHit { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the wiki result that matched a wiki search request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiResult { - #[doc = "Defines the details of the collection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub collection: Option<Collection>, - #[doc = "ContentId of the result file."] - #[serde(rename = "contentId", default, skip_serializing_if = "Option::is_none")] - pub content_id: Option<String>, - #[doc = "Name of the result file."] - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[doc = "Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub hits: Vec<WikiHit>, - #[doc = "Path at which result file is present."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Defines the details of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ProjectReference>, - #[doc = "Defines the details of wiki."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub wiki: Option<Wiki>, + #[doc = "Defines the details of the collection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub collection: Option<Collection>, + #[doc = "ContentId of the result file."] + #[serde(rename = "contentId", default, skip_serializing_if = "Option::is_none")] + pub content_id: Option<String>, + #[doc = "Name of the result file."] + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[doc = "Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub hits: Vec<WikiHit>, + #[doc = "Path at which result file is present."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Defines the details of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ProjectReference>, + #[doc = "Defines the details of wiki."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wiki: Option<Wiki>, } impl WikiResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a wiki search request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiSearchRequest { - #[serde(flatten)] - pub entity_search_request: EntitySearchRequest, + #[serde(flatten)] + pub entity_search_request: EntitySearchRequest, } impl WikiSearchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a wiki search response item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiSearchResponse { - #[serde(flatten)] - pub entity_search_response: EntitySearchResponse, - #[doc = "Total number of matched wiki documents."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "List of top matched wiki documents."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<WikiResult>, + #[serde(flatten)] + pub entity_search_response: EntitySearchResponse, + #[doc = "Total number of matched wiki documents."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "List of top matched wiki documents."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<WikiResult>, } impl WikiSearchResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the matched terms in the field of the work item result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemHit { - #[doc = "Reference name of the highlighted field."] - #[serde( - rename = "fieldReferenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub field_reference_name: Option<String>, - #[doc = "Matched/highlighted snippets of the field."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub highlights: Vec<String>, + #[doc = "Reference name of the highlighted field."] + #[serde( + rename = "fieldReferenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub field_reference_name: Option<String>, + #[doc = "Matched/highlighted snippets of the field."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub highlights: Vec<String>, } impl WorkItemHit { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines the work item result that matched a work item search request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemResult { - #[doc = "A standard set of work item fields and their values."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fields: Option<serde_json::Value>, - #[doc = "Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub hits: Vec<WorkItemHit>, - #[doc = "Defines the details of the project."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<Project>, - #[doc = "Reference to the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "A standard set of work item fields and their values."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fields: Option<serde_json::Value>, + #[doc = "Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub hits: Vec<WorkItemHit>, + #[doc = "Defines the details of the project."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<Project>, + #[doc = "Reference to the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a work item search request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemSearchRequest { - #[serde(flatten)] - pub entity_search_request: EntitySearchRequest, + #[serde(flatten)] + pub entity_search_request: EntitySearchRequest, } impl WorkItemSearchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a response item that is returned for a work item search request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemSearchResponse { - #[serde(flatten)] - pub entity_search_response: EntitySearchResponse, - #[doc = "Total number of matched work items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "List of top matched work items."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<WorkItemResult>, + #[serde(flatten)] + pub entity_search_response: EntitySearchResponse, + #[doc = "Total number of matched work items."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "List of top matched work items."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<WorkItemResult>, } impl WorkItemSearchResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/security/mod.rs b/azure_devops_rust_api/src/security/mod.rs index 13921411..9379e6b0 100644 --- a/azure_devops_rust_api/src/security/mod.rs +++ b/azure_devops_rust_api/src/security/mod.rs @@ -9,1389 +9,1392 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + 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()) + } +} +pub mod access_control_entries { + use 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 = "Arguments:"] + #[doc = "* `security_namespace_id`: Security namespace identifier."] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn set_access_control_entries( + &self, + body: impl Into<serde_json::Value>, + security_namespace_id: impl Into<String>, + organization: impl Into<String>, + ) -> 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 = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + #[doc = "Remove the specified ACEs from the ACL belonging to the specified token."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `security_namespace_id`: Security namespace identifier."] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn remove_access_control_entries( + &self, + security_namespace_id: impl Into<String>, + organization: impl Into<String>, + ) -> 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, + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + } + pub mod set_access_control_entries { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AccessControlEntryList> { + let bytes = self.0.into_body().collect().await?; + let body: models::AccessControlEntryList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) body: serde_json::Value, + pub(crate) security_namespace_id: String, + pub(crate) organization: String, } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/accesscontrolentries/{}", + this.client.endpoint(), + &this.organization, + &this.security_namespace_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AccessControlEntryList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AccessControlEntryList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod remove_access_control_entries { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<bool> { + let bytes = self.0.into_body().collect().await?; + let body: bool = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) security_namespace_id: String, + pub(crate) organization: String, + pub(crate) token: Option<String>, + pub(crate) descriptors: Option<String>, + } + impl RequestBuilder { + #[doc = "The token whose ACL should be modified."] + pub fn token(mut self, token: impl Into<String>) -> Self { + self.token = Some(token.into()); + self + } + #[doc = "String containing a list of identity descriptors separated by ',' whose entries should be removed."] + pub fn descriptors(mut self, descriptors: impl Into<String>) -> Self { + self.descriptors = Some(descriptors.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/accesscontrolentries/{}", + this.client.endpoint(), + &this.organization, + &this.security_namespace_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<bool>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<bool>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential +pub mod access_control_lists { + use 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 = "Arguments:"] + #[doc = "* `security_namespace_id`: Security namespace identifier."] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn query( + &self, + security_namespace_id: impl Into<String>, + organization: impl Into<String>, + ) -> 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, + } } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() + #[doc = "Create or update one or more access control lists. All data that currently exists for the ACLs supplied will be overwritten."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `body`: A list of ACLs to create or update."] + #[doc = "* `security_namespace_id`: Security namespace identifier."] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn set_access_control_lists( + &self, + body: impl Into<models::AccessControlListBody>, + security_namespace_id: impl Into<String>, + organization: impl Into<String>, + ) -> 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(), + } } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await + #[doc = "Remove access control lists under the specfied security namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `security_namespace_id`: Security namespace identifier."] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn remove_access_control_lists( + &self, + security_namespace_id: impl Into<String>, + organization: impl Into<String>, + ) -> 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, + } } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) + } + pub mod query { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AccessControlListList> { + let bytes = self.0.into_body().collect().await?; + let body: models::AccessControlListList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn access_control_entries_client(&self) -> access_control_entries::Client { - access_control_entries::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub fn access_control_lists_client(&self) -> access_control_lists::Client { - access_control_lists::Client(self.clone()) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) security_namespace_id: String, + pub(crate) organization: String, + pub(crate) token: Option<String>, + pub(crate) descriptors: Option<String>, + pub(crate) include_extended_info: Option<bool>, + pub(crate) recurse: Option<bool>, } - pub fn permissions_client(&self) -> permissions::Client { - permissions::Client(self.clone()) + impl RequestBuilder { + #[doc = "Security token"] + pub fn token(mut self, token: impl Into<String>) -> Self { + self.token = Some(token.into()); + self + } + #[doc = "An optional filter string containing a list of identity descriptors separated by ',' whose ACEs should be retrieved. If this is left null, entire ACLs will be returned."] + pub fn descriptors(mut self, descriptors: impl Into<String>) -> Self { + self.descriptors = Some(descriptors.into()); + self + } + #[doc = "If true, populate the extended information properties for the access control entries contained in the returned lists."] + pub fn include_extended_info(mut self, include_extended_info: bool) -> Self { + self.include_extended_info = Some(include_extended_info); + self + } + #[doc = "If true and this is a hierarchical namespace, return child ACLs of the specified token."] + pub fn recurse(mut self, recurse: bool) -> Self { + self.recurse = Some(recurse); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/accesscontrollists/{}", + this.client.endpoint(), + &this.organization, + &this.security_namespace_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub fn security_namespaces_client(&self) -> security_namespaces::Client { - security_namespaces::Client(self.clone()) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AccessControlListList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AccessControlListList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -pub mod access_control_entries { + } + pub mod set_access_control_lists { use 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 = "Arguments:"] - #[doc = "* `security_namespace_id`: Security namespace identifier."] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn set_access_control_entries( - &self, - body: impl Into<serde_json::Value>, - security_namespace_id: impl Into<String>, - organization: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `security_namespace_id`: Security namespace identifier."] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn remove_access_control_entries( - &self, - security_namespace_id: impl Into<String>, - organization: impl Into<String>, - ) -> 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 struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) body: models::AccessControlListBody, + pub(crate) security_namespace_id: String, + pub(crate) organization: String, } - pub mod set_access_control_entries { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AccessControlEntryList> { - let bytes = self.0.into_body().collect().await?; - let body: models::AccessControlEntryList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) body: serde_json::Value, - pub(crate) security_namespace_id: String, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/accesscontrolentries/{}", - this.client.endpoint(), - &this.organization, - &this.security_namespace_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AccessControlEntryList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::AccessControlEntryList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/accesscontrollists/{}", + this.client.endpoint(), + &this.organization, + &this.security_namespace_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub mod remove_access_control_entries { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<bool> { - let bytes = self.0.into_body().collect().await?; - let body: bool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) security_namespace_id: String, - pub(crate) organization: String, - pub(crate) token: Option<String>, - pub(crate) descriptors: Option<String>, - } - impl RequestBuilder { - #[doc = "The token whose ACL should be modified."] - pub fn token(mut self, token: impl Into<String>) -> Self { - self.token = Some(token.into()); - self - } - #[doc = "String containing a list of identity descriptors separated by ',' whose entries should be removed."] - pub fn descriptors(mut self, descriptors: impl Into<String>) -> Self { - self.descriptors = Some(descriptors.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/accesscontrolentries/{}", - this.client.endpoint(), - &this.organization, - &this.security_namespace_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<bool>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<bool>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } -} -pub mod access_control_lists { + } + pub mod remove_access_control_lists { use 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 = "Arguments:"] - #[doc = "* `security_namespace_id`: Security namespace identifier."] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn query( - &self, - security_namespace_id: impl Into<String>, - organization: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `body`: A list of ACLs to create or update."] - #[doc = "* `security_namespace_id`: Security namespace identifier."] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn set_access_control_lists( - &self, - body: impl Into<models::AccessControlListBody>, - security_namespace_id: impl Into<String>, - organization: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `security_namespace_id`: Security namespace identifier."] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn remove_access_control_lists( - &self, - security_namespace_id: impl Into<String>, - organization: impl Into<String>, - ) -> 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 struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<bool> { + let bytes = self.0.into_body().collect().await?; + let body: bool = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub mod query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AccessControlListList> { - let bytes = self.0.into_body().collect().await?; - let body: models::AccessControlListList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) security_namespace_id: String, - pub(crate) organization: String, - pub(crate) token: Option<String>, - pub(crate) descriptors: Option<String>, - pub(crate) include_extended_info: Option<bool>, - pub(crate) recurse: Option<bool>, - } - impl RequestBuilder { - #[doc = "Security token"] - pub fn token(mut self, token: impl Into<String>) -> Self { - self.token = Some(token.into()); - self - } - #[doc = "An optional filter string containing a list of identity descriptors separated by ',' whose ACEs should be retrieved. If this is left null, entire ACLs will be returned."] - pub fn descriptors(mut self, descriptors: impl Into<String>) -> Self { - self.descriptors = Some(descriptors.into()); - self - } - #[doc = "If true, populate the extended information properties for the access control entries contained in the returned lists."] - pub fn include_extended_info(mut self, include_extended_info: bool) -> Self { - self.include_extended_info = Some(include_extended_info); - self - } - #[doc = "If true and this is a hierarchical namespace, return child ACLs of the specified token."] - pub fn recurse(mut self, recurse: bool) -> Self { - self.recurse = Some(recurse); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/accesscontrollists/{}", - this.client.endpoint(), - &this.organization, - &this.security_namespace_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AccessControlListList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::AccessControlListList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub mod set_access_control_lists { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) body: models::AccessControlListBody, - pub(crate) security_namespace_id: String, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/accesscontrollists/{}", - this.client.endpoint(), - &this.organization, - &this.security_namespace_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub mod remove_access_control_lists { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<bool> { - let bytes = self.0.into_body().collect().await?; - let body: bool = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) security_namespace_id: String, - pub(crate) organization: String, - pub(crate) tokens: Option<String>, - pub(crate) recurse: Option<bool>, - } - impl RequestBuilder { - #[doc = "One or more comma-separated security tokens"] - pub fn tokens(mut self, tokens: impl Into<String>) -> Self { - self.tokens = Some(tokens.into()); - self - } - #[doc = "If true and this is a hierarchical namespace, also remove child ACLs of the specified tokens."] - pub fn recurse(mut self, recurse: bool) -> Self { - self.recurse = Some(recurse); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/accesscontrollists/{}", - this.client.endpoint(), - &this.organization, - &this.security_namespace_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<bool>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<bool>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) security_namespace_id: String, + pub(crate) organization: String, + pub(crate) tokens: Option<String>, + pub(crate) recurse: Option<bool>, + } + impl RequestBuilder { + #[doc = "One or more comma-separated security tokens"] + pub fn tokens(mut self, tokens: impl Into<String>) -> Self { + self.tokens = Some(tokens.into()); + self + } + #[doc = "If true and this is a hierarchical namespace, also remove child ACLs of the specified tokens."] + pub fn recurse(mut self, recurse: bool) -> Self { + self.recurse = Some(recurse); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/accesscontrollists/{}", + this.client.endpoint(), + &this.organization, + &this.security_namespace_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<bool>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<bool>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } pub mod permissions { + use super::models; + 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 = "Arguments:"] + #[doc = "* `security_namespace_id`: Security namespace identifier."] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `permissions`: Permissions to evaluate."] + pub fn has_permissions( + &self, + security_namespace_id: impl Into<String>, + organization: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `security_namespace_id`: Security namespace identifier."] + #[doc = "* `descriptor`: Identity descriptor of the user to remove permissions for."] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `permissions`: Permissions to remove."] + pub fn remove_permission( + &self, + security_namespace_id: impl Into<String>, + descriptor: impl Into<String>, + organization: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `body`: The set of evaluation requests."] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn has_permissions_batch( + &self, + body: impl Into<models::PermissionEvaluationBatch>, + organization: impl Into<String>, + ) -> has_permissions_batch::RequestBuilder { + has_permissions_batch::RequestBuilder { + client: self.0.clone(), + body: body.into(), + organization: organization.into(), + } + } + } + pub mod has_permissions { use super::models; - 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 = "Arguments:"] - #[doc = "* `security_namespace_id`: Security namespace identifier."] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `permissions`: Permissions to evaluate."] - pub fn has_permissions( - &self, - security_namespace_id: impl Into<String>, - organization: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `security_namespace_id`: Security namespace identifier."] - #[doc = "* `descriptor`: Identity descriptor of the user to remove permissions for."] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `permissions`: Permissions to remove."] - pub fn remove_permission( - &self, - security_namespace_id: impl Into<String>, - descriptor: impl Into<String>, - organization: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `body`: The set of evaluation requests."] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn has_permissions_batch( - &self, - body: impl Into<models::PermissionEvaluationBatch>, - organization: impl Into<String>, - ) -> has_permissions_batch::RequestBuilder { - has_permissions_batch::RequestBuilder { - client: self.0.clone(), - body: body.into(), - organization: organization.into(), - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<bool>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<bool> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub mod has_permissions { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<bool>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<bool> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) security_namespace_id: String, - pub(crate) organization: String, - pub(crate) permissions: i32, - pub(crate) tokens: Option<String>, - pub(crate) always_allow_administrators: Option<bool>, - pub(crate) delimiter: Option<String>, - } - impl RequestBuilder { - #[doc = "One or more security tokens to evaluate."] - pub fn tokens(mut self, tokens: impl Into<String>) -> Self { - self.tokens = Some(tokens.into()); - self - } - #[doc = "If true and if the caller is an administrator, always return true."] - pub fn always_allow_administrators( - mut self, - always_allow_administrators: bool, - ) -> Self { - self.always_allow_administrators = Some(always_allow_administrators); - self - } - #[doc = "Optional security token separator. Defaults to \",\"."] - pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self { - self.delimiter = Some(delimiter.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/permissions/{}/{}", - this.client.endpoint(), - &this.organization, - &this.security_namespace_id, - &this.permissions - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<bool>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<bool>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub mod remove_permission { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AccessControlEntry> { - let bytes = self.0.into_body().collect().await?; - let body: models::AccessControlEntry = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) security_namespace_id: String, - pub(crate) descriptor: String, - pub(crate) organization: String, - pub(crate) permissions: i32, - pub(crate) token: Option<String>, - } - impl RequestBuilder { - #[doc = "Security token to remove permissions for."] - pub fn token(mut self, token: impl Into<String>) -> Self { - self.token = Some(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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/permissions/{}/{}", - this.client.endpoint(), - &this.organization, - &this.security_namespace_id, - &this.permissions - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AccessControlEntry>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::AccessControlEntry>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub mod has_permissions_batch { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PermissionEvaluationBatch> { - let bytes = self.0.into_body().collect().await?; - let body: models::PermissionEvaluationBatch = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) body: models::PermissionEvaluationBatch, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/security/permissionevaluationbatch", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PermissionEvaluationBatch>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::PermissionEvaluationBatch>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) security_namespace_id: String, + pub(crate) organization: String, + pub(crate) permissions: i32, + pub(crate) tokens: Option<String>, + pub(crate) always_allow_administrators: Option<bool>, + pub(crate) delimiter: Option<String>, + } + impl RequestBuilder { + #[doc = "One or more security tokens to evaluate."] + pub fn tokens(mut self, tokens: impl Into<String>) -> Self { + self.tokens = Some(tokens.into()); + self + } + #[doc = "If true and if the caller is an administrator, always return true."] + pub fn always_allow_administrators(mut self, always_allow_administrators: bool) -> Self { + self.always_allow_administrators = Some(always_allow_administrators); + self + } + #[doc = "Optional security token separator. Defaults to \",\"."] + pub fn delimiter(mut self, delimiter: impl Into<String>) -> Self { + self.delimiter = Some(delimiter.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/permissions/{}/{}", + this.client.endpoint(), + &this.organization, + &this.security_namespace_id, + &this.permissions + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<bool>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<bool>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod remove_permission { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AccessControlEntry> { + let bytes = self.0.into_body().collect().await?; + let body: models::AccessControlEntry = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) security_namespace_id: String, + pub(crate) descriptor: String, + pub(crate) organization: String, + pub(crate) permissions: i32, + pub(crate) token: Option<String>, + } + impl RequestBuilder { + #[doc = "Security token to remove permissions for."] + pub fn token(mut self, token: impl Into<String>) -> Self { + self.token = Some(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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/permissions/{}/{}", + this.client.endpoint(), + &this.organization, + &this.security_namespace_id, + &this.permissions + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AccessControlEntry>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AccessControlEntry>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod has_permissions_batch { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PermissionEvaluationBatch> { + let bytes = self.0.into_body().collect().await?; + let body: models::PermissionEvaluationBatch = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) body: models::PermissionEvaluationBatch, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/security/permissionevaluationbatch", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PermissionEvaluationBatch>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PermissionEvaluationBatch>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod security_namespaces { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all security namespaces or just the specified namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `security_namespace_id`: Security namespace identifier."] + pub fn query( + &self, + organization: impl Into<String>, + security_namespace_id: impl Into<String>, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + security_namespace_id: security_namespace_id.into(), + local_only: None, + } + } + } + pub mod query { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List all security namespaces or just the specified namespace."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `security_namespace_id`: Security namespace identifier."] - pub fn query( - &self, - organization: impl Into<String>, - security_namespace_id: impl Into<String>, - ) -> query::RequestBuilder { - query::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - security_namespace_id: security_namespace_id.into(), - local_only: None, - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SecurityNamespaceDescriptionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityNamespaceDescriptionList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub mod query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::SecurityNamespaceDescriptionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::SecurityNamespaceDescriptionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) security_namespace_id: String, - pub(crate) local_only: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/securitynamespaces/{}", - this.client.endpoint(), - &this.organization, - &this.security_namespace_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(local_only) = &this.local_only { - req.url_mut() - .query_pairs_mut() - .append_pair("localOnly", &local_only.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SecurityNamespaceDescriptionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::SecurityNamespaceDescriptionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) security_namespace_id: String, + pub(crate) local_only: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/securitynamespaces/{}", + this.client.endpoint(), + &this.organization, + &this.security_namespace_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(local_only) = &this.local_only { + req + .url_mut() + .query_pairs_mut() + .append_pair("localOnly", &local_only.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SecurityNamespaceDescriptionList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::SecurityNamespaceDescriptionList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/security/models.rs b/azure_devops_rust_api/src/security/models.rs index 4e7f51aa..67baec4c 100644 --- a/azure_devops_rust_api/src/security/models.rs +++ b/azure_devops_rust_api/src/security/models.rs @@ -8,402 +8,400 @@ use std::str::FromStr; #[doc = "Class for encapsulating the allowed and denied permissions for a given IdentityDescriptor."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessControlEntry { - #[doc = "The set of permission bits that represent the actions that the associated descriptor is allowed to perform."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub allow: Option<i32>, - #[doc = "The set of permission bits that represent the actions that the associated descriptor is not allowed to perform."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deny: Option<i32>, - #[doc = "The descriptor for the user this AccessControlEntry applies to."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "Holds the inherited and effective permission information for a given AccessControlEntry."] - #[serde( - rename = "extendedInfo", - default, - skip_serializing_if = "Option::is_none" - )] - pub extended_info: Option<AceExtendedInformation>, + #[doc = "The set of permission bits that represent the actions that the associated descriptor is allowed to perform."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub allow: Option<i32>, + #[doc = "The set of permission bits that represent the actions that the associated descriptor is not allowed to perform."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deny: Option<i32>, + #[doc = "The descriptor for the user this AccessControlEntry applies to."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "Holds the inherited and effective permission information for a given AccessControlEntry."] + #[serde( + rename = "extendedInfo", + default, + skip_serializing_if = "Option::is_none" + )] + pub extended_info: Option<AceExtendedInformation>, } impl AccessControlEntry { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessControlEntryList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<AccessControlEntry>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<AccessControlEntry>, } impl AccessControlEntryList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The AccessControlList class is meant to associate a set of AccessControlEntries with a security token and its inheritance settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessControlList { - #[doc = "Storage of permissions keyed on the identity the permission is for."] - #[serde( - rename = "acesDictionary", - default, - skip_serializing_if = "Option::is_none" - )] - pub aces_dictionary: Option<serde_json::Value>, - #[doc = "True if this ACL holds ACEs that have extended information."] - #[serde( - rename = "includeExtendedInfo", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_extended_info: Option<bool>, - #[doc = "True if the given token inherits permissions from parents."] - #[serde( - rename = "inheritPermissions", - default, - skip_serializing_if = "Option::is_none" - )] - pub inherit_permissions: Option<bool>, - #[doc = "The token that this AccessControlList is for."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub token: Option<String>, + #[doc = "Storage of permissions keyed on the identity the permission is for."] + #[serde( + rename = "acesDictionary", + default, + skip_serializing_if = "Option::is_none" + )] + pub aces_dictionary: Option<serde_json::Value>, + #[doc = "True if this ACL holds ACEs that have extended information."] + #[serde( + rename = "includeExtendedInfo", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_extended_info: Option<bool>, + #[doc = "True if the given token inherits permissions from parents."] + #[serde( + rename = "inheritPermissions", + default, + skip_serializing_if = "Option::is_none" + )] + pub inherit_permissions: Option<bool>, + #[doc = "The token that this AccessControlList is for."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option<String>, } impl AccessControlList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccessControlListBody { - pub value: Vec<AccessControlList>, + pub value: Vec<AccessControlList>, } impl AccessControlListBody { - pub fn new(value: Vec<AccessControlList>) -> Self { - Self { value } - } + pub fn new(value: Vec<AccessControlList>) -> Self { + Self { value } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessControlListList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<AccessControlList>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<AccessControlList>, } impl AccessControlListList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A list of AccessControlList. An AccessControlList is meant to associate a set of AccessControlEntries with a security token and its inheritance settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessControlListsCollection {} impl AccessControlListsCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Holds the inherited and effective permission information for a given AccessControlEntry."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AceExtendedInformation { - #[doc = "This is the combination of all of the explicit and inherited permissions for this identity on this token. These are the permissions used when determining if a given user has permission to perform an action."] - #[serde( - rename = "effectiveAllow", - default, - skip_serializing_if = "Option::is_none" - )] - pub effective_allow: Option<i32>, - #[doc = "This is the combination of all of the explicit and inherited permissions for this identity on this token. These are the permissions used when determining if a given user has permission to perform an action."] - #[serde( - rename = "effectiveDeny", - default, - skip_serializing_if = "Option::is_none" - )] - pub effective_deny: Option<i32>, - #[doc = "These are the permissions that are inherited for this identity on this token. If the token does not inherit permissions this will be 0. Note that any permissions that have been explicitly set on this token for this identity, or any groups that this identity is a part of, are not included here."] - #[serde( - rename = "inheritedAllow", - default, - skip_serializing_if = "Option::is_none" - )] - pub inherited_allow: Option<i32>, - #[doc = "These are the permissions that are inherited for this identity on this token. If the token does not inherit permissions this will be 0. Note that any permissions that have been explicitly set on this token for this identity, or any groups that this identity is a part of, are not included here."] - #[serde( - rename = "inheritedDeny", - default, - skip_serializing_if = "Option::is_none" - )] - pub inherited_deny: Option<i32>, + #[doc = "This is the combination of all of the explicit and inherited permissions for this identity on this token. These are the permissions used when determining if a given user has permission to perform an action."] + #[serde( + rename = "effectiveAllow", + default, + skip_serializing_if = "Option::is_none" + )] + pub effective_allow: Option<i32>, + #[doc = "This is the combination of all of the explicit and inherited permissions for this identity on this token. These are the permissions used when determining if a given user has permission to perform an action."] + #[serde( + rename = "effectiveDeny", + default, + skip_serializing_if = "Option::is_none" + )] + pub effective_deny: Option<i32>, + #[doc = "These are the permissions that are inherited for this identity on this token. If the token does not inherit permissions this will be 0. Note that any permissions that have been explicitly set on this token for this identity, or any groups that this identity is a part of, are not included here."] + #[serde( + rename = "inheritedAllow", + default, + skip_serializing_if = "Option::is_none" + )] + pub inherited_allow: Option<i32>, + #[doc = "These are the permissions that are inherited for this identity on this token. If the token does not inherit permissions this will be 0. Note that any permissions that have been explicitly set on this token for this identity, or any groups that this identity is a part of, are not included here."] + #[serde( + rename = "inheritedDeny", + default, + skip_serializing_if = "Option::is_none" + )] + pub inherited_deny: Option<i32>, } impl AceExtendedInformation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ActionDefinition { - #[doc = "The bit mask integer for this action. Must be a power of 2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bit: Option<i32>, - #[doc = "The localized display name for this action."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "The non-localized name for this action."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The namespace that this action belongs to. This will only be used for reading from the database."] - #[serde( - rename = "namespaceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub namespace_id: Option<String>, + #[doc = "The bit mask integer for this action. Must be a power of 2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bit: Option<i32>, + #[doc = "The localized display name for this action."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "The non-localized name for this action."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The namespace that this action belongs to. This will only be used for reading from the database."] + #[serde( + rename = "namespaceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub namespace_id: Option<String>, } impl ActionDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An Identity descriptor is a wrapper for the identity type (Windows SID, Passport) along with a unique identifier such as the SID or PUID."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityDescriptor { - #[doc = "The unique identifier for this identity, not exceeding 256 chars, which will be persisted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, - #[doc = "Type of descriptor (for example, Windows, Passport, etc.)."] - #[serde( - rename = "identityType", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_type: Option<String>, + #[doc = "The unique identifier for this identity, not exceeding 256 chars, which will be persisted."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, + #[doc = "Type of descriptor (for example, Windows, Passport, etc.)."] + #[serde( + rename = "identityType", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_type: Option<String>, } impl IdentityDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a JSON object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JObject { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<String>, - #[doc = "Gets the node type for this JToken."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<String>, + #[doc = "Gets the node type for this JToken."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl JObject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an evaluated permission."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PermissionEvaluation { - #[doc = "Permission bit for this evaluated permission."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub permissions: Option<i32>, - #[doc = "Security namespace identifier for this evaluated permission."] - #[serde( - rename = "securityNamespaceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub security_namespace_id: Option<String>, - #[doc = "Security namespace-specific token for this evaluated permission."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub token: Option<String>, - #[doc = "Permission evaluation value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<bool>, + #[doc = "Permission bit for this evaluated permission."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub permissions: Option<i32>, + #[doc = "Security namespace identifier for this evaluated permission."] + #[serde( + rename = "securityNamespaceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub security_namespace_id: Option<String>, + #[doc = "Security namespace-specific token for this evaluated permission."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option<String>, + #[doc = "Permission evaluation value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<bool>, } impl PermissionEvaluation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a set of evaluated permissions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PermissionEvaluationBatch { - #[doc = "True if members of the Administrators group should always pass the security check."] - #[serde( - rename = "alwaysAllowAdministrators", - default, - skip_serializing_if = "Option::is_none" - )] - pub always_allow_administrators: Option<bool>, - #[doc = "Array of permission evaluations to evaluate."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub evaluations: Vec<PermissionEvaluation>, + #[doc = "True if members of the Administrators group should always pass the security check."] + #[serde( + rename = "alwaysAllowAdministrators", + default, + skip_serializing_if = "Option::is_none" + )] + pub always_allow_administrators: Option<bool>, + #[doc = "Array of permission evaluations to evaluate."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub evaluations: Vec<PermissionEvaluation>, } impl PermissionEvaluationBatch { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Class for describing the details of a TeamFoundationSecurityNamespace."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityNamespaceDescription { - #[doc = "The list of actions that this Security Namespace is responsible for securing."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub actions: Vec<ActionDefinition>, - #[doc = "This is the dataspace category that describes where the security information for this SecurityNamespace should be stored."] - #[serde( - rename = "dataspaceCategory", - default, - skip_serializing_if = "Option::is_none" - )] - pub dataspace_category: Option<String>, - #[doc = "This localized name for this namespace."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "If the security tokens this namespace will be operating on need to be split on certain character lengths to determine its elements, that length should be specified here. If not, this value will be -1."] - #[serde( - rename = "elementLength", - default, - skip_serializing_if = "Option::is_none" - )] - pub element_length: Option<i32>, - #[doc = "This is the type of the extension that should be loaded from the plugins directory for extending this security namespace."] - #[serde( - rename = "extensionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub extension_type: Option<String>, - #[doc = "If true, the security namespace is remotable, allowing another service to proxy the namespace."] - #[serde( - rename = "isRemotable", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_remotable: Option<bool>, - #[doc = "This non-localized for this namespace."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The unique identifier for this namespace."] - #[serde( - rename = "namespaceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub namespace_id: Option<String>, - #[doc = "The permission bits needed by a user in order to read security data on the Security Namespace."] - #[serde( - rename = "readPermission", - default, - skip_serializing_if = "Option::is_none" - )] - pub read_permission: Option<i32>, - #[doc = "If the security tokens this namespace will be operating on need to be split on certain characters to determine its elements that character should be specified here. If not, this value will be the null character."] - #[serde( - rename = "separatorValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub separator_value: Option<String>, - #[doc = "Used to send information about the structure of the security namespace over the web service."] - #[serde( - rename = "structureValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub structure_value: Option<i32>, - #[doc = "The bits reserved by system store"] - #[serde( - rename = "systemBitMask", - default, - skip_serializing_if = "Option::is_none" - )] - pub system_bit_mask: Option<i32>, - #[doc = "If true, the security service will expect an ISecurityDataspaceTokenTranslator plugin to exist for this namespace"] - #[serde( - rename = "useTokenTranslator", - default, - skip_serializing_if = "Option::is_none" - )] - pub use_token_translator: Option<bool>, - #[doc = "The permission bits needed by a user in order to modify security data on the Security Namespace."] - #[serde( - rename = "writePermission", - default, - skip_serializing_if = "Option::is_none" - )] - pub write_permission: Option<i32>, + #[doc = "The list of actions that this Security Namespace is responsible for securing."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub actions: Vec<ActionDefinition>, + #[doc = "This is the dataspace category that describes where the security information for this SecurityNamespace should be stored."] + #[serde( + rename = "dataspaceCategory", + default, + skip_serializing_if = "Option::is_none" + )] + pub dataspace_category: Option<String>, + #[doc = "This localized name for this namespace."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "If the security tokens this namespace will be operating on need to be split on certain character lengths to determine its elements, that length should be specified here. If not, this value will be -1."] + #[serde( + rename = "elementLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub element_length: Option<i32>, + #[doc = "This is the type of the extension that should be loaded from the plugins directory for extending this security namespace."] + #[serde( + rename = "extensionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub extension_type: Option<String>, + #[doc = "If true, the security namespace is remotable, allowing another service to proxy the namespace."] + #[serde( + rename = "isRemotable", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_remotable: Option<bool>, + #[doc = "This non-localized for this namespace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The unique identifier for this namespace."] + #[serde( + rename = "namespaceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub namespace_id: Option<String>, + #[doc = "The permission bits needed by a user in order to read security data on the Security Namespace."] + #[serde( + rename = "readPermission", + default, + skip_serializing_if = "Option::is_none" + )] + pub read_permission: Option<i32>, + #[doc = "If the security tokens this namespace will be operating on need to be split on certain characters to determine its elements that character should be specified here. If not, this value will be the null character."] + #[serde( + rename = "separatorValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub separator_value: Option<String>, + #[doc = "Used to send information about the structure of the security namespace over the web service."] + #[serde( + rename = "structureValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub structure_value: Option<i32>, + #[doc = "The bits reserved by system store"] + #[serde( + rename = "systemBitMask", + default, + skip_serializing_if = "Option::is_none" + )] + pub system_bit_mask: Option<i32>, + #[doc = "If true, the security service will expect an ISecurityDataspaceTokenTranslator plugin to exist for this namespace"] + #[serde( + rename = "useTokenTranslator", + default, + skip_serializing_if = "Option::is_none" + )] + pub use_token_translator: Option<bool>, + #[doc = "The permission bits needed by a user in order to modify security data on the Security Namespace."] + #[serde( + rename = "writePermission", + default, + skip_serializing_if = "Option::is_none" + )] + pub write_permission: Option<i32>, } impl SecurityNamespaceDescription { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityNamespaceDescriptionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<SecurityNamespaceDescription>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<SecurityNamespaceDescription>, } impl SecurityNamespaceDescriptionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/security_roles/mod.rs b/azure_devops_rust_api/src/security_roles/mod.rs index 4e552320..77506074 100644 --- a/azure_devops_rust_api/src/security_roles/mod.rs +++ b/azure_devops_rust_api/src/security_roles/mod.rs @@ -9,944 +9,947 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + pub fn roleassignments_client(&self) -> roleassignments::Client { + roleassignments::Client(self.clone()) + } + pub fn roledefinitions_client(&self) -> roledefinitions::Client { + roledefinitions::Client(self.clone()) + } +} +pub mod roleassignments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn change_inheritance( + &self, + scope_id: impl Into<String>, + resource_id: impl Into<String>, + inherit_permissions: bool, + organization: impl Into<String>, + ) -> 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 = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Get role assignments for the resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope_id`: Id of the assigned scope"] + #[doc = "* `resource_id`: Id of the resource that is assigned the scope"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list( + &self, + scope_id: impl Into<String>, + resource_id: impl Into<String>, + organization: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `body`: Roles to be assigned"] + #[doc = "* `scope_id`: Id of the assigned scope"] + #[doc = "* `resource_id`: Id of the resource on which the role is to be assigned"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn set_role_assignments( + &self, + body: Vec<models::UserRoleAssignmentRef>, + scope_id: impl Into<String>, + resource_id: impl Into<String>, + organization: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn remove_role_assignments( + &self, + body: Vec<String>, + scope_id: impl Into<String>, + resource_id: impl Into<String>, + organization: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `body`: Roles to be assigned"] + #[doc = "* `scope_id`: Id of the assigned scope"] + #[doc = "* `resource_id`: Id of the resource on which the role is to be assigned"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn set_role_assignment( + &self, + body: impl Into<models::UserRoleAssignmentRef>, + scope_id: impl Into<String>, + resource_id: impl Into<String>, + identity_id: impl Into<String>, + organization: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `scope_id`: Id of the assigned scope"] + #[doc = "* `resource_id`: Id of the resource on which the role is to be removed"] + #[doc = "* `identity_id`: Identity on which the assignment is to be removed"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn remove_role_assignment( + &self, + scope_id: impl Into<String>, + resource_id: impl Into<String>, + identity_id: impl Into<String>, + organization: impl Into<String>, + ) -> 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 change_inheritance { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope_id: String, + pub(crate) resource_id: String, + pub(crate) inherit_permissions: bool, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}?inheritPermissions={}" , this . client . endpoint () , & this . organization , & this . scope_id , & this . resource_id , & this . inherit_permissions)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let inherit_permissions = &this.inherit_permissions; + req + .url_mut() + .query_pairs_mut() + .append_pair("inheritPermissions", &inherit_permissions.to_string()); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RoleAssignmentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::RoleAssignmentList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope_id: String, + pub(crate) resource_id: String, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", + this.client.endpoint(), + &this.organization, + &this.scope_id, + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RoleAssignmentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RoleAssignmentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod set_role_assignments { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RoleAssignmentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::RoleAssignmentList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) body: Vec<models::UserRoleAssignmentRef>, + pub(crate) scope_id: String, + pub(crate) resource_id: String, + pub(crate) organization: String, + pub(crate) limit_to_caller_identity_domain: Option<bool>, + } + impl RequestBuilder { + pub fn limit_to_caller_identity_domain( mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + limit_to_caller_identity_domain: bool, + ) -> Self { + self.limit_to_caller_identity_domain = Some(limit_to_caller_identity_domain); 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", + this.client.endpoint(), + &this.organization, + &this.scope_id, + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RoleAssignmentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RoleAssignmentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - pub fn roleassignments_client(&self) -> roleassignments::Client { - roleassignments::Client(self.clone()) - } - pub fn roledefinitions_client(&self) -> roledefinitions::Client { - roledefinitions::Client(self.clone()) + } + pub mod remove_role_assignments { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) body: Vec<String>, + pub(crate) scope_id: String, + pub(crate) resource_id: String, + pub(crate) organization: String, } -} -pub mod roleassignments { + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", + this.client.endpoint(), + &this.organization, + &this.scope_id, + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod set_role_assignment { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn change_inheritance( - &self, - scope_id: impl Into<String>, - resource_id: impl Into<String>, - inherit_permissions: bool, - organization: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `scope_id`: Id of the assigned scope"] - #[doc = "* `resource_id`: Id of the resource that is assigned the scope"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list( - &self, - scope_id: impl Into<String>, - resource_id: impl Into<String>, - organization: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `body`: Roles to be assigned"] - #[doc = "* `scope_id`: Id of the assigned scope"] - #[doc = "* `resource_id`: Id of the resource on which the role is to be assigned"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn set_role_assignments( - &self, - body: Vec<models::UserRoleAssignmentRef>, - scope_id: impl Into<String>, - resource_id: impl Into<String>, - organization: impl Into<String>, - ) -> 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn remove_role_assignments( - &self, - body: Vec<String>, - scope_id: impl Into<String>, - resource_id: impl Into<String>, - organization: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `body`: Roles to be assigned"] - #[doc = "* `scope_id`: Id of the assigned scope"] - #[doc = "* `resource_id`: Id of the resource on which the role is to be assigned"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn set_role_assignment( - &self, - body: impl Into<models::UserRoleAssignmentRef>, - scope_id: impl Into<String>, - resource_id: impl Into<String>, - identity_id: impl Into<String>, - organization: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `scope_id`: Id of the assigned scope"] - #[doc = "* `resource_id`: Id of the resource on which the role is to be removed"] - #[doc = "* `identity_id`: Identity on which the assignment is to be removed"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn remove_role_assignment( - &self, - scope_id: impl Into<String>, - resource_id: impl Into<String>, - identity_id: impl Into<String>, - organization: impl Into<String>, - ) -> 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 change_inheritance { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope_id: String, - pub(crate) resource_id: String, - pub(crate) inherit_permissions: bool, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}?inheritPermissions={}" , this . client . endpoint () , & this . organization , & this . scope_id , & this . resource_id , & this . inherit_permissions)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let inherit_permissions = &this.inherit_permissions; - req.url_mut() - .query_pairs_mut() - .append_pair("inheritPermissions", &inherit_permissions.to_string()); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RoleAssignmentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::RoleAssignmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope_id: String, - pub(crate) resource_id: String, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", - this.client.endpoint(), - &this.organization, - &this.scope_id, - &this.resource_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RoleAssignmentList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::RoleAssignmentList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod set_role_assignments { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RoleAssignmentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::RoleAssignmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) body: Vec<models::UserRoleAssignmentRef>, - pub(crate) scope_id: String, - pub(crate) resource_id: String, - pub(crate) organization: String, - pub(crate) limit_to_caller_identity_domain: Option<bool>, - } - impl RequestBuilder { - pub fn limit_to_caller_identity_domain( - mut self, - limit_to_caller_identity_domain: bool, - ) -> Self { - self.limit_to_caller_identity_domain = Some(limit_to_caller_identity_domain); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", - this.client.endpoint(), - &this.organization, - &this.scope_id, - &this.resource_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RoleAssignmentList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::RoleAssignmentList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove_role_assignments { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) body: Vec<String>, - pub(crate) scope_id: String, - pub(crate) resource_id: String, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", - this.client.endpoint(), - &this.organization, - &this.scope_id, - &this.resource_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod set_role_assignment { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::RoleAssignment> { - let bytes = self.0.into_body().collect().await?; - let body: models::RoleAssignment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}/{}", - this.client.endpoint(), - &this.organization, - &this.scope_id, - &this.resource_id, - &this.identity_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::RoleAssignment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::RoleAssignment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove_role_assignment { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope_id: String, - pub(crate) resource_id: String, - pub(crate) identity_id: String, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}/{}", - this.client.endpoint(), - &this.organization, - &this.scope_id, - &this.resource_id, - &this.identity_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::RoleAssignment> { + let bytes = self.0.into_body().collect().await?; + let body: models::RoleAssignment = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}/{}", + this.client.endpoint(), + &this.organization, + &this.scope_id, + &this.resource_id, + &this.identity_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::RoleAssignment>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::RoleAssignment>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } + pub mod remove_role_assignment { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope_id: String, + pub(crate) resource_id: String, + pub(crate) identity_id: String, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}/{}", + this.client.endpoint(), + &this.organization, + &this.scope_id, + &this.resource_id, + &this.identity_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod roledefinitions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list( + &self, + scope_id: impl Into<String>, + organization: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope_id: scope_id.into(), + organization: organization.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list( - &self, - scope_id: impl Into<String>, - organization: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - scope_id: scope_id.into(), - organization: organization.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SecurityRoleList> { - let bytes = self.0.into_body().collect().await?; - let body: models::SecurityRoleList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope_id: String, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/securityroles/scopes/{}/roledefinitions", - this.client.endpoint(), - &this.organization, - &this.scope_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SecurityRoleList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::SecurityRoleList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SecurityRoleList> { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityRoleList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope_id: String, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/securityroles/scopes/{}/roledefinitions", + this.client.endpoint(), + &this.organization, + &this.scope_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SecurityRoleList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SecurityRoleList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/security_roles/models.rs b/azure_devops_rust_api/src/security_roles/models.rs index e2561573..b7e0811c 100644 --- a/azure_devops_rust_api/src/security_roles/models.rs +++ b/azure_devops_rust_api/src/security_roles/models.rs @@ -8,263 +8,261 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, } + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleAssignment { - #[doc = "Designates the role as explicitly assigned or inherited."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub access: Option<role_assignment::Access>, - #[doc = "User friendly description of access assignment."] - #[serde( - rename = "accessDisplayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub access_display_name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option<IdentityRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub role: Option<SecurityRole>, + #[doc = "Designates the role as explicitly assigned or inherited."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub access: Option<role_assignment::Access>, + #[doc = "User friendly description of access assignment."] + #[serde( + rename = "accessDisplayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub access_display_name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option<IdentityRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub role: Option<SecurityRole>, } impl RoleAssignment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod role_assignment { - use super::*; - #[doc = "Designates the role as explicitly assigned or inherited."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Access { - #[serde(rename = "assigned")] - Assigned, - #[serde(rename = "inherited")] - Inherited, - } + use super::*; + #[doc = "Designates the role as explicitly assigned or inherited."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Access { + #[serde(rename = "assigned")] + Assigned, + #[serde(rename = "inherited")] + Inherited, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RoleAssignmentList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<RoleAssignment>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<RoleAssignment>, } impl RoleAssignmentList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityRole { - #[doc = "Permissions the role is allowed."] - #[serde( - rename = "allowPermissions", - default, - skip_serializing_if = "Option::is_none" - )] - pub allow_permissions: Option<i32>, - #[doc = "Permissions the role is denied."] - #[serde( - rename = "denyPermissions", - default, - skip_serializing_if = "Option::is_none" - )] - pub deny_permissions: Option<i32>, - #[doc = "Description of user access defined by the role"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "User friendly name of the role."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Globally unique identifier for the role."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, - #[doc = "Unique name of the role in the scope."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Returns the id of the ParentScope."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, + #[doc = "Permissions the role is allowed."] + #[serde( + rename = "allowPermissions", + default, + skip_serializing_if = "Option::is_none" + )] + pub allow_permissions: Option<i32>, + #[doc = "Permissions the role is denied."] + #[serde( + rename = "denyPermissions", + default, + skip_serializing_if = "Option::is_none" + )] + pub deny_permissions: Option<i32>, + #[doc = "Description of user access defined by the role"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "User friendly name of the role."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Globally unique identifier for the role."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, + #[doc = "Unique name of the role in the scope."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Returns the id of the ParentScope."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, } impl SecurityRole { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SecurityRoleList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<SecurityRole>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<SecurityRole>, } impl SecurityRoleList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserRoleAssignmentRef { - #[doc = "The name of the role assigned."] - #[serde(rename = "roleName", default, skip_serializing_if = "Option::is_none")] - pub role_name: Option<String>, - #[doc = "Identifier of the user given the role assignment."] - #[serde( - rename = "uniqueName", - default, - skip_serializing_if = "Option::is_none" - )] - pub unique_name: Option<String>, - #[doc = "Unique id of the user given the role assignment."] - #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] - pub user_id: Option<String>, + #[doc = "The name of the role assigned."] + #[serde(rename = "roleName", default, skip_serializing_if = "Option::is_none")] + pub role_name: Option<String>, + #[doc = "Identifier of the user given the role assignment."] + #[serde( + rename = "uniqueName", + default, + skip_serializing_if = "Option::is_none" + )] + pub unique_name: Option<String>, + #[doc = "Unique id of the user given the role assignment."] + #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] + pub user_id: Option<String>, } impl UserRoleAssignmentRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/serde.rs b/azure_devops_rust_api/src/serde.rs index beecc678..4144f9ed 100644 --- a/azure_devops_rust_api/src/serde.rs +++ b/azure_devops_rust_api/src/serde.rs @@ -4,9 +4,9 @@ use std::result::Result; #[allow(dead_code)] pub(crate) fn deserialize_null_default<'de, D, T>(deserializer: D) -> Result<T, D::Error> where - T: Default + Deserialize<'de>, - D: Deserializer<'de>, + T: Default + Deserialize<'de>, + D: Deserializer<'de>, { - let opt = Option::deserialize(deserializer)?; - Ok(opt.unwrap_or_default()) + let opt = Option::deserialize(deserializer)?; + Ok(opt.unwrap_or_default()) } diff --git a/azure_devops_rust_api/src/service_endpoint/mod.rs b/azure_devops_rust_api/src/service_endpoint/mod.rs index 7ed283e6..767e2c08 100644 --- a/azure_devops_rust_api/src/service_endpoint/mod.rs +++ b/azure_devops_rust_api/src/service_endpoint/mod.rs @@ -9,1933 +9,1944 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + 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()) + } +} +pub mod endpointproxy { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Proxy for a GET request defined by a service endpoint."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Service endpoint request."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `endpoint_id`: Id of the service endpoint."] + pub fn execute_service_endpoint_request( + &self, + organization: impl Into<String>, + body: impl Into<models::ServiceEndpointRequest>, + project: impl Into<String>, + endpoint_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Describes the data source to fetch."] + #[doc = "* `project`: Project ID or project name"] + pub fn query( + &self, + organization: impl Into<String>, + body: impl Into<models::DataSourceBinding>, + project: impl Into<String>, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); + } + pub mod execute_service_endpoint_request { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointRequestResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceEndpointRequestResult = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ServiceEndpointRequest, + pub(crate) project: String, + pub(crate) endpoint_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/endpointproxy?endpointId={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.endpoint_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ServiceEndpointRequestResult>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::ServiceEndpointRequestResult>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod query { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::DataSourceBinding, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/endpointproxy", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod endpoints { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the service endpoints."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_service_endpoints( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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, + } + } + #[doc = "Creates a new service endpoint"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Service endpoint to create"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::ServiceEndpoint>, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Update the service endpoints."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Names of the service endpoints to update."] + pub fn update_service_endpoints( + &self, + organization: impl Into<String>, + body: Vec<models::ServiceEndpoint>, + ) -> update_service_endpoints::RequestBuilder { + update_service_endpoints::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + } + } + #[doc = "Update the service endpoint"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Updated data for the endpoint"] + #[doc = "* `endpoint_id`: Endpoint Id of the endpoint to update"] + pub fn update_service_endpoint( + &self, + organization: impl Into<String>, + body: impl Into<models::ServiceEndpoint>, + endpoint_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Project reference details of the target project"] + #[doc = "* `endpoint_id`: Endpoint Id of the endpoint to share"] + pub fn share_service_endpoint( + &self, + organization: impl Into<String>, + body: Vec<models::ServiceEndpointProjectReference>, + endpoint_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `endpoint_id`: Endpoint Id of endpoint to delete"] + #[doc = "* `project_ids`: project Ids from which endpoint needs to be deleted"] + pub fn delete( + &self, + organization: impl Into<String>, + endpoint_id: impl Into<String>, + project_ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `endpoint_names`: Names of the service endpoints."] + pub fn get_service_endpoints_by_names( + &self, + organization: impl Into<String>, + project: impl Into<String>, + endpoint_names: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Scope, Validity of Token requested."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `endpoint_ids`: Ids of the service endpoints."] + pub fn get_service_endpoints_with_refreshed_authentication( + &self, + organization: impl Into<String>, + body: Vec<models::RefreshAuthenticationParameters>, + project: impl Into<String>, + endpoint_ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `endpoint_id`: Id of the service endpoint."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + endpoint_id: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + endpoint_id: endpoint_id.into(), + action_filter: None, + } + } + } + pub mod get_service_endpoints { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceEndpointList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) type_: Option<String>, + pub(crate) auth_schemes: Option<String>, + pub(crate) endpoint_ids: Option<String>, + pub(crate) owner: Option<String>, + pub(crate) include_failed: Option<bool>, + pub(crate) include_details: Option<bool>, + } + impl RequestBuilder { + #[doc = "Type of the service endpoints."] + pub fn type_(mut self, type_: impl Into<String>) -> Self { + self.type_ = Some(type_.into()); self + } + #[doc = "Authorization schemes used for service endpoints."] + pub fn auth_schemes(mut self, auth_schemes: impl Into<String>) -> Self { + self.auth_schemes = Some(auth_schemes.into()); + self + } + #[doc = "Ids of the service endpoints."] + pub fn endpoint_ids(mut self, endpoint_ids: impl Into<String>) -> Self { + self.endpoint_ids = Some(endpoint_ids.into()); + self + } + #[doc = "Owner for service endpoints."] + pub fn owner(mut self, owner: impl Into<String>) -> Self { + self.owner = Some(owner.into()); + self + } + #[doc = "Failed flag for service endpoints."] + pub fn include_failed(mut self, include_failed: bool) -> Self { + self.include_failed = Some(include_failed); + self + } + #[doc = "Flag to include more details for service endpoints. This is for internal use only and the flag will be treated as false for all other requests"] + pub fn include_details(mut self, include_details: bool) -> Self { + self.include_details = Some(include_details); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/endpoints?", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ServiceEndpointList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpointList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpoint> { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceEndpoint = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ServiceEndpoint, } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/serviceendpoint/endpoints", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ServiceEndpoint>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpoint>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_service_endpoints { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceEndpointList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::ServiceEndpoint>, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/serviceendpoint/endpoints", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ServiceEndpointList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpointList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_service_endpoint { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpoint> { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceEndpoint = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ServiceEndpoint, + pub(crate) endpoint_id: String, + pub(crate) operation: Option<String>, + } + impl RequestBuilder { + #[doc = "operation type"] + pub fn operation(mut self, operation: impl Into<String>) -> Self { + self.operation = Some(operation.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/serviceendpoint/endpoints/{}", + this.client.endpoint(), + &this.organization, + &this.endpoint_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ServiceEndpoint>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpoint>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod share_service_endpoint { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::ServiceEndpointProjectReference>, + pub(crate) endpoint_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/serviceendpoint/endpoints/{}", + this.client.endpoint(), + &this.organization, + &this.endpoint_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) endpoint_id: String, + pub(crate) project_ids: String, + pub(crate) deep: Option<bool>, + } + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/serviceendpoint/endpoints/{}", + this.client.endpoint(), + &this.organization, + &this.endpoint_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) + } + pub mod get_service_endpoints_by_names { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceEndpointList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod endpointproxy { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) endpoint_names: String, + pub(crate) type_: Option<String>, + pub(crate) auth_schemes: Option<String>, + pub(crate) owner: Option<String>, + pub(crate) include_failed: Option<bool>, + pub(crate) include_details: Option<bool>, + } + impl RequestBuilder { + #[doc = "Type of the service endpoints."] + pub fn type_(mut self, type_: impl Into<String>) -> Self { + self.type_ = Some(type_.into()); + self + } + #[doc = "Authorization schemes used for service endpoints."] + pub fn auth_schemes(mut self, auth_schemes: impl Into<String>) -> Self { + self.auth_schemes = Some(auth_schemes.into()); + self + } + #[doc = "Owner for service endpoints."] + pub fn owner(mut self, owner: impl Into<String>) -> Self { + self.owner = Some(owner.into()); + self + } + #[doc = "Failed flag for service endpoints."] + pub fn include_failed(mut self, include_failed: bool) -> Self { + self.include_failed = Some(include_failed); + self + } + #[doc = "Flag to include more details for service endpoints. This is for internal use only and the flag will be treated as false for all other requests"] + pub fn include_details(mut self, include_details: bool) -> Self { + self.include_details = Some(include_details); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/endpoints", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ServiceEndpointList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpointList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_service_endpoints_with_refreshed_authentication { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Proxy for a GET request defined by a service endpoint."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Service endpoint request."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `endpoint_id`: Id of the service endpoint."] - pub fn execute_service_endpoint_request( - &self, - organization: impl Into<String>, - body: impl Into<models::ServiceEndpointRequest>, - project: impl Into<String>, - endpoint_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Describes the data source to fetch."] - #[doc = "* `project`: Project ID or project name"] - pub fn query( - &self, - organization: impl Into<String>, - body: impl Into<models::DataSourceBinding>, - project: impl Into<String>, - ) -> query::RequestBuilder { - query::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - } - pub mod execute_service_endpoint_request { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ServiceEndpointRequestResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointRequestResult = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ServiceEndpointRequest, - pub(crate) project: String, - pub(crate) endpoint_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/endpointproxy?endpointId={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.endpoint_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServiceEndpointRequestResult>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ServiceEndpointRequestResult>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::DataSourceBinding, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/endpointproxy", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceEndpointList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod endpoints { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::RefreshAuthenticationParameters>, + pub(crate) project: String, + pub(crate) endpoint_ids: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/endpoints", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ServiceEndpointList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpointList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get the service endpoints."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_service_endpoints( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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, - } - } - #[doc = "Creates a new service endpoint"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Service endpoint to create"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::ServiceEndpoint>, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } - #[doc = "Update the service endpoints."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Names of the service endpoints to update."] - pub fn update_service_endpoints( - &self, - organization: impl Into<String>, - body: Vec<models::ServiceEndpoint>, - ) -> update_service_endpoints::RequestBuilder { - update_service_endpoints::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body, - } - } - #[doc = "Update the service endpoint"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Updated data for the endpoint"] - #[doc = "* `endpoint_id`: Endpoint Id of the endpoint to update"] - pub fn update_service_endpoint( - &self, - organization: impl Into<String>, - body: impl Into<models::ServiceEndpoint>, - endpoint_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Project reference details of the target project"] - #[doc = "* `endpoint_id`: Endpoint Id of the endpoint to share"] - pub fn share_service_endpoint( - &self, - organization: impl Into<String>, - body: Vec<models::ServiceEndpointProjectReference>, - endpoint_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `endpoint_id`: Endpoint Id of endpoint to delete"] - #[doc = "* `project_ids`: project Ids from which endpoint needs to be deleted"] - pub fn delete( - &self, - organization: impl Into<String>, - endpoint_id: impl Into<String>, - project_ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `endpoint_names`: Names of the service endpoints."] - pub fn get_service_endpoints_by_names( - &self, - organization: impl Into<String>, - project: impl Into<String>, - endpoint_names: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Scope, Validity of Token requested."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `endpoint_ids`: Ids of the service endpoints."] - pub fn get_service_endpoints_with_refreshed_authentication( - &self, - organization: impl Into<String>, - body: Vec<models::RefreshAuthenticationParameters>, - project: impl Into<String>, - endpoint_ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `endpoint_id`: Id of the service endpoint."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - endpoint_id: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - endpoint_id: endpoint_id.into(), - action_filter: None, - } - } - } - pub mod get_service_endpoints { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) type_: Option<String>, - pub(crate) auth_schemes: Option<String>, - pub(crate) endpoint_ids: Option<String>, - pub(crate) owner: Option<String>, - pub(crate) include_failed: Option<bool>, - pub(crate) include_details: Option<bool>, - } - impl RequestBuilder { - #[doc = "Type of the service endpoints."] - pub fn type_(mut self, type_: impl Into<String>) -> Self { - self.type_ = Some(type_.into()); - self - } - #[doc = "Authorization schemes used for service endpoints."] - pub fn auth_schemes(mut self, auth_schemes: impl Into<String>) -> Self { - self.auth_schemes = Some(auth_schemes.into()); - self - } - #[doc = "Ids of the service endpoints."] - pub fn endpoint_ids(mut self, endpoint_ids: impl Into<String>) -> Self { - self.endpoint_ids = Some(endpoint_ids.into()); - self - } - #[doc = "Owner for service endpoints."] - pub fn owner(mut self, owner: impl Into<String>) -> Self { - self.owner = Some(owner.into()); - self - } - #[doc = "Failed flag for service endpoints."] - pub fn include_failed(mut self, include_failed: bool) -> Self { - self.include_failed = Some(include_failed); - self - } - #[doc = "Flag to include more details for service endpoints. This is for internal use only and the flag will be treated as false for all other requests"] - pub fn include_details(mut self, include_details: bool) -> Self { - self.include_details = Some(include_details); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/endpoints?", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServiceEndpointList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ServiceEndpointList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpoint> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpoint = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ServiceEndpoint, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/serviceendpoint/endpoints", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServiceEndpoint>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpoint>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_service_endpoints { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::ServiceEndpoint>, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/serviceendpoint/endpoints", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServiceEndpointList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ServiceEndpointList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_service_endpoint { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpoint> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpoint = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ServiceEndpoint, - pub(crate) endpoint_id: String, - pub(crate) operation: Option<String>, - } - impl RequestBuilder { - #[doc = "operation type"] - pub fn operation(mut self, operation: impl Into<String>) -> Self { - self.operation = Some(operation.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/serviceendpoint/endpoints/{}", - this.client.endpoint(), - &this.organization, - &this.endpoint_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServiceEndpoint>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpoint>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod share_service_endpoint { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::ServiceEndpointProjectReference>, - pub(crate) endpoint_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/serviceendpoint/endpoints/{}", - this.client.endpoint(), - &this.organization, - &this.endpoint_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) endpoint_id: String, - pub(crate) project_ids: String, - pub(crate) deep: Option<bool>, - } - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/serviceendpoint/endpoints/{}", - this.client.endpoint(), - &this.organization, - &this.endpoint_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_service_endpoints_by_names { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) endpoint_names: String, - pub(crate) type_: Option<String>, - pub(crate) auth_schemes: Option<String>, - pub(crate) owner: Option<String>, - pub(crate) include_failed: Option<bool>, - pub(crate) include_details: Option<bool>, - } - impl RequestBuilder { - #[doc = "Type of the service endpoints."] - pub fn type_(mut self, type_: impl Into<String>) -> Self { - self.type_ = Some(type_.into()); - self - } - #[doc = "Authorization schemes used for service endpoints."] - pub fn auth_schemes(mut self, auth_schemes: impl Into<String>) -> Self { - self.auth_schemes = Some(auth_schemes.into()); - self - } - #[doc = "Owner for service endpoints."] - pub fn owner(mut self, owner: impl Into<String>) -> Self { - self.owner = Some(owner.into()); - self - } - #[doc = "Failed flag for service endpoints."] - pub fn include_failed(mut self, include_failed: bool) -> Self { - self.include_failed = Some(include_failed); - self - } - #[doc = "Flag to include more details for service endpoints. This is for internal use only and the flag will be treated as false for all other requests"] - pub fn include_details(mut self, include_details: bool) -> Self { - self.include_details = Some(include_details); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/endpoints", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServiceEndpointList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ServiceEndpointList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_service_endpoints_with_refreshed_authentication { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::RefreshAuthenticationParameters>, - pub(crate) project: String, - pub(crate) endpoint_ids: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/endpoints", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServiceEndpointList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ServiceEndpointList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpoint> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpoint = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) endpoint_id: String, - pub(crate) action_filter: Option<String>, - } - 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, action_filter: impl Into<String>) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/endpoints/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.endpoint_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", action_filter); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServiceEndpoint>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpoint>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpoint> { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceEndpoint = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) endpoint_id: String, + pub(crate) action_filter: Option<String>, + } + 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, action_filter: impl Into<String>) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/endpoints/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.endpoint_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(action_filter) = &this.action_filter { + req + .url_mut() + .query_pairs_mut() + .append_pair("actionFilter", action_filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ServiceEndpoint>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpoint>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } pub mod types { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get service endpoint types."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + type_: None, + scheme: None, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get service endpoint types."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - type_: None, - scheme: None, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointTypeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointTypeList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) type_: Option<String>, - pub(crate) scheme: Option<String>, - } - impl RequestBuilder { - #[doc = "Type of service endpoint."] - pub fn type_(mut self, type_: impl Into<String>) -> Self { - self.type_ = Some(type_.into()); - self - } - #[doc = "Scheme of service endpoint."] - pub fn scheme(mut self, scheme: impl Into<String>) -> Self { - self.scheme = Some(scheme.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/serviceendpoint/types", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServiceEndpointTypeList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ServiceEndpointTypeList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointTypeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceEndpointTypeList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) type_: Option<String>, + pub(crate) scheme: Option<String>, + } + impl RequestBuilder { + #[doc = "Type of service endpoint."] + pub fn type_(mut self, type_: impl Into<String>) -> Self { + self.type_ = Some(type_.into()); + self + } + #[doc = "Scheme of service endpoint."] + pub fn scheme(mut self, scheme: impl Into<String>) -> Self { + self.scheme = Some(scheme.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/serviceendpoint/types", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ServiceEndpointTypeList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpointTypeList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod executionhistory { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get service endpoint execution records."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `endpoint_id`: Id of the service endpoint."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + endpoint_id: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + endpoint_id: endpoint_id.into(), + top: None, + continuation_token: None, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get service endpoint execution records."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `endpoint_id`: Id of the service endpoint."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - endpoint_id: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - endpoint_id: endpoint_id.into(), - top: None, - continuation_token: None, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ServiceEndpointExecutionRecordList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceEndpointExecutionRecordList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) endpoint_id: String, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<i64>, - } - impl RequestBuilder { - #[doc = "Number of service endpoint execution records to get."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "A continuation token, returned by a previous call to this method, that can be used to return the next set of records"] - pub fn continuation_token(mut self, continuation_token: i64) -> Self { - self.continuation_token = Some(continuation_token); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/{}/executionhistory", - this.client.endpoint(), - &this.organization, - &this.project, - &this.endpoint_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServiceEndpointExecutionRecordList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ServiceEndpointExecutionRecordList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::ServiceEndpointExecutionRecordList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceEndpointExecutionRecordList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) endpoint_id: String, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<i64>, + } + impl RequestBuilder { + #[doc = "Number of service endpoint execution records to get."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "A continuation token, returned by a previous call to this method, that can be used to return the next set of records"] + pub fn continuation_token(mut self, continuation_token: i64) -> Self { + self.continuation_token = Some(continuation_token); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/{}/executionhistory", + this.client.endpoint(), + &this.organization, + &this.project, + &this.endpoint_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ServiceEndpointExecutionRecordList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::ServiceEndpointExecutionRecordList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/service_endpoint/models.rs b/azure_devops_rust_api/src/service_endpoint/models.rs index 6e8dd33d..ac029abc 100644 --- a/azure_devops_rust_api/src/service_endpoint/models.rs +++ b/azure_devops_rust_api/src/service_endpoint/models.rs @@ -8,2009 +8,1998 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AadOauthTokenRequest { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub refresh: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option<String>, - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub token: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub refresh: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option<String>, + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option<String>, } impl AadOauthTokenRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AadOauthTokenResult { - #[serde( - rename = "accessToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub access_token: Option<String>, - #[serde( - rename = "refreshTokenCache", - default, - skip_serializing_if = "Option::is_none" - )] - pub refresh_token_cache: Option<String>, + #[serde( + rename = "accessToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub access_token: Option<String>, + #[serde( + rename = "refreshTokenCache", + default, + skip_serializing_if = "Option::is_none" + )] + pub refresh_token_cache: Option<String>, } impl AadOauthTokenResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuthConfiguration { - #[serde(flatten)] - pub o_auth_configuration: OAuthConfiguration, - #[doc = "Gets or sets parameters contained in configuration object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<serde_json::Value>, + #[serde(flatten)] + pub o_auth_configuration: OAuthConfiguration, + #[doc = "Gets or sets parameters contained in configuration object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<serde_json::Value>, } impl AuthConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Specifies the authentication scheme to be used for authentication."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuthenticationSchemeReference { - #[doc = "Gets or sets the key and value of the fields used for authentication."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inputs: Option<serde_json::Value>, - #[doc = "Gets or sets the type of authentication scheme of an endpoint."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Gets or sets the key and value of the fields used for authentication."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inputs: Option<serde_json::Value>, + #[doc = "Gets or sets the type of authentication scheme of an endpoint."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl AuthenticationSchemeReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the header of the REST request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuthorizationHeader { - #[doc = "Gets or sets the name of authorization header."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the value of authorization header."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Gets or sets the name of authorization header."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the value of authorization header."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl AuthorizationHeader { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureAppService { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl AzureAppService { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureKeyVaultPermission { - #[serde(flatten)] - pub azure_resource_permission: AzureResourcePermission, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub vault: Option<String>, + #[serde(flatten)] + pub azure_resource_permission: AzureResourcePermission, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vault: Option<String>, } impl AzureKeyVaultPermission { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureMlWorkspace { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl AzureMlWorkspace { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Azure Management Group"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureManagementGroup { - #[doc = "Display name of azure management group"] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Id of azure management group"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Azure management group name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Id of tenant from which azure management group belogs"] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option<String>, + #[doc = "Display name of azure management group"] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Id of azure management group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Azure management group name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Id of tenant from which azure management group belogs"] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option<String>, } impl AzureManagementGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Azure management group query result"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureManagementGroupQueryResult { - #[doc = "Error message in case of an exception"] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "List of azure management groups"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<AzureManagementGroup>, + #[doc = "Error message in case of an exception"] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "List of azure management groups"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<AzureManagementGroup>, } impl AzureManagementGroupQueryResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzurePermission { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub provisioned: Option<bool>, - #[serde( - rename = "resourceProvider", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_provider: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provisioned: Option<bool>, + #[serde( + rename = "resourceProvider", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_provider: Option<String>, } impl AzurePermission { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureResourcePermission { - #[serde(flatten)] - pub azure_permission: AzurePermission, - #[serde( - rename = "resourceGroup", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_group: Option<String>, + #[serde(flatten)] + pub azure_permission: AzurePermission, + #[serde( + rename = "resourceGroup", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_group: Option<String>, } impl AzureResourcePermission { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureRoleAssignmentPermission { - #[serde(flatten)] - pub azure_permission: AzurePermission, - #[serde( - rename = "roleAssignmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub role_assignment_id: Option<String>, + #[serde(flatten)] + pub azure_permission: AzurePermission, + #[serde( + rename = "roleAssignmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub role_assignment_id: Option<String>, } impl AzureRoleAssignmentPermission { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureSpnOperationStatus { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub severity: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde( - rename = "statusMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_message: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde( + rename = "statusMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_message: Option<String>, } impl AzureSpnOperationStatus { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureSubscription { - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde( - rename = "subscriptionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_id: Option<String>, - #[serde( - rename = "subscriptionTenantId", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_tenant_id: Option<String>, - #[serde( - rename = "subscriptionTenantName", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_tenant_name: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde( + rename = "subscriptionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_id: Option<String>, + #[serde( + rename = "subscriptionTenantId", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_tenant_id: Option<String>, + #[serde( + rename = "subscriptionTenantName", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_tenant_name: Option<String>, } impl AzureSubscription { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AzureSubscriptionQueryResult { - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<AzureSubscription>, + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<AzureSubscription>, } impl AzureSubscriptionQueryResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Specifies the client certificate to be used for the endpoint request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ClientCertificate { - #[doc = "Gets or sets the value of client certificate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Gets or sets the value of client certificate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl ClientCertificate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Specifies the data sources for this endpoint."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataSource { - #[doc = "Specifies the authentication scheme to be used for authentication."] - #[serde( - rename = "authenticationScheme", - default, - skip_serializing_if = "Option::is_none" - )] - pub authentication_scheme: Option<AuthenticationSchemeReference>, - #[doc = "Gets or sets the pagination format supported by this data source(ContinuationToken/SkipTop)."] - #[serde( - rename = "callbackContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_context_template: Option<String>, - #[doc = "Gets or sets the template to check if subsequent call is needed."] - #[serde( - rename = "callbackRequiredTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_required_template: Option<String>, - #[doc = "Gets or sets the endpoint url of the data source."] - #[serde( - rename = "endpointUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_url: Option<String>, - #[doc = "Gets or sets the authorization headers of the request."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub headers: Vec<AuthorizationHeader>, - #[doc = "Gets or sets the initial value of the query params."] - #[serde( - rename = "initialContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub initial_context_template: Option<String>, - #[doc = "Gets or sets the name of the data source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the request content of the endpoint request."] - #[serde( - rename = "requestContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_content: Option<String>, - #[doc = "Gets or sets the request method of the endpoint request."] - #[serde( - rename = "requestVerb", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_verb: Option<String>, - #[doc = "Gets or sets the resource url of the endpoint request."] - #[serde( - rename = "resourceUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_url: Option<String>, - #[doc = "Gets or sets the result selector to filter the response of the endpoint request."] - #[serde( - rename = "resultSelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_selector: Option<String>, + #[doc = "Specifies the authentication scheme to be used for authentication."] + #[serde( + rename = "authenticationScheme", + default, + skip_serializing_if = "Option::is_none" + )] + pub authentication_scheme: Option<AuthenticationSchemeReference>, + #[doc = "Gets or sets the pagination format supported by this data source(ContinuationToken/SkipTop)."] + #[serde( + rename = "callbackContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_context_template: Option<String>, + #[doc = "Gets or sets the template to check if subsequent call is needed."] + #[serde( + rename = "callbackRequiredTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_required_template: Option<String>, + #[doc = "Gets or sets the endpoint url of the data source."] + #[serde( + rename = "endpointUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_url: Option<String>, + #[doc = "Gets or sets the authorization headers of the request."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub headers: Vec<AuthorizationHeader>, + #[doc = "Gets or sets the initial value of the query params."] + #[serde( + rename = "initialContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub initial_context_template: Option<String>, + #[doc = "Gets or sets the name of the data source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the request content of the endpoint request."] + #[serde( + rename = "requestContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_content: Option<String>, + #[doc = "Gets or sets the request method of the endpoint request."] + #[serde( + rename = "requestVerb", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_verb: Option<String>, + #[doc = "Gets or sets the resource url of the endpoint request."] + #[serde( + rename = "resourceUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_url: Option<String>, + #[doc = "Gets or sets the result selector to filter the response of the endpoint request."] + #[serde( + rename = "resultSelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_selector: Option<String>, } impl DataSource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the data source binding of the endpoint."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataSourceBinding { - #[serde(flatten)] - pub data_source_binding_base: DataSourceBindingBase, + #[serde(flatten)] + pub data_source_binding_base: DataSourceBindingBase, } impl DataSourceBinding { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents binding of data source for the service endpoint request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataSourceBindingBase { - #[doc = "Pagination format supported by this data source(ContinuationToken/SkipTop)."] - #[serde( - rename = "callbackContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_context_template: Option<String>, - #[doc = "Subsequent calls needed?"] - #[serde( - rename = "callbackRequiredTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_required_template: Option<String>, - #[doc = "Gets or sets the name of the data source."] - #[serde( - rename = "dataSourceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub data_source_name: Option<String>, - #[doc = "Gets or sets the endpoint Id."] - #[serde( - rename = "endpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_id: Option<String>, - #[doc = "Gets or sets the url of the service endpoint."] - #[serde( - rename = "endpointUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_url: Option<String>, - #[doc = "Gets or sets the authorization headers."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub headers: Vec<AuthorizationHeader>, - #[doc = "Defines the initial value of the query params"] - #[serde( - rename = "initialContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub initial_context_template: Option<String>, - #[doc = "Gets or sets the parameters for the data source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<serde_json::Value>, - #[doc = "Gets or sets http request body"] - #[serde( - rename = "requestContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_content: Option<String>, - #[doc = "Gets or sets http request verb"] - #[serde( - rename = "requestVerb", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_verb: Option<String>, - #[doc = "Gets or sets the result selector."] - #[serde( - rename = "resultSelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_selector: Option<String>, - #[doc = "Gets or sets the result template."] - #[serde( - rename = "resultTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_template: Option<String>, - #[doc = "Gets or sets the target of the data source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<String>, + #[doc = "Pagination format supported by this data source(ContinuationToken/SkipTop)."] + #[serde( + rename = "callbackContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_context_template: Option<String>, + #[doc = "Subsequent calls needed?"] + #[serde( + rename = "callbackRequiredTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_required_template: Option<String>, + #[doc = "Gets or sets the name of the data source."] + #[serde( + rename = "dataSourceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub data_source_name: Option<String>, + #[doc = "Gets or sets the endpoint Id."] + #[serde( + rename = "endpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_id: Option<String>, + #[doc = "Gets or sets the url of the service endpoint."] + #[serde( + rename = "endpointUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_url: Option<String>, + #[doc = "Gets or sets the authorization headers."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub headers: Vec<AuthorizationHeader>, + #[doc = "Defines the initial value of the query params"] + #[serde( + rename = "initialContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub initial_context_template: Option<String>, + #[doc = "Gets or sets the parameters for the data source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<serde_json::Value>, + #[doc = "Gets or sets http request body"] + #[serde( + rename = "requestContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_content: Option<String>, + #[doc = "Gets or sets http request verb"] + #[serde( + rename = "requestVerb", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_verb: Option<String>, + #[doc = "Gets or sets the result selector."] + #[serde( + rename = "resultSelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_selector: Option<String>, + #[doc = "Gets or sets the result template."] + #[serde( + rename = "resultTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_template: Option<String>, + #[doc = "Gets or sets the target of the data source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<String>, } impl DataSourceBindingBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents details of the service endpoint data source."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DataSourceDetails { - #[doc = "Gets or sets the data source name."] - #[serde( - rename = "dataSourceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub data_source_name: Option<String>, - #[doc = "Gets or sets the data source url."] - #[serde( - rename = "dataSourceUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub data_source_url: Option<String>, - #[doc = "Gets or sets the request headers."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub headers: Vec<AuthorizationHeader>, - #[doc = "Gets or sets the initialization context used for the initial call to the data source"] - #[serde( - rename = "initialContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub initial_context_template: Option<String>, - #[doc = "Gets the parameters of data source."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<serde_json::Value>, - #[doc = "Gets or sets the data source request content."] - #[serde( - rename = "requestContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_content: Option<String>, - #[doc = "Gets or sets the data source request verb. Get/Post are the only implemented types"] - #[serde( - rename = "requestVerb", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_verb: Option<String>, - #[doc = "Gets or sets the resource url of data source."] - #[serde( - rename = "resourceUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub resource_url: Option<String>, - #[doc = "Gets or sets the result selector."] - #[serde( - rename = "resultSelector", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_selector: Option<String>, + #[doc = "Gets or sets the data source name."] + #[serde( + rename = "dataSourceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub data_source_name: Option<String>, + #[doc = "Gets or sets the data source url."] + #[serde( + rename = "dataSourceUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub data_source_url: Option<String>, + #[doc = "Gets or sets the request headers."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub headers: Vec<AuthorizationHeader>, + #[doc = "Gets or sets the initialization context used for the initial call to the data source"] + #[serde( + rename = "initialContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub initial_context_template: Option<String>, + #[doc = "Gets the parameters of data source."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<serde_json::Value>, + #[doc = "Gets or sets the data source request content."] + #[serde( + rename = "requestContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_content: Option<String>, + #[doc = "Gets or sets the data source request verb. Get/Post are the only implemented types"] + #[serde( + rename = "requestVerb", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_verb: Option<String>, + #[doc = "Gets or sets the resource url of data source."] + #[serde( + rename = "resourceUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub resource_url: Option<String>, + #[doc = "Gets or sets the result selector."] + #[serde( + rename = "resultSelector", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_selector: Option<String>, } impl DataSourceDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the details of the input on which a given input is dependent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DependencyBinding { - #[doc = "Gets or sets the value of the field on which url is dependent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub key: Option<String>, - #[doc = "Gets or sets the corresponding value of url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Gets or sets the value of the field on which url is dependent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key: Option<String>, + #[doc = "Gets or sets the corresponding value of url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl DependencyBinding { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the dependency data for the endpoint inputs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DependencyData { - #[doc = "Gets or sets the category of dependency data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub input: Option<String>, - #[doc = "Gets or sets the key-value pair to specify properties and their values."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub map: Vec<serde_json::Value>, + #[doc = "Gets or sets the category of dependency data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub input: Option<String>, + #[doc = "Gets or sets the key-value pair to specify properties and their values."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub map: Vec<serde_json::Value>, } impl DependencyData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the inputs on which any given input is dependent."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DependsOn { - #[doc = "Gets or sets the ID of the field on which URL's value is dependent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub input: Option<String>, - #[doc = "Gets or sets key-value pair containing other's field value and corresponding url value."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub map: Vec<DependencyBinding>, + #[doc = "Gets or sets the ID of the field on which URL's value is dependent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub input: Option<String>, + #[doc = "Gets or sets key-value pair containing other's field value and corresponding url value."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub map: Vec<DependencyBinding>, } impl DependsOn { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the authorization used for service endpoint."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EndpointAuthorization { - #[doc = "Gets or sets the parameters for the selected authorization scheme."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parameters: Option<serde_json::Value>, - #[doc = "Gets or sets the scheme used for service endpoint authentication."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scheme: Option<String>, + #[doc = "Gets or sets the parameters for the selected authorization scheme."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option<serde_json::Value>, + #[doc = "Gets or sets the scheme used for service endpoint authentication."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scheme: Option<String>, } impl EndpointAuthorization { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EndpointOperationStatus { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde( - rename = "statusMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_message: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde( + rename = "statusMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_message: Option<String>, } impl EndpointOperationStatus { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents url of the service endpoint."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EndpointUrl { - #[doc = "Represents the inputs on which any given input is dependent."] - #[serde(rename = "dependsOn", default, skip_serializing_if = "Option::is_none")] - pub depends_on: Option<DependsOn>, - #[doc = "Gets or sets the display name of service endpoint url."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Gets or sets the format of the url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option<String>, - #[doc = "Gets or sets the help text of service endpoint url."] - #[serde(rename = "helpText", default, skip_serializing_if = "Option::is_none")] - pub help_text: Option<String>, - #[doc = "Gets or sets the visibility of service endpoint url."] - #[serde(rename = "isVisible", default, skip_serializing_if = "Option::is_none")] - pub is_visible: Option<String>, - #[doc = "Gets or sets the value of service endpoint url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Represents the inputs on which any given input is dependent."] + #[serde(rename = "dependsOn", default, skip_serializing_if = "Option::is_none")] + pub depends_on: Option<DependsOn>, + #[doc = "Gets or sets the display name of service endpoint url."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Gets or sets the format of the url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub format: Option<String>, + #[doc = "Gets or sets the help text of service endpoint url."] + #[serde(rename = "helpText", default, skip_serializing_if = "Option::is_none")] + pub help_text: Option<String>, + #[doc = "Gets or sets the visibility of service endpoint url."] + #[serde(rename = "isVisible", default, skip_serializing_if = "Option::is_none")] + pub is_visible: Option<String>, + #[doc = "Gets or sets the value of service endpoint url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl EndpointUrl { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Specifies the public url of the help documentation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HelpLink { - #[doc = "Gets or sets the help text."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, - #[doc = "Gets or sets the public url of the help documentation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Gets or sets the help text."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, + #[doc = "Gets or sets the public url of the help documentation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl HelpLink { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde( - rename = "uniqueName", - default, - skip_serializing_if = "Option::is_none" - )] - pub unique_name: Option<String>, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde( + rename = "uniqueName", + default, + skip_serializing_if = "Option::is_none" + )] + pub unique_name: Option<String>, } impl IdentityRef { - pub fn new(id: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name: None, - } - } + pub fn new(id: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name: None, + } + } } #[doc = "Describes an input for subscriptions."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputDescriptor { - #[doc = "The ids of all inputs that the value of this input is dependent on."] - #[serde( - rename = "dependencyInputIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dependency_input_ids: Vec<String>, - #[doc = "Description of what this input is used for"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group."] - #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] - pub group_name: Option<String>, - #[doc = "If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change."] - #[serde( - rename = "hasDynamicValueInformation", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_dynamic_value_information: Option<bool>, - #[doc = "Identifier for the subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Mode in which the value of this input should be entered"] - #[serde(rename = "inputMode", default, skip_serializing_if = "Option::is_none")] - pub input_mode: Option<input_descriptor::InputMode>, - #[doc = "Gets whether this input is confidential, such as for a password or application key"] - #[serde( - rename = "isConfidential", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_confidential: Option<bool>, - #[doc = "Localized name which can be shown as a label for the subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Custom properties for the input which can be used by the service provider"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "Gets whether this input is included in the default generated action description."] - #[serde( - rename = "useInDefaultDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub use_in_default_description: Option<bool>, - #[doc = "Describes what values are valid for a subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub validation: Option<InputValidation>, - #[doc = "A hint for input value. It can be used in the UI as the input placeholder."] - #[serde(rename = "valueHint", default, skip_serializing_if = "Option::is_none")] - pub value_hint: Option<String>, - #[doc = "Information about the possible/allowed values for a given subscription input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub values: Option<InputValues>, + #[doc = "The ids of all inputs that the value of this input is dependent on."] + #[serde( + rename = "dependencyInputIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dependency_input_ids: Vec<String>, + #[doc = "Description of what this input is used for"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group."] + #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] + pub group_name: Option<String>, + #[doc = "If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change."] + #[serde( + rename = "hasDynamicValueInformation", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_dynamic_value_information: Option<bool>, + #[doc = "Identifier for the subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Mode in which the value of this input should be entered"] + #[serde(rename = "inputMode", default, skip_serializing_if = "Option::is_none")] + pub input_mode: Option<input_descriptor::InputMode>, + #[doc = "Gets whether this input is confidential, such as for a password or application key"] + #[serde( + rename = "isConfidential", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_confidential: Option<bool>, + #[doc = "Localized name which can be shown as a label for the subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Custom properties for the input which can be used by the service provider"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "Gets whether this input is included in the default generated action description."] + #[serde( + rename = "useInDefaultDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub use_in_default_description: Option<bool>, + #[doc = "Describes what values are valid for a subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub validation: Option<InputValidation>, + #[doc = "A hint for input value. It can be used in the UI as the input placeholder."] + #[serde(rename = "valueHint", default, skip_serializing_if = "Option::is_none")] + pub value_hint: Option<String>, + #[doc = "Information about the possible/allowed values for a given subscription input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option<InputValues>, } impl InputDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod input_descriptor { - use super::*; - #[doc = "Mode in which the value of this input should be entered"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum InputMode { - #[serde(rename = "none")] - None, - #[serde(rename = "textBox")] - TextBox, - #[serde(rename = "passwordBox")] - PasswordBox, - #[serde(rename = "combo")] - Combo, - #[serde(rename = "radioButtons")] - RadioButtons, - #[serde(rename = "checkBox")] - CheckBox, - #[serde(rename = "textArea")] - TextArea, - } + use super::*; + #[doc = "Mode in which the value of this input should be entered"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum InputMode { + #[serde(rename = "none")] + None, + #[serde(rename = "textBox")] + TextBox, + #[serde(rename = "passwordBox")] + PasswordBox, + #[serde(rename = "combo")] + Combo, + #[serde(rename = "radioButtons")] + RadioButtons, + #[serde(rename = "checkBox")] + CheckBox, + #[serde(rename = "textArea")] + TextArea, + } } #[doc = "Describes what values are valid for a subscription input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValidation { - #[doc = "Gets or sets the data type to validate."] - #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] - pub data_type: Option<input_validation::DataType>, - #[doc = "Gets or sets if this is a required field."] - #[serde( - rename = "isRequired", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_required: Option<bool>, - #[doc = "Gets or sets the maximum length of this descriptor."] - #[serde(rename = "maxLength", default, skip_serializing_if = "Option::is_none")] - pub max_length: Option<i32>, - #[doc = "Gets or sets the minimum value for this descriptor."] - #[serde(rename = "maxValue", default, skip_serializing_if = "Option::is_none")] - pub max_value: Option<String>, - #[doc = "Gets or sets the minimum length of this descriptor."] - #[serde(rename = "minLength", default, skip_serializing_if = "Option::is_none")] - pub min_length: Option<i32>, - #[doc = "Gets or sets the minimum value for this descriptor."] - #[serde(rename = "minValue", default, skip_serializing_if = "Option::is_none")] - pub min_value: Option<String>, - #[doc = "Gets or sets the pattern to validate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pattern: Option<String>, - #[doc = "Gets or sets the error on pattern mismatch."] - #[serde( - rename = "patternMismatchErrorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub pattern_mismatch_error_message: Option<String>, + #[doc = "Gets or sets the data data type to validate."] + #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] + pub data_type: Option<input_validation::DataType>, + #[doc = "Gets or sets if this is a required field."] + #[serde( + rename = "isRequired", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_required: Option<bool>, + #[doc = "Gets or sets the maximum length of this descriptor."] + #[serde(rename = "maxLength", default, skip_serializing_if = "Option::is_none")] + pub max_length: Option<i32>, + #[doc = "Gets or sets the minimum value for this descriptor."] + #[serde(rename = "maxValue", default, skip_serializing_if = "Option::is_none")] + pub max_value: Option<String>, + #[doc = "Gets or sets the minimum length of this descriptor."] + #[serde(rename = "minLength", default, skip_serializing_if = "Option::is_none")] + pub min_length: Option<i32>, + #[doc = "Gets or sets the minimum value for this descriptor."] + #[serde(rename = "minValue", default, skip_serializing_if = "Option::is_none")] + pub min_value: Option<String>, + #[doc = "Gets or sets the pattern to validate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pattern: Option<String>, + #[doc = "Gets or sets the error on pattern mismatch."] + #[serde( + rename = "patternMismatchErrorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub pattern_mismatch_error_message: Option<String>, } impl InputValidation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod input_validation { - use super::*; - #[doc = "Gets or sets the data type to validate."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DataType { - #[serde(rename = "none")] - None, - #[serde(rename = "string")] - String, - #[serde(rename = "number")] - Number, - #[serde(rename = "boolean")] - Boolean, - #[serde(rename = "guid")] - Guid, - #[serde(rename = "uri")] - Uri, - } + use super::*; + #[doc = "Gets or sets the data data type to validate."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DataType { + #[serde(rename = "none")] + None, + #[serde(rename = "string")] + String, + #[serde(rename = "number")] + Number, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "guid")] + Guid, + #[serde(rename = "uri")] + Uri, + } } #[doc = "Information about a single value for an input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValue { - #[doc = "Any other data about this input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "The text to show for the display of this value"] - #[serde( - rename = "displayValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_value: Option<String>, - #[doc = "The value to store for this input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Any other data about this input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "The text to show for the display of this value"] + #[serde( + rename = "displayValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_value: Option<String>, + #[doc = "The value to store for this input"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl InputValue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Information about the possible/allowed values for a given subscription input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValues { - #[doc = "The default value to use for this input"] - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<String>, - #[doc = "Error information related to a subscription input value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option<InputValuesError>, - #[doc = "The id of the input"] - #[serde(rename = "inputId", default, skip_serializing_if = "Option::is_none")] - pub input_id: Option<String>, - #[doc = "Should this input be disabled"] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False)"] - #[serde( - rename = "isLimitedToPossibleValues", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_limited_to_possible_values: Option<bool>, - #[doc = "Should this input be made read-only"] - #[serde( - rename = "isReadOnly", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_read_only: Option<bool>, - #[doc = "Possible values that this input can take"] - #[serde( - rename = "possibleValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub possible_values: Vec<InputValue>, + #[doc = "The default value to use for this input"] + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<String>, + #[doc = "Error information related to a subscription input value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option<InputValuesError>, + #[doc = "The id of the input"] + #[serde(rename = "inputId", default, skip_serializing_if = "Option::is_none")] + pub input_id: Option<String>, + #[doc = "Should this input be disabled"] + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[doc = "Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False)"] + #[serde( + rename = "isLimitedToPossibleValues", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_limited_to_possible_values: Option<bool>, + #[doc = "Should this input be made read-only"] + #[serde( + rename = "isReadOnly", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_read_only: Option<bool>, + #[doc = "Possible values that this input can take"] + #[serde( + rename = "possibleValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub possible_values: Vec<InputValue>, } impl InputValues { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Error information related to a subscription input value."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InputValuesError { - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, } impl InputValuesError { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a JSON object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JObject { - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<JToken>, - #[doc = "Gets the node type for this JToken."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<JToken>, + #[doc = "Gets the node type for this JToken."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl JObject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an abstract JSON token."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JToken { - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub first: Box<Option<JToken>>, - #[doc = "Gets a value indicating whether this token has child tokens."] - #[serde(rename = "hasValues", default, skip_serializing_if = "Option::is_none")] - pub has_values: Option<bool>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Box<Option<JToken>>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub last: Box<Option<JToken>>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub next: Box<Option<JToken>>, - #[doc = "Gets or sets the parent."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option<String>, - #[doc = "Gets the path of the JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub previous: Box<Option<JToken>>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub root: Box<Option<JToken>>, - #[doc = "Gets the node type for this JToken."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first: Box<Option<JToken>>, + #[doc = "Gets a value indicating whether this token has child tokens."] + #[serde(rename = "hasValues", default, skip_serializing_if = "Option::is_none")] + pub has_values: Option<bool>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Box<Option<JToken>>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last: Box<Option<JToken>>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next: Box<Option<JToken>>, + #[doc = "Gets or sets the parent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option<String>, + #[doc = "Gets the path of the JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous: Box<Option<JToken>>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub root: Box<Option<JToken>>, + #[doc = "Gets the node type for this JToken."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl JToken { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OAuth2TokenResult { - #[serde( - rename = "accessToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub access_token: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option<String>, - #[serde( - rename = "errorDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_description: Option<String>, - #[serde(rename = "expiresIn", default, skip_serializing_if = "Option::is_none")] - pub expires_in: Option<String>, - #[serde(rename = "issuedAt", default, skip_serializing_if = "Option::is_none")] - pub issued_at: Option<String>, - #[serde( - rename = "refreshToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub refresh_token: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, + #[serde( + rename = "accessToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub access_token: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option<String>, + #[serde( + rename = "errorDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_description: Option<String>, + #[serde(rename = "expiresIn", default, skip_serializing_if = "Option::is_none")] + pub expires_in: Option<String>, + #[serde(rename = "issuedAt", default, skip_serializing_if = "Option::is_none")] + pub issued_at: Option<String>, + #[serde( + rename = "refreshToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub refresh_token: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, } impl OAuth2TokenResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OAuthConfiguration { - #[doc = "Gets or sets the ClientId"] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option<String>, - #[doc = "Gets or sets the ClientSecret"] - #[serde( - rename = "clientSecret", - default, - skip_serializing_if = "Option::is_none" - )] - pub client_secret: Option<String>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Gets or sets the time when config was created."] - #[serde( - rename = "createdOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on: Option<time::OffsetDateTime>, - #[doc = "Gets or sets the type of the endpoint."] - #[serde( - rename = "endpointType", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_type: Option<String>, - #[doc = "Gets or sets the unique identifier of this field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "Gets or sets the time when variable group was modified"] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Gets or sets the name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the Url"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Gets or sets the ClientId"] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option<String>, + #[doc = "Gets or sets the ClientSecret"] + #[serde( + rename = "clientSecret", + default, + skip_serializing_if = "Option::is_none" + )] + pub client_secret: Option<String>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "Gets or sets the time when config was created."] + #[serde( + rename = "createdOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on: Option<time::OffsetDateTime>, + #[doc = "Gets or sets the type of the endpoint."] + #[serde( + rename = "endpointType", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_type: Option<String>, + #[doc = "Gets or sets the unique identifier of this field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "Gets or sets the time when variable group was modified"] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Gets or sets the name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the Url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl OAuthConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OAuthConfigurationParams { - #[doc = "Gets or sets the ClientId"] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option<String>, - #[doc = "Gets or sets the ClientSecret"] - #[serde( - rename = "clientSecret", - default, - skip_serializing_if = "Option::is_none" - )] - pub client_secret: Option<String>, - #[doc = "Gets or sets the type of the endpoint."] - #[serde( - rename = "endpointType", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_type: Option<String>, - #[doc = "Gets or sets the name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Gets or sets the Url"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Gets or sets the ClientId"] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option<String>, + #[doc = "Gets or sets the ClientSecret"] + #[serde( + rename = "clientSecret", + default, + skip_serializing_if = "Option::is_none" + )] + pub client_secret: Option<String>, + #[doc = "Gets or sets the type of the endpoint."] + #[serde( + rename = "endpointType", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_type: Option<String>, + #[doc = "Gets or sets the name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Gets or sets the Url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl OAuthConfigurationParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OAuthEndpointStatus { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde( - rename = "statusMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_message: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde( + rename = "statusMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_message: Option<String>, } impl OAuthEndpointStatus { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Parameter { - #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] - pub is_secret: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] + pub is_secret: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl Parameter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProjectReference { - pub id: String, - pub name: String, + pub id: String, + pub name: String, } impl ProjectReference { - pub fn new(id: String, name: String) -> Self { - Self { id, name } - } + pub fn new(id: String, name: String) -> Self { + Self { id, name } + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Specify the properties for refreshing the endpoint authentication object being queried"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RefreshAuthenticationParameters { - #[doc = "EndpointId which needs new authentication params"] - #[serde( - rename = "endpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_id: Option<String>, - #[doc = "Scope of the token requested. For GitHub marketplace apps, scope contains repository Ids"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub scope: Vec<i32>, - #[doc = "The requested endpoint authentication should be valid for _ minutes. Authentication params will not be refreshed if the token contained in endpoint already has active token."] - #[serde( - rename = "tokenValidityInMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub token_validity_in_minutes: Option<i64>, + #[doc = "EndpointId which needs new authentication params"] + #[serde( + rename = "endpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_id: Option<String>, + #[doc = "Scope of the token requested. For GitHub marketplace apps, scope contains repository Ids"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub scope: Vec<i32>, + #[doc = "The requested endpoint authentication should be valid for _ minutes. Authentication params will not be refreshed if the token contained in endpoint already has active token."] + #[serde( + rename = "tokenValidityInMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub token_validity_in_minutes: Option<i64>, } impl RefreshAuthenticationParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents template to transform the result data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultTransformationDetails { - #[doc = "Gets or sets the template for callback parameters"] - #[serde( - rename = "callbackContextTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_context_template: Option<String>, - #[doc = "Gets or sets the template to decide whether to callback or not"] - #[serde( - rename = "callbackRequiredTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_required_template: Option<String>, - #[doc = "Gets or sets the template for result transformation."] - #[serde( - rename = "resultTemplate", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_template: Option<String>, + #[doc = "Gets or sets the template for callback parameters"] + #[serde( + rename = "callbackContextTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_context_template: Option<String>, + #[doc = "Gets or sets the template to decide whether to callback or not"] + #[serde( + rename = "callbackRequiredTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_required_template: Option<String>, + #[doc = "Gets or sets the template for result transformation."] + #[serde( + rename = "resultTemplate", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_template: Option<String>, } impl ResultTransformationDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents an endpoint which may be used by an orchestration job."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceEndpoint { - #[doc = ""] - #[serde( - rename = "administratorsGroup", - default, - skip_serializing_if = "Option::is_none" - )] - pub administrators_group: Option<IdentityRef>, - #[doc = "Represents the authorization used for service endpoint."] - pub authorization: EndpointAuthorization, - #[doc = ""] - #[serde(rename = "createdBy")] - pub created_by: IdentityRef, - pub data: serde_json::Value, - #[doc = "Gets or sets the description of endpoint."] - pub description: String, - #[doc = "This is a deprecated field."] - #[serde( - rename = "groupScopeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_scope_id: Option<String>, - #[doc = "Gets or sets the identifier of this endpoint."] - pub id: String, - #[doc = "EndPoint state indicator"] - #[serde(rename = "isReady")] - pub is_ready: bool, - #[doc = "Indicates whether service endpoint is shared with other projects or not."] - #[serde(rename = "isShared")] - pub is_shared: bool, - #[doc = "Gets or sets the friendly name of the endpoint."] - pub name: String, - #[doc = "Error message during creation/deletion of endpoint"] - #[serde( - rename = "operationStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_status: Option<serde_json::Value>, - #[doc = "Owner of the endpoint Supported values are \"library\", \"agentcloud\""] - pub owner: String, - #[doc = ""] - #[serde( - rename = "readersGroup", - default, - skip_serializing_if = "Option::is_none" - )] - pub readers_group: Option<IdentityRef>, - #[doc = "All other project references where the service endpoint is shared."] - #[serde( - rename = "serviceEndpointProjectReferences", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub service_endpoint_project_references: Vec<ServiceEndpointProjectReference>, - #[doc = "Gets or sets the type of the endpoint."] - #[serde(rename = "type")] - pub type_: String, - #[doc = "Gets or sets the url of the endpoint."] - pub url: String, + #[doc = ""] + #[serde( + rename = "administratorsGroup", + default, + skip_serializing_if = "Option::is_none" + )] + pub administrators_group: Option<IdentityRef>, + #[doc = "Represents the authorization used for service endpoint."] + pub authorization: EndpointAuthorization, + #[doc = ""] + #[serde(rename = "createdBy")] + pub created_by: IdentityRef, + pub data: serde_json::Value, + #[doc = "Gets or sets the description of endpoint."] + pub description: String, + #[doc = "This is a deprecated field."] + #[serde( + rename = "groupScopeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_scope_id: Option<String>, + #[doc = "Gets or sets the identifier of this endpoint."] + pub id: String, + #[doc = "EndPoint state indicator"] + #[serde(rename = "isReady")] + pub is_ready: bool, + #[doc = "Indicates whether service endpoint is shared with other projects or not."] + #[serde(rename = "isShared")] + pub is_shared: bool, + #[doc = "Gets or sets the friendly name of the endpoint."] + pub name: String, + #[doc = "Error message during creation/deletion of endpoint"] + #[serde( + rename = "operationStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_status: Option<serde_json::Value>, + #[doc = "Owner of the endpoint Supported values are \"library\", \"agentcloud\""] + pub owner: String, + #[doc = ""] + #[serde( + rename = "readersGroup", + default, + skip_serializing_if = "Option::is_none" + )] + pub readers_group: Option<IdentityRef>, + #[doc = "All other project references where the service endpoint is shared."] + #[serde( + rename = "serviceEndpointProjectReferences", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub service_endpoint_project_references: Vec<ServiceEndpointProjectReference>, + #[doc = "Gets or sets the type of the endpoint."] + #[serde(rename = "type")] + pub type_: String, + #[doc = "Gets or sets the url of the endpoint."] + pub url: String, } impl ServiceEndpoint { - pub fn new( - authorization: EndpointAuthorization, - created_by: IdentityRef, - data: serde_json::Value, - description: String, - id: String, - is_ready: bool, - is_shared: bool, - name: String, - owner: String, - type_: String, - url: String, - ) -> Self { - Self { - administrators_group: None, - authorization, - created_by, - data, - description, - group_scope_id: None, - id, - is_ready, - is_shared, - name, - operation_status: None, - owner, - readers_group: None, - service_endpoint_project_references: Vec::new(), - type_, - url, - } - } + pub fn new( + authorization: EndpointAuthorization, + created_by: IdentityRef, + data: serde_json::Value, + description: String, + id: String, + is_ready: bool, + is_shared: bool, + name: String, + owner: String, + type_: String, + url: String, + ) -> Self { + Self { + administrators_group: None, + authorization, + created_by, + data, + description, + group_scope_id: None, + id, + is_ready, + is_shared, + name, + operation_status: None, + owner, + readers_group: None, + service_endpoint_project_references: Vec::new(), + type_, + url, + } + } } #[doc = "Represents the authentication scheme used to authenticate the endpoint."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointAuthenticationScheme { - #[doc = "Gets or sets the authorization headers of service endpoint authentication scheme."] - #[serde( - rename = "authorizationHeaders", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub authorization_headers: Vec<AuthorizationHeader>, - #[doc = "Gets or sets the Authorization url required to authenticate using OAuth2"] - #[serde( - rename = "authorizationUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_url: Option<String>, - #[doc = "Gets or sets the certificates of service endpoint authentication scheme."] - #[serde( - rename = "clientCertificates", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub client_certificates: Vec<ClientCertificate>, - #[doc = "Gets or sets the data source bindings of the endpoint."] - #[serde( - rename = "dataSourceBindings", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub data_source_bindings: Vec<DataSourceBinding>, - #[doc = "Gets or sets the display name for the service endpoint authentication scheme."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Gets or sets the input descriptors for the service endpoint authentication scheme."] - #[serde( - rename = "inputDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_descriptors: Vec<InputDescriptor>, - #[doc = "Gets or sets the properties of service endpoint authentication scheme."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Gets or sets whether this auth scheme requires OAuth2 configuration or not."] - #[serde( - rename = "requiresOAuth2Configuration", - default, - skip_serializing_if = "Option::is_none" - )] - pub requires_o_auth2_configuration: Option<bool>, - #[doc = "Gets or sets the scheme for service endpoint authentication."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scheme: Option<String>, + #[doc = "Gets or sets the authorization headers of service endpoint authentication scheme."] + #[serde( + rename = "authorizationHeaders", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub authorization_headers: Vec<AuthorizationHeader>, + #[doc = "Gets or sets the Authorization url required to authenticate using OAuth2"] + #[serde( + rename = "authorizationUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorization_url: Option<String>, + #[doc = "Gets or sets the certificates of service endpoint authentication scheme."] + #[serde( + rename = "clientCertificates", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub client_certificates: Vec<ClientCertificate>, + #[doc = "Gets or sets the data source bindings of the endpoint."] + #[serde( + rename = "dataSourceBindings", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub data_source_bindings: Vec<DataSourceBinding>, + #[doc = "Gets or sets the display name for the service endpoint authentication scheme."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Gets or sets the input descriptors for the service endpoint authentication scheme."] + #[serde( + rename = "inputDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_descriptors: Vec<InputDescriptor>, + #[doc = "Gets or sets the properties of service endpoint authentication scheme."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Gets or sets whether this auth scheme requires OAuth2 configuration or not."] + #[serde( + rename = "requiresOAuth2Configuration", + default, + skip_serializing_if = "Option::is_none" + )] + pub requires_o_auth2_configuration: Option<bool>, + #[doc = "Gets or sets the scheme for service endpoint authentication."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scheme: Option<String>, } impl ServiceEndpointAuthenticationScheme { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents details of the service endpoint."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointDetails { - #[doc = "Represents the authorization used for service endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorization: Option<EndpointAuthorization>, - #[doc = "Gets or sets the data of service endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<serde_json::Value>, - #[doc = "Gets or sets the type of service endpoint."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "Gets or sets the connection url of service endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Represents the authorization used for service endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorization: Option<EndpointAuthorization>, + #[doc = "Gets or sets the data of service endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<serde_json::Value>, + #[doc = "Gets or sets the type of service endpoint."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "Gets or sets the connection url of service endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ServiceEndpointDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents service endpoint execution data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointExecutionData { - #[doc = "Represents execution owner of the service endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub definition: Option<ServiceEndpointExecutionOwner>, - #[doc = "Gets the finish time of service endpoint execution."] - #[serde( - rename = "finishTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_time: Option<time::OffsetDateTime>, - #[doc = "Gets the Id of service endpoint execution data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i64>, - #[doc = "Represents execution owner of the service endpoint."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<ServiceEndpointExecutionOwner>, - #[doc = "Gets the additional details about the instance that used the service endpoint."] - #[serde( - rename = "ownerDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub owner_details: Option<String>, - #[doc = "Gets the plan type of service endpoint execution data."] - #[serde(rename = "planType", default, skip_serializing_if = "Option::is_none")] - pub plan_type: Option<String>, - #[doc = "Gets the result of service endpoint execution."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<service_endpoint_execution_data::Result>, - #[doc = "Gets the start time of service endpoint execution."] - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, + #[doc = "Represents execution owner of the service endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option<ServiceEndpointExecutionOwner>, + #[doc = "Gets the finish time of service endpoint execution."] + #[serde( + rename = "finishTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_time: Option<time::OffsetDateTime>, + #[doc = "Gets the Id of service endpoint execution data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i64>, + #[doc = "Represents execution owner of the service endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<ServiceEndpointExecutionOwner>, + #[doc = "Gets the plan type of service endpoint execution data."] + #[serde(rename = "planType", default, skip_serializing_if = "Option::is_none")] + pub plan_type: Option<String>, + #[doc = "Gets the result of service endpoint execution."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<service_endpoint_execution_data::Result>, + #[doc = "Gets the start time of service endpoint execution."] + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, } impl ServiceEndpointExecutionData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod service_endpoint_execution_data { - use super::*; - #[doc = "Gets the result of service endpoint execution."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Result { - #[serde(rename = "succeeded")] - Succeeded, - #[serde(rename = "succeededWithIssues")] - SucceededWithIssues, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "canceled")] - Canceled, - #[serde(rename = "skipped")] - Skipped, - #[serde(rename = "abandoned")] - Abandoned, - } + use super::*; + #[doc = "Gets the result of service endpoint execution."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Result { + #[serde(rename = "succeeded")] + Succeeded, + #[serde(rename = "succeededWithIssues")] + SucceededWithIssues, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "abandoned")] + Abandoned, + } } #[doc = "Represents execution owner of the service endpoint."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointExecutionOwner { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "Gets or sets the Id of service endpoint execution owner."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Gets or sets the name of service endpoint execution owner."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "Gets or sets the Id of service endpoint execution owner."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Gets or sets the name of service endpoint execution owner."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ServiceEndpointExecutionOwner { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the details of service endpoint execution."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointExecutionRecord { - #[doc = "Represents service endpoint execution data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<ServiceEndpointExecutionData>, - #[doc = "Gets the Id of service endpoint."] - #[serde( - rename = "endpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_id: Option<String>, + #[doc = "Represents service endpoint execution data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<ServiceEndpointExecutionData>, + #[doc = "Gets the Id of service endpoint."] + #[serde( + rename = "endpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_id: Option<String>, } impl ServiceEndpointExecutionRecord { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointExecutionRecordList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ServiceEndpointExecutionRecord>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ServiceEndpointExecutionRecord>, } impl ServiceEndpointExecutionRecordList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointExecutionRecordsInput { - #[doc = "Represents service endpoint execution data."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option<ServiceEndpointExecutionData>, - #[serde( - rename = "endpointIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub endpoint_ids: Vec<String>, + #[doc = "Represents service endpoint execution data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option<ServiceEndpointExecutionData>, + #[serde( + rename = "endpointIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub endpoint_ids: Vec<String>, } impl ServiceEndpointExecutionRecordsInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ServiceEndpoint>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ServiceEndpoint>, } impl ServiceEndpointList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointOAuthConfigurationReference { - #[serde( - rename = "configurationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub configuration_id: Option<String>, - #[serde( - rename = "serviceEndpointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_id: Option<String>, - #[serde( - rename = "serviceEndpointProjectId", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_project_id: Option<String>, + #[serde( + rename = "configurationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub configuration_id: Option<String>, + #[serde( + rename = "serviceEndpointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_id: Option<String>, + #[serde( + rename = "serviceEndpointProjectId", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_project_id: Option<String>, } impl ServiceEndpointOAuthConfigurationReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceEndpointProjectReference { - #[doc = "Gets or sets description of the service endpoint."] - pub description: String, - #[doc = "Gets or sets name of the service endpoint."] - pub name: String, - #[doc = ""] - #[serde(rename = "projectReference")] - pub project_reference: ProjectReference, + #[doc = "Gets or sets description of the service endpoint."] + pub description: String, + #[doc = "Gets or sets name of the service endpoint."] + pub name: String, + #[doc = ""] + #[serde(rename = "projectReference")] + pub project_reference: ProjectReference, } impl ServiceEndpointProjectReference { - pub fn new(description: String, name: String, project_reference: ProjectReference) -> Self { - Self { - description, - name, - project_reference, - } + pub fn new(description: String, name: String, project_reference: ProjectReference) -> Self { + Self { + description, + name, + project_reference, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointRequest { - #[doc = "Represents details of the service endpoint data source."] - #[serde( - rename = "dataSourceDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub data_source_details: Option<DataSourceDetails>, - #[doc = "Represents template to transform the result data."] - #[serde( - rename = "resultTransformationDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_transformation_details: Option<ResultTransformationDetails>, - #[doc = "Represents details of the service endpoint."] - #[serde( - rename = "serviceEndpointDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_endpoint_details: Option<ServiceEndpointDetails>, + #[doc = "Represents details of the service endpoint data source."] + #[serde( + rename = "dataSourceDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub data_source_details: Option<DataSourceDetails>, + #[doc = "Represents template to transform the result data."] + #[serde( + rename = "resultTransformationDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_transformation_details: Option<ResultTransformationDetails>, + #[doc = "Represents details of the service endpoint."] + #[serde( + rename = "serviceEndpointDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_endpoint_details: Option<ServiceEndpointDetails>, } impl ServiceEndpointRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents result of the service endpoint request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointRequestResult { - #[doc = "Gets or sets the parameters used to make subsequent calls to the data source"] - #[serde( - rename = "callbackContextParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_context_parameters: Option<serde_json::Value>, - #[doc = "Gets or sets the flat that decides if another call to the data source is to be made"] - #[serde( - rename = "callbackRequired", - default, - skip_serializing_if = "Option::is_none" - )] - pub callback_required: Option<bool>, - #[doc = "Gets or sets the error message of the service endpoint request result."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "Represents an abstract JSON token."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub result: Option<JToken>, - #[doc = "Gets or sets the status code of the service endpoint request result."] - #[serde( - rename = "statusCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub status_code: Option<service_endpoint_request_result::StatusCode>, + #[doc = "Gets or sets the parameters used to make subsequent calls to the data source"] + #[serde( + rename = "callbackContextParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_context_parameters: Option<serde_json::Value>, + #[doc = "Gets or sets the flat that decides if another call to the data source is to be made"] + #[serde( + rename = "callbackRequired", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_required: Option<bool>, + #[doc = "Gets or sets the error message of the service endpoint request result."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "Represents an abstract JSON token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option<JToken>, + #[doc = "Gets or sets the status code of the service endpoint request result."] + #[serde( + rename = "statusCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_code: Option<service_endpoint_request_result::StatusCode>, } impl ServiceEndpointRequestResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod service_endpoint_request_result { - use super::*; - #[doc = "Gets or sets the status code of the service endpoint request result."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum StatusCode { - #[serde(rename = "continue")] - Continue, - #[serde(rename = "switchingProtocols")] - SwitchingProtocols, - #[serde(rename = "ok")] - Ok, - #[serde(rename = "created")] - Created, - #[serde(rename = "accepted")] - Accepted, - #[serde(rename = "nonAuthoritativeInformation")] - NonAuthoritativeInformation, - #[serde(rename = "noContent")] - NoContent, - #[serde(rename = "resetContent")] - ResetContent, - #[serde(rename = "partialContent")] - PartialContent, - #[serde(rename = "multipleChoices")] - MultipleChoices, - #[serde(rename = "ambiguous")] - Ambiguous, - #[serde(rename = "movedPermanently")] - MovedPermanently, - #[serde(rename = "moved")] - Moved, - #[serde(rename = "found")] - Found, - #[serde(rename = "redirect")] - Redirect, - #[serde(rename = "seeOther")] - SeeOther, - #[serde(rename = "redirectMethod")] - RedirectMethod, - #[serde(rename = "notModified")] - NotModified, - #[serde(rename = "useProxy")] - UseProxy, - #[serde(rename = "unused")] - Unused, - #[serde(rename = "temporaryRedirect")] - TemporaryRedirect, - #[serde(rename = "redirectKeepVerb")] - RedirectKeepVerb, - #[serde(rename = "badRequest")] - BadRequest, - #[serde(rename = "unauthorized")] - Unauthorized, - #[serde(rename = "paymentRequired")] - PaymentRequired, - #[serde(rename = "forbidden")] - Forbidden, - #[serde(rename = "notFound")] - NotFound, - #[serde(rename = "methodNotAllowed")] - MethodNotAllowed, - #[serde(rename = "notAcceptable")] - NotAcceptable, - #[serde(rename = "proxyAuthenticationRequired")] - ProxyAuthenticationRequired, - #[serde(rename = "requestTimeout")] - RequestTimeout, - #[serde(rename = "conflict")] - Conflict, - #[serde(rename = "gone")] - Gone, - #[serde(rename = "lengthRequired")] - LengthRequired, - #[serde(rename = "preconditionFailed")] - PreconditionFailed, - #[serde(rename = "requestEntityTooLarge")] - RequestEntityTooLarge, - #[serde(rename = "requestUriTooLong")] - RequestUriTooLong, - #[serde(rename = "unsupportedMediaType")] - UnsupportedMediaType, - #[serde(rename = "requestedRangeNotSatisfiable")] - RequestedRangeNotSatisfiable, - #[serde(rename = "expectationFailed")] - ExpectationFailed, - #[serde(rename = "upgradeRequired")] - UpgradeRequired, - #[serde(rename = "internalServerError")] - InternalServerError, - #[serde(rename = "notImplemented")] - NotImplemented, - #[serde(rename = "badGateway")] - BadGateway, - #[serde(rename = "serviceUnavailable")] - ServiceUnavailable, - #[serde(rename = "gatewayTimeout")] - GatewayTimeout, - #[serde(rename = "httpVersionNotSupported")] - HttpVersionNotSupported, - } + use super::*; + #[doc = "Gets or sets the status code of the service endpoint request result."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum StatusCode { + #[serde(rename = "continue")] + Continue, + #[serde(rename = "switchingProtocols")] + SwitchingProtocols, + #[serde(rename = "ok")] + Ok, + #[serde(rename = "created")] + Created, + #[serde(rename = "accepted")] + Accepted, + #[serde(rename = "nonAuthoritativeInformation")] + NonAuthoritativeInformation, + #[serde(rename = "noContent")] + NoContent, + #[serde(rename = "resetContent")] + ResetContent, + #[serde(rename = "partialContent")] + PartialContent, + #[serde(rename = "multipleChoices")] + MultipleChoices, + #[serde(rename = "ambiguous")] + Ambiguous, + #[serde(rename = "movedPermanently")] + MovedPermanently, + #[serde(rename = "moved")] + Moved, + #[serde(rename = "found")] + Found, + #[serde(rename = "redirect")] + Redirect, + #[serde(rename = "seeOther")] + SeeOther, + #[serde(rename = "redirectMethod")] + RedirectMethod, + #[serde(rename = "notModified")] + NotModified, + #[serde(rename = "useProxy")] + UseProxy, + #[serde(rename = "unused")] + Unused, + #[serde(rename = "temporaryRedirect")] + TemporaryRedirect, + #[serde(rename = "redirectKeepVerb")] + RedirectKeepVerb, + #[serde(rename = "badRequest")] + BadRequest, + #[serde(rename = "unauthorized")] + Unauthorized, + #[serde(rename = "paymentRequired")] + PaymentRequired, + #[serde(rename = "forbidden")] + Forbidden, + #[serde(rename = "notFound")] + NotFound, + #[serde(rename = "methodNotAllowed")] + MethodNotAllowed, + #[serde(rename = "notAcceptable")] + NotAcceptable, + #[serde(rename = "proxyAuthenticationRequired")] + ProxyAuthenticationRequired, + #[serde(rename = "requestTimeout")] + RequestTimeout, + #[serde(rename = "conflict")] + Conflict, + #[serde(rename = "gone")] + Gone, + #[serde(rename = "lengthRequired")] + LengthRequired, + #[serde(rename = "preconditionFailed")] + PreconditionFailed, + #[serde(rename = "requestEntityTooLarge")] + RequestEntityTooLarge, + #[serde(rename = "requestUriTooLong")] + RequestUriTooLong, + #[serde(rename = "unsupportedMediaType")] + UnsupportedMediaType, + #[serde(rename = "requestedRangeNotSatisfiable")] + RequestedRangeNotSatisfiable, + #[serde(rename = "expectationFailed")] + ExpectationFailed, + #[serde(rename = "upgradeRequired")] + UpgradeRequired, + #[serde(rename = "internalServerError")] + InternalServerError, + #[serde(rename = "notImplemented")] + NotImplemented, + #[serde(rename = "badGateway")] + BadGateway, + #[serde(rename = "serviceUnavailable")] + ServiceUnavailable, + #[serde(rename = "gatewayTimeout")] + GatewayTimeout, + #[serde(rename = "httpVersionNotSupported")] + HttpVersionNotSupported, + } } #[doc = "Represents type of the service endpoint."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointType { - #[doc = "Authentication scheme of service endpoint type."] - #[serde( - rename = "authenticationSchemes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub authentication_schemes: Vec<ServiceEndpointAuthenticationScheme>, - #[doc = "Data sources of service endpoint type."] - #[serde( - rename = "dataSources", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub data_sources: Vec<DataSource>, - #[doc = "Dependency data of service endpoint type."] - #[serde( - rename = "dependencyData", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dependency_data: Vec<DependencyData>, - #[doc = "Gets or sets the description of service endpoint type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Gets or sets the display name of service endpoint type."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Represents url of the service endpoint."] - #[serde( - rename = "endpointUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_url: Option<EndpointUrl>, - #[doc = "Specifies the public url of the help documentation."] - #[serde(rename = "helpLink", default, skip_serializing_if = "Option::is_none")] - pub help_link: Option<HelpLink>, - #[doc = "Gets or sets the help text shown at the endpoint create dialog."] - #[serde( - rename = "helpMarkDown", - default, - skip_serializing_if = "Option::is_none" - )] - pub help_mark_down: Option<String>, - #[doc = "Gets or sets the icon url of service endpoint type."] - #[serde(rename = "iconUrl", default, skip_serializing_if = "Option::is_none")] - pub icon_url: Option<String>, - #[doc = "Input descriptor of service endpoint type."] - #[serde( - rename = "inputDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub input_descriptors: Vec<InputDescriptor>, - #[doc = "Gets or sets the name of service endpoint type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Trusted hosts of a service endpoint type."] - #[serde( - rename = "trustedHosts", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub trusted_hosts: Vec<String>, - #[doc = "Gets or sets the ui contribution id of service endpoint type."] - #[serde( - rename = "uiContributionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub ui_contribution_id: Option<String>, + #[doc = "Authentication scheme of service endpoint type."] + #[serde( + rename = "authenticationSchemes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub authentication_schemes: Vec<ServiceEndpointAuthenticationScheme>, + #[doc = "Data sources of service endpoint type."] + #[serde( + rename = "dataSources", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub data_sources: Vec<DataSource>, + #[doc = "Dependency data of service endpoint type."] + #[serde( + rename = "dependencyData", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dependency_data: Vec<DependencyData>, + #[doc = "Gets or sets the description of service endpoint type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Gets or sets the display name of service endpoint type."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Represents url of the service endpoint."] + #[serde( + rename = "endpointUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_url: Option<EndpointUrl>, + #[doc = "Specifies the public url of the help documentation."] + #[serde(rename = "helpLink", default, skip_serializing_if = "Option::is_none")] + pub help_link: Option<HelpLink>, + #[doc = "Gets or sets the help text shown at the endpoint create dialog."] + #[serde( + rename = "helpMarkDown", + default, + skip_serializing_if = "Option::is_none" + )] + pub help_mark_down: Option<String>, + #[doc = "Gets or sets the icon url of service endpoint type."] + #[serde(rename = "iconUrl", default, skip_serializing_if = "Option::is_none")] + pub icon_url: Option<String>, + #[doc = "Input descriptor of service endpoint type."] + #[serde( + rename = "inputDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub input_descriptors: Vec<InputDescriptor>, + #[doc = "Gets or sets the name of service endpoint type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Trusted hosts of a service endpoint type."] + #[serde( + rename = "trustedHosts", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub trusted_hosts: Vec<String>, + #[doc = "Gets or sets the ui contribution id of service endpoint type."] + #[serde( + rename = "uiContributionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub ui_contribution_id: Option<String>, } impl ServiceEndpointType { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceEndpointTypeList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ServiceEndpointType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ServiceEndpointType>, } impl ServiceEndpointTypeList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/status/mod.rs b/azure_devops_rust_api/src/status/mod.rs index f3b964a8..f7b91490 100644 --- a/azure_devops_rust_api/src/status/mod.rs +++ b/azure_devops_rust_api/src/status/mod.rs @@ -9,255 +9,256 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://status.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self - } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self - } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self - } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self - } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } } impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await + } + pub fn health_client(&self) -> health::Client { + health::Client(self.clone()) + } +} +pub mod health { + use 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"] + pub fn get(&self) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + services: None, + geographies: None, + } } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ServiceStatus> { + let bytes = self.0.into_body().collect().await?; + let body: models::ServiceStatus = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn health_client(&self) -> health::Client { - health::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } -} -pub mod health { - use 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"] - pub fn get(&self) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - services: None, - geographies: None, - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) services: Option<String>, + pub(crate) geographies: Option<String>, } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ServiceStatus> { - let bytes = self.0.into_body().collect().await?; - let body: models::ServiceStatus = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) services: Option<String>, - pub(crate) geographies: Option<String>, - } - 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<String>) -> Self { - self.services = Some(services.into()); - self - } - #[doc = "A comma-separated list of geographies for which to get status information for. Supported values: APAC, AU, BR, CA, EU, IN, UK, US."] - pub fn geographies(mut self, geographies: impl Into<String>) -> Self { - self.geographies = Some(geographies.into()); - self + 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<String>) -> Self { + self.services = Some(services.into()); + self + } + #[doc = "A comma-separated list of geographies for which to get status information for. Supported values: APAC, AU, BR, CA, EU, IN, UK, US."] + pub fn geographies(mut self, geographies: impl Into<String>) -> Self { + self.geographies = Some(geographies.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = + azure_core::Url::parse(&format!("{}/_apis/status/health", this.client.endpoint(),))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/_apis/status/health", - this.client.endpoint(), - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(services) = &this.services { + req + .url_mut() + .query_pairs_mut() + .append_pair("services", services); } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ServiceStatus>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ServiceStatus>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + if let Some(geographies) = &this.geographies { + req + .url_mut() + .query_pairs_mut() + .append_pair("geographies", geographies); } - } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ServiceStatus>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ServiceStatus>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/status/models.rs b/azure_devops_rust_api/src/status/models.rs index 3307af29..5d520787 100644 --- a/azure_devops_rust_api/src/status/models.rs +++ b/azure_devops_rust_api/src/status/models.rs @@ -8,591 +8,564 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EnterpriseStatus { - #[serde(flatten)] - pub status: Status, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub organizations: Vec<OrganizationHealth>, + #[serde(flatten)] + pub status: Status, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub organizations: Vec<OrganizationHealth>, } impl EnterpriseStatus { - pub fn new(status: Status) -> Self { - Self { - status, - organizations: Vec::new(), - } + pub fn new(status: Status) -> Self { + Self { + status, + organizations: Vec::new(), } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Geography { - pub id: String, - pub name: String, + pub id: String, + pub name: String, } impl Geography { - pub fn new(id: String, name: String) -> Self { - Self { id, name } - } + pub fn new(id: String, name: String) -> Self { + Self { id, name } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GeographyWithHealth { - #[serde(flatten)] - pub geography: Geography, - pub health: geography_with_health::Health, + #[serde(flatten)] + pub geography: Geography, + pub health: geography_with_health::Health, } impl GeographyWithHealth { - pub fn new(geography: Geography, health: geography_with_health::Health) -> Self { - Self { geography, health } - } + pub fn new(geography: Geography, health: geography_with_health::Health) -> Self { + Self { geography, health } + } } pub mod geography_with_health { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Health { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "unhealthy")] - Unhealthy, - #[serde(rename = "degraded")] - Degraded, - #[serde(rename = "advisory")] - Advisory, - #[serde(rename = "healthy")] - Healthy, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Health { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "unhealthy")] + Unhealthy, + #[serde(rename = "degraded")] + Degraded, + #[serde(rename = "advisory")] + Advisory, + #[serde(rename = "healthy")] + Healthy, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LiveSiteEvent { - #[serde( - rename = "endTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub end_time: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i64>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub impact: Vec<LiveSiteEventImpact>, - #[serde( - rename = "incidentUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub incident_uri: Option<String>, - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub logs: Vec<LiveSiteEventLog>, - #[serde( - rename = "nextUpdateTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub next_update_time: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub severity: Option<live_site_event::Severity>, - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<live_site_event::State>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, + #[serde( + rename = "endTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub end_time: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i64>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub impact: Vec<LiveSiteEventImpact>, + #[serde( + rename = "incidentUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub incident_uri: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub logs: Vec<LiveSiteEventLog>, + #[serde( + rename = "nextUpdateTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub next_update_time: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option<live_site_event::Severity>, + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<live_site_event::State>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, } impl LiveSiteEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod live_site_event { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Severity { - #[serde(rename = "unhealthy")] - Unhealthy, - #[serde(rename = "degraded")] - Degraded, - #[serde(rename = "advisory")] - Advisory, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "active")] - Active, - #[serde(rename = "resolved")] - Resolved, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Severity { + #[serde(rename = "unhealthy")] + Unhealthy, + #[serde(rename = "degraded")] + Degraded, + #[serde(rename = "advisory")] + Advisory, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "active")] + Active, + #[serde(rename = "resolved")] + Resolved, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LiveSiteEventAuthor { - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl LiveSiteEventAuthor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LiveSiteEventImpact { - #[serde(rename = "scopeName", default, skip_serializing_if = "Option::is_none")] - pub scope_name: Option<String>, - #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] - pub scope_type: Option<live_site_event_impact::ScopeType>, - #[serde(rename = "serviceId", default, skip_serializing_if = "Option::is_none")] - pub service_id: Option<String>, + #[serde(rename = "scopeName", default, skip_serializing_if = "Option::is_none")] + pub scope_name: Option<String>, + #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] + pub scope_type: Option<live_site_event_impact::ScopeType>, + #[serde(rename = "serviceId", default, skip_serializing_if = "Option::is_none")] + pub service_id: Option<String>, } impl LiveSiteEventImpact { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod live_site_event_impact { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ScopeType { - #[serde(rename = "geography")] - Geography, - #[serde(rename = "organization")] - Organization, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ScopeType { + #[serde(rename = "geography")] + Geography, + #[serde(rename = "organization")] + Organization, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LiveSiteEventLog { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<LiveSiteEventAuthor>, - #[serde( - rename = "creationDateTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date_time: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde( - rename = "descriptionMd", - default, - skip_serializing_if = "Option::is_none" - )] - pub description_md: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[serde( - rename = "lastUpdatedDateTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date_time: Option<time::OffsetDateTime>, - #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] - pub scope_type: Option<live_site_event_log::ScopeType>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<live_site_event_log::Type>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<LiveSiteEventAuthor>, + #[serde( + rename = "creationDateTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date_time: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde( + rename = "descriptionMd", + default, + skip_serializing_if = "Option::is_none" + )] + pub description_md: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[serde( + rename = "lastUpdatedDateTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date_time: Option<time::OffsetDateTime>, + #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] + pub scope_type: Option<live_site_event_log::ScopeType>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<live_site_event_log::Type>, } impl LiveSiteEventLog { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod live_site_event_log { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ScopeType { - #[serde(rename = "geography")] - Geography, - #[serde(rename = "organization")] - Organization, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "event")] - Event, - #[serde(rename = "postmortem")] - Postmortem, - #[serde(rename = "notification")] - Notification, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ScopeType { + #[serde(rename = "geography")] + Geography, + #[serde(rename = "organization")] + Organization, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "event")] + Event, + #[serde(rename = "postmortem")] + Postmortem, + #[serde(rename = "notification")] + Notification, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LiveSiteEventLogAttachment { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<LiveSiteEventAuthor>, - #[serde( - rename = "creationDateTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date_time: Option<time::OffsetDateTime>, - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde(rename = "eventId", default, skip_serializing_if = "Option::is_none")] - pub event_id: Option<i64>, - #[serde(rename = "fileId", default, skip_serializing_if = "Option::is_none")] - pub file_id: Option<i32>, - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] - pub scope_type: Option<live_site_event_log_attachment::ScopeType>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<LiveSiteEventAuthor>, + #[serde( + rename = "creationDateTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date_time: Option<time::OffsetDateTime>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde(rename = "eventId", default, skip_serializing_if = "Option::is_none")] + pub event_id: Option<i64>, + #[serde(rename = "fileId", default, skip_serializing_if = "Option::is_none")] + pub file_id: Option<i32>, + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[serde(rename = "scopeType", default, skip_serializing_if = "Option::is_none")] + pub scope_type: Option<live_site_event_log_attachment::ScopeType>, } impl LiveSiteEventLogAttachment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod live_site_event_log_attachment { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ScopeType { - #[serde(rename = "geography")] - Geography, - #[serde(rename = "organization")] - Organization, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ScopeType { + #[serde(rename = "geography")] + Geography, + #[serde(rename = "organization")] + Organization, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LiveSiteEventTemplate { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde( - rename = "initialDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub initial_description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde( + rename = "initialDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub initial_description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, } impl LiveSiteEventTemplate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LiveSiteEventTemplateData { - #[serde(rename = "defaultId", default, skip_serializing_if = "Option::is_none")] - pub default_id: Option<String>, - #[serde( - rename = "finalDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub final_description: Option<String>, - #[serde( - rename = "intermediateDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub intermediate_description: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub templates: Vec<LiveSiteEventTemplate>, + #[serde(rename = "defaultId", default, skip_serializing_if = "Option::is_none")] + pub default_id: Option<String>, + #[serde( + rename = "finalDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub final_description: Option<String>, + #[serde( + rename = "intermediateDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub intermediate_description: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub templates: Vec<LiveSiteEventTemplate>, } impl LiveSiteEventTemplateData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MicroService { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "scaleUnits", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub scale_units: Vec<MicroServiceScaleUnit>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub services: Vec<Service>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "scaleUnits", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub scale_units: Vec<MicroServiceScaleUnit>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub services: Vec<Service>, } impl MicroService { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MicroServiceScaleUnit { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub geography: Option<Geography>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde( - rename = "isInternal", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_internal: Option<bool>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub geography: Option<Geography>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde( + rename = "isInternal", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_internal: Option<bool>, } impl MicroServiceScaleUnit { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OrganizationHealth { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub services: Vec<ServiceWithHealth>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub services: Vec<ServiceWithHealth>, } impl OrganizationHealth { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Service { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde( - rename = "isInternal", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_internal: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<service::State>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde( + rename = "isInternal", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_internal: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<service::State>, } impl Service { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod service { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "active")] - Active, - #[serde(rename = "hidden")] - Hidden, - #[serde(rename = "deleted")] - Deleted, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "active")] + Active, + #[serde(rename = "hidden")] + Hidden, + #[serde(rename = "deleted")] + Deleted, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceHealth { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub geographies: Vec<GeographyWithHealth>, - pub id: String, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub geographies: Vec<GeographyWithHealth>, + pub id: String, } impl ServiceHealth { - pub fn new(id: String) -> Self { - Self { - geographies: Vec::new(), - id, - } + pub fn new(id: String) -> Self { + Self { + geographies: Vec::new(), + id, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceStatus { - #[serde(flatten)] - pub status: Status, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub services: Vec<ServiceHealth>, + #[serde(flatten)] + pub status: Status, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub services: Vec<ServiceHealth>, } impl ServiceStatus { - pub fn new(status: Status) -> Self { - Self { - status, - services: Vec::new(), - } + pub fn new(status: Status) -> Self { + Self { + status, + services: Vec::new(), } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ServiceWithHealth { - #[serde(flatten)] - pub service: Service, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub health: Option<service_with_health::Health>, + #[serde(flatten)] + pub service: Service, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub health: Option<service_with_health::Health>, } impl ServiceWithHealth { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod service_with_health { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Health { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "unhealthy")] - Unhealthy, - #[serde(rename = "degraded")] - Degraded, - #[serde(rename = "advisory")] - Advisory, - #[serde(rename = "healthy")] - Healthy, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Health { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "unhealthy")] + Unhealthy, + #[serde(rename = "degraded")] + Degraded, + #[serde(rename = "advisory")] + Advisory, + #[serde(rename = "healthy")] + Healthy, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Status { - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[doc = ""] - pub status: StatusSummary, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[doc = ""] + pub status: StatusSummary, } impl Status { - pub fn new(status: StatusSummary) -> Self { - Self { - last_updated: None, - status, - } - } -} -#[doc = "Represents data for the impacted organization. Will be null if org is not impacted"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StatusImpact { - #[serde( - rename = "liveSiteEvents", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub live_site_events: Vec<LiveSiteEvent>, - #[doc = ""] - #[serde( - rename = "serviceStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_status: Option<ServiceStatus>, -} -impl StatusImpact { - pub fn new() -> Self { - Self::default() + pub fn new(status: StatusSummary) -> Self { + Self { + last_updated: None, + status, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct StatusSummary { - pub health: status_summary::Health, - pub message: String, + pub health: status_summary::Health, + pub message: String, } impl StatusSummary { - pub fn new(health: status_summary::Health, message: String) -> Self { - Self { health, message } - } + pub fn new(health: status_summary::Health, message: String) -> Self { + Self { health, message } + } } pub mod status_summary { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Health { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "unhealthy")] - Unhealthy, - #[serde(rename = "degraded")] - Degraded, - #[serde(rename = "advisory")] - Advisory, - #[serde(rename = "healthy")] - Healthy, - } -} -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Health { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "unhealthy")] + Unhealthy, + #[serde(rename = "degraded")] + Degraded, + #[serde(rename = "advisory")] + Advisory, + #[serde(rename = "healthy")] + Healthy, + } +} +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/symbol/mod.rs b/azure_devops_rust_api/src/symbol/mod.rs index ed3ab809..86d0e1f8 100644 --- a/azure_devops_rust_api/src/symbol/mod.rs +++ b/azure_devops_rust_api/src/symbol/mod.rs @@ -9,1713 +9,1730 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://artifacts.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + 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()) + } +} +pub mod requests { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Create debug entries for a symbol request as specified by its name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A batch that contains debug entries to create."] + #[doc = "* `request_name`: The symbol request name."] + #[doc = "* `collection`: A valid debug entry collection name. Must be \"debugentries\"."] + pub fn create_requests_request_name_debug_entries( + &self, + organization: impl Into<String>, + body: impl Into<models::DebugEntryCreateBatch>, + request_name: impl Into<String>, + collection: impl Into<String>, + ) -> 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 = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Get a symbol request by request name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `request_name`: The symbol request name."] + pub fn get_requests_request_name( + &self, + organization: impl Into<String>, + request_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The symbol request to create."] + pub fn create_requests( + &self, + organization: impl Into<String>, + body: impl Into<models::Request>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The symbol request."] + #[doc = "* `request_name`: The symbol request name."] + pub fn update_requests_request_name( + &self, + organization: impl Into<String>, + body: impl Into<models::Request>, + request_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `request_name`: The symbol request name."] + pub fn delete_requests_request_name( + &self, + organization: impl Into<String>, + request_name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `request_id`: The symbol request identifier."] + pub fn get_requests_request_id( + &self, + organization: impl Into<String>, + request_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A batch that contains debug entries to create."] + #[doc = "* `request_id`: The symbol request identifier."] + #[doc = "* `collection`: A valid debug entry collection name. Must be \"debugentries\"."] + pub fn create_requests_request_id_debug_entries( + &self, + organization: impl Into<String>, + body: impl Into<models::DebugEntryCreateBatch>, + request_id: impl Into<String>, + collection: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The symbol request."] + #[doc = "* `request_id`: The symbol request identifier."] + pub fn update_requests_request_id( + &self, + organization: impl Into<String>, + body: impl Into<models::Request>, + request_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `request_id`: The symbol request identifier."] + pub fn delete_requests_request_id( + &self, + organization: impl Into<String>, + request_id: impl Into<String>, + ) -> 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 create_requests_request_name_debug_entries { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DebugEntryList> { + let bytes = self.0.into_body().collect().await?; + let body: models::DebugEntryList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::DebugEntryCreateBatch, + pub(crate) request_name: String, + pub(crate) collection: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/requests?requestName={}&collection={}", + this.client.endpoint(), + &this.organization, + &this.request_name, + &this.collection + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DebugEntryList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DebugEntryList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_requests_request_name { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Request> { + let bytes = self.0.into_body().collect().await?; + let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) request_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/requests", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let request_name = &this.request_name; + req + .url_mut() + .query_pairs_mut() + .append_pair("requestName", request_name); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Request>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Request>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_requests { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Request> { + let bytes = self.0.into_body().collect().await?; + let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Request, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/requests", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Request>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Request>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_requests_request_name { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Request> { + let bytes = self.0.into_body().collect().await?; + let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Request, + pub(crate) request_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/requests", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Request>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Request>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_requests_request_name { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) request_name: String, + pub(crate) synchronous: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/requests", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) + } + pub mod get_requests_request_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Request> { + let bytes = self.0.into_body().collect().await?; + let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod requests { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) request_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/requests/{}", + this.client.endpoint(), + &this.organization, + &this.request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Request>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Request>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_requests_request_id_debug_entries { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Create debug entries for a symbol request as specified by its name."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A batch that contains debug entries to create."] - #[doc = "* `request_name`: The symbol request name."] - #[doc = "* `collection`: A valid debug entry collection name. Must be \"debugentries\"."] - pub fn create_requests_request_name_debug_entries( - &self, - organization: impl Into<String>, - body: impl Into<models::DebugEntryCreateBatch>, - request_name: impl Into<String>, - collection: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `request_name`: The symbol request name."] - pub fn get_requests_request_name( - &self, - organization: impl Into<String>, - request_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The symbol request to create."] - pub fn create_requests( - &self, - organization: impl Into<String>, - body: impl Into<models::Request>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The symbol request."] - #[doc = "* `request_name`: The symbol request name."] - pub fn update_requests_request_name( - &self, - organization: impl Into<String>, - body: impl Into<models::Request>, - request_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `request_name`: The symbol request name."] - pub fn delete_requests_request_name( - &self, - organization: impl Into<String>, - request_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `request_id`: The symbol request identifier."] - pub fn get_requests_request_id( - &self, - organization: impl Into<String>, - request_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A batch that contains debug entries to create."] - #[doc = "* `request_id`: The symbol request identifier."] - #[doc = "* `collection`: A valid debug entry collection name. Must be \"debugentries\"."] - pub fn create_requests_request_id_debug_entries( - &self, - organization: impl Into<String>, - body: impl Into<models::DebugEntryCreateBatch>, - request_id: impl Into<String>, - collection: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The symbol request."] - #[doc = "* `request_id`: The symbol request identifier."] - pub fn update_requests_request_id( - &self, - organization: impl Into<String>, - body: impl Into<models::Request>, - request_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `request_id`: The symbol request identifier."] - pub fn delete_requests_request_id( - &self, - organization: impl Into<String>, - request_id: impl Into<String>, - ) -> 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 create_requests_request_name_debug_entries { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DebugEntryList> { - let bytes = self.0.into_body().collect().await?; - let body: models::DebugEntryList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::DebugEntryCreateBatch, - pub(crate) request_name: String, - pub(crate) collection: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/requests?requestName={}&collection={}", - this.client.endpoint(), - &this.organization, - &this.request_name, - &this.collection - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DebugEntryList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::DebugEntryList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_requests_request_name { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Request> { - let bytes = self.0.into_body().collect().await?; - let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) request_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/requests", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let request_name = &this.request_name; - req.url_mut() - .query_pairs_mut() - .append_pair("requestName", request_name); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Request>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Request>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_requests { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Request> { - let bytes = self.0.into_body().collect().await?; - let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Request, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/requests", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Request>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Request>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_requests_request_name { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Request> { - let bytes = self.0.into_body().collect().await?; - let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Request, - pub(crate) request_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/requests", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Request>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Request>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_requests_request_name { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) request_name: String, - pub(crate) synchronous: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/requests", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_requests_request_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Request> { - let bytes = self.0.into_body().collect().await?; - let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) request_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/requests/{}", - this.client.endpoint(), - &this.organization, - &this.request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Request>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Request>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_requests_request_id_debug_entries { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DebugEntryList> { - let bytes = self.0.into_body().collect().await?; - let body: models::DebugEntryList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::DebugEntryCreateBatch, - pub(crate) request_id: String, - pub(crate) collection: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/requests/{}", - this.client.endpoint(), - &this.organization, - &this.request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DebugEntryList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::DebugEntryList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_requests_request_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Request> { - let bytes = self.0.into_body().collect().await?; - let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Request, - pub(crate) request_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/requests/{}", - this.client.endpoint(), - &this.organization, - &this.request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Request>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Request>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_requests_request_id { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) request_id: String, - pub(crate) synchronous: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/requests/{}", - this.client.endpoint(), - &this.organization, - &this.request_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(synchronous) = &this.synchronous { - req.url_mut() - .query_pairs_mut() - .append_pair("synchronous", &synchronous.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DebugEntryList> { + let bytes = self.0.into_body().collect().await?; + let body: models::DebugEntryList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::DebugEntryCreateBatch, + pub(crate) request_id: String, + pub(crate) collection: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/requests/{}", + this.client.endpoint(), + &this.organization, + &this.request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DebugEntryList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DebugEntryList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_requests_request_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Request> { + let bytes = self.0.into_body().collect().await?; + let body: models::Request = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Request, + pub(crate) request_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/requests/{}", + this.client.endpoint(), + &this.organization, + &this.request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Request>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Request>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } + pub mod delete_requests_request_id { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) request_id: String, + pub(crate) synchronous: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/requests/{}", + this.client.endpoint(), + &this.organization, + &this.request_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(synchronous) = &this.synchronous { + req + .url_mut() + .query_pairs_mut() + .append_pair("synchronous", &synchronous.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod availability { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn check_availability( + &self, + organization: impl Into<String>, + ) -> check_availability::RequestBuilder { + check_availability::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + } + pub mod check_availability { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn check_availability( - &self, - organization: impl Into<String>, - ) -> check_availability::RequestBuilder { - check_availability::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - } - pub mod check_availability { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/availability", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/availability", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod client { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get client version information."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn head_client(&self, organization: impl Into<String>) -> head_client::RequestBuilder { + head_client::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Get the client package."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `client_type`: Either \"EXE\" for a zip file containing a Windows symbol client (a.k.a. symbol.exe) along with dependencies, or \"TASK\" for a VSTS task that can be run on a VSTS build agent. All the other values are invalid. The parameter is case-insensitive."] + pub fn get( + &self, + organization: impl Into<String>, + client_type: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + client_type: client_type.into(), + } + } + } + pub mod head_client { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get client version information."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn head_client(&self, organization: impl Into<String>) -> head_client::RequestBuilder { - head_client::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - #[doc = "Get the client package."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `client_type`: Either \"EXE\" for a zip file containing a Windows symbol client (a.k.a. symbol.exe) along with dependencies, or \"TASK\" for a VSTS task that can be run on a VSTS build agent. All the other values are invalid. The parameter is case-insensitive."] - pub fn get( - &self, - organization: impl Into<String>, - client_type: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - client_type: client_type.into(), - } - } - } - pub mod head_client { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/client", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) client_type: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/client/{}", - this.client.endpoint(), - &this.organization, - &this.client_type - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/client", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) client_type: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/client/{}", + this.client.endpoint(), + &this.organization, + &this.client_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod contents { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `request_id`: The symbol request identifier."] + #[doc = "* `debug_entry_id`: The debug entry identifier."] + pub fn get( + &self, + organization: impl Into<String>, + request_id: impl Into<String>, + debug_entry_id: impl Into<String>, + ) -> 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 get { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `request_id`: The symbol request identifier."] - #[doc = "* `debug_entry_id`: The debug entry identifier."] - pub fn get( - &self, - organization: impl Into<String>, - request_id: impl Into<String>, - debug_entry_id: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) request_id: String, - pub(crate) debug_entry_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/requests/{}/contents/{}", - this.client.endpoint(), - &this.organization, - &this.request_id, - &this.debug_entry_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) request_id: String, + pub(crate) debug_entry_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/requests/{}/contents/{}", + this.client.endpoint(), + &this.organization, + &this.request_id, + &this.debug_entry_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod symsrv { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Given a client key, returns the best matched debug entry."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `debug_entry_client_key`: A \"client key\" used by both ends of Microsoft's symbol protocol to identify a debug entry. The semantics of client key is governed by symsrv and is beyond the scope of this documentation."] + pub fn get( + &self, + organization: impl Into<String>, + debug_entry_client_key: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + debug_entry_client_key: debug_entry_client_key.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Given a client key, returns the best matched debug entry."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `debug_entry_client_key`: A \"client key\" used by both ends of Microsoft's symbol protocol to identify a debug entry. The semantics of client key is governed by symsrv and is beyond the scope of this documentation."] - pub fn get( - &self, - organization: impl Into<String>, - debug_entry_client_key: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - debug_entry_client_key: debug_entry_client_key.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) debug_entry_client_key: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/symbol/symsrv/{}", - this.client.endpoint(), - &this.organization, - &this.debug_entry_client_key - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) debug_entry_client_key: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/symbol/symsrv/{}", + this.client.endpoint(), + &this.organization, + &this.debug_entry_client_key + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } diff --git a/azure_devops_rust_api/src/symbol/models.rs b/azure_devops_rust_api/src/symbol/models.rs index 9d3ad234..e7223c37 100644 --- a/azure_devops_rust_api/src/symbol/models.rs +++ b/azure_devops_rust_api/src/symbol/models.rs @@ -8,298 +8,298 @@ use std::str::FromStr; #[doc = "A dual-purpose data object, the debug entry is used by the client to publish the symbol file (with file's blob identifier, which can be calculated from VSTS hashing algorithm) or query the file (with a client key). Since the symbol server tries to return a matched symbol file with the richest information level, it may not always point to the same symbol file for different queries with same client key."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DebugEntry { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[doc = "BlobIdentifier with block hashes formatted to be deserialzied for symbol service."] - #[serde( - rename = "blobDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub blob_details: Option<JsonBlobIdentifierWithBlocks>, - #[doc = ""] - #[serde( - rename = "blobIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub blob_identifier: Option<JsonBlobIdentifier>, - #[doc = "The URI to get the symbol file. Provided by the server, the URI contains authentication information and is readily accessible by plain HTTP GET request. The client is recommended to retrieve the file as soon as it can since the URI will expire in a short period."] - #[serde(rename = "blobUri", default, skip_serializing_if = "Option::is_none")] - pub blob_uri: Option<String>, - #[doc = "A key the client (debugger, for example) uses to find the debug entry. Note it is not unique for each different symbol file as it does not distinguish between those which only differ by information level."] - #[serde(rename = "clientKey", default, skip_serializing_if = "Option::is_none")] - pub client_key: Option<String>, - #[doc = ""] - #[serde(rename = "domainId", default, skip_serializing_if = "Option::is_none")] - pub domain_id: Option<IDomainId>, - #[doc = "The information level this debug entry contains."] - #[serde( - rename = "informationLevel", - default, - skip_serializing_if = "Option::is_none" - )] - pub information_level: Option<debug_entry::InformationLevel>, - #[doc = "The identifier of symbol request to which this debug entry belongs."] - #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] - pub request_id: Option<String>, - #[doc = "The size for the debug entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[doc = "The status of debug entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<debug_entry::Status>, + #[serde(flatten)] + pub resource_base: ResourceBase, + #[doc = "BlobIdentifier with block hashes formatted to be deserialzied for symbol service."] + #[serde( + rename = "blobDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub blob_details: Option<JsonBlobIdentifierWithBlocks>, + #[doc = ""] + #[serde( + rename = "blobIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub blob_identifier: Option<JsonBlobIdentifier>, + #[doc = "The URI to get the symbol file. Provided by the server, the URI contains authentication information and is readily accessible by plain HTTP GET request. The client is recommended to retrieve the file as soon as it can since the URI will expire in a short period."] + #[serde(rename = "blobUri", default, skip_serializing_if = "Option::is_none")] + pub blob_uri: Option<String>, + #[doc = "A key the client (debugger, for example) uses to find the debug entry. Note it is not unique for each different symbol file as it does not distinguish between those which only differ by information level."] + #[serde(rename = "clientKey", default, skip_serializing_if = "Option::is_none")] + pub client_key: Option<String>, + #[doc = ""] + #[serde(rename = "domainId", default, skip_serializing_if = "Option::is_none")] + pub domain_id: Option<IDomainId>, + #[doc = "The information level this debug entry contains."] + #[serde( + rename = "informationLevel", + default, + skip_serializing_if = "Option::is_none" + )] + pub information_level: Option<debug_entry::InformationLevel>, + #[doc = "The identifier of symbol request to which this debug entry belongs."] + #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")] + pub request_id: Option<String>, + #[doc = "The size for the debug entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[doc = "The status of debug entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<debug_entry::Status>, } impl DebugEntry { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod debug_entry { - use super::*; - #[doc = "The information level this debug entry contains."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum InformationLevel { - #[serde(rename = "none")] - None, - #[serde(rename = "binary")] - Binary, - #[serde(rename = "publics")] - Publics, - #[serde(rename = "traceFormatPresent")] - TraceFormatPresent, - #[serde(rename = "typeInfo")] - TypeInfo, - #[serde(rename = "lineNumbers")] - LineNumbers, - #[serde(rename = "globalSymbols")] - GlobalSymbols, - #[serde(rename = "private")] - Private, - #[serde(rename = "sourceIndexed")] - SourceIndexed, - } - #[doc = "The status of debug entry."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "none")] - None, - #[serde(rename = "created")] - Created, - #[serde(rename = "blobMissing")] - BlobMissing, - } + use super::*; + #[doc = "The information level this debug entry contains."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum InformationLevel { + #[serde(rename = "none")] + None, + #[serde(rename = "binary")] + Binary, + #[serde(rename = "publics")] + Publics, + #[serde(rename = "traceFormatPresent")] + TraceFormatPresent, + #[serde(rename = "typeInfo")] + TypeInfo, + #[serde(rename = "lineNumbers")] + LineNumbers, + #[serde(rename = "globalSymbols")] + GlobalSymbols, + #[serde(rename = "private")] + Private, + #[serde(rename = "sourceIndexed")] + SourceIndexed, + } + #[doc = "The status of debug entry."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "none")] + None, + #[serde(rename = "created")] + Created, + #[serde(rename = "blobMissing")] + BlobMissing, + } } #[doc = "A batch of debug entry to create."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DebugEntryCreateBatch { - #[doc = "Defines what to do when a debug entry in the batch already exists."] - #[serde( - rename = "createBehavior", - default, - skip_serializing_if = "Option::is_none" - )] - pub create_behavior: Option<debug_entry_create_batch::CreateBehavior>, - #[doc = "The debug entries."] - #[serde( - rename = "debugEntries", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub debug_entries: Vec<DebugEntry>, - #[doc = "Serialized Proof nodes, used to verify uploads on server side for Chunk Dedup DebugEntry"] - #[serde( - rename = "proofNodes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub proof_nodes: Vec<String>, + #[doc = "Defines what to do when a debug entry in the batch already exists."] + #[serde( + rename = "createBehavior", + default, + skip_serializing_if = "Option::is_none" + )] + pub create_behavior: Option<debug_entry_create_batch::CreateBehavior>, + #[doc = "The debug entries."] + #[serde( + rename = "debugEntries", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub debug_entries: Vec<DebugEntry>, + #[doc = "Serialized Proof nodes, used to verify uploads on server side for Chunk Dedup DebugEntry"] + #[serde( + rename = "proofNodes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub proof_nodes: Vec<String>, } impl DebugEntryCreateBatch { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod debug_entry_create_batch { - use super::*; - #[doc = "Defines what to do when a debug entry in the batch already exists."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum CreateBehavior { - #[serde(rename = "throwIfExists")] - ThrowIfExists, - #[serde(rename = "skipIfExists")] - SkipIfExists, - #[serde(rename = "overwriteIfExists")] - OverwriteIfExists, - } + use super::*; + #[doc = "Defines what to do when a debug entry in the batch already exists."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum CreateBehavior { + #[serde(rename = "throwIfExists")] + ThrowIfExists, + #[serde(rename = "skipIfExists")] + SkipIfExists, + #[serde(rename = "overwriteIfExists")] + OverwriteIfExists, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DebugEntryList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<DebugEntry>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<DebugEntry>, } impl DebugEntryList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IDomainId {} impl IDomainId { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "BlobBlock hash formatted to be deserialized for symbol service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonBlobBlockHash { - #[doc = "Array of hash bytes."] - #[serde( - rename = "hashBytes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub hash_bytes: Vec<String>, + #[doc = "Array of hash bytes."] + #[serde( + rename = "hashBytes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub hash_bytes: Vec<String>, } impl JsonBlobBlockHash { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonBlobIdentifier { - #[serde( - rename = "identifierValue", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub identifier_value: Vec<String>, + #[serde( + rename = "identifierValue", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub identifier_value: Vec<String>, } impl JsonBlobIdentifier { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "BlobIdentifier with block hashes formatted to be deserialzied for symbol service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonBlobIdentifierWithBlocks { - #[doc = "List of blob block hashes."] - #[serde( - rename = "blockHashes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub block_hashes: Vec<JsonBlobBlockHash>, - #[doc = "Array of blobId bytes."] - #[serde( - rename = "identifierValue", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub identifier_value: Vec<String>, + #[doc = "List of blob block hashes."] + #[serde( + rename = "blockHashes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub block_hashes: Vec<JsonBlobBlockHash>, + #[doc = "Array of blobId bytes."] + #[serde( + rename = "identifierValue", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub identifier_value: Vec<String>, } impl JsonBlobIdentifierWithBlocks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Symbol request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Request { - #[serde(flatten)] - pub resource_base: ResourceBase, - #[doc = "An optional human-facing description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = ""] - #[serde(rename = "domainId", default, skip_serializing_if = "Option::is_none")] - pub domain_id: Option<IDomainId>, - #[doc = "An optional expiration date for the request. The request will become inaccessible and get deleted after the date, regardless of its status. On an HTTP POST, if expiration date is null/missing, the server will assign a default expiration data (30 days unless overwridden in the registry at the account level). On PATCH, if expiration date is null/missing, the behavior is to not change whatever the request's current expiration date is."] - #[serde( - rename = "expirationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub expiration_date: Option<time::OffsetDateTime>, - #[doc = "Indicates if request should be chunk dedup"] - #[serde(rename = "isChunked", default, skip_serializing_if = "Option::is_none")] - pub is_chunked: Option<bool>, - #[doc = "A human-facing name for the request. Required on POST, ignored on PATCH."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The total Size for this request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[doc = "The status for this request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<request::Status>, + #[serde(flatten)] + pub resource_base: ResourceBase, + #[doc = "An optional human-facing description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = ""] + #[serde(rename = "domainId", default, skip_serializing_if = "Option::is_none")] + pub domain_id: Option<IDomainId>, + #[doc = "An optional expiration date for the request. The request will become inaccessible and get deleted after the date, regardless of its status. On an HTTP POST, if expiration date is null/missing, the server will assign a default expiration data (30 days unless overwridden in the registry at the account level). On PATCH, if expiration date is null/missing, the behavior is to not change whatever the request's current expiration date is."] + #[serde( + rename = "expirationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub expiration_date: Option<time::OffsetDateTime>, + #[doc = "Indicates if request should be chunk dedup"] + #[serde(rename = "isChunked", default, skip_serializing_if = "Option::is_none")] + pub is_chunked: Option<bool>, + #[doc = "A human-facing name for the request. Required on POST, ignored on PATCH."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The total Size for this request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[doc = "The status for this request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<request::Status>, } impl Request { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod request { - use super::*; - #[doc = "The status for this request."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "none")] - None, - #[serde(rename = "created")] - Created, - #[serde(rename = "sealed")] - Sealed, - #[serde(rename = "unavailable")] - Unavailable, - } + use super::*; + #[doc = "The status for this request."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "none")] + None, + #[serde(rename = "created")] + Created, + #[serde(rename = "sealed")] + Sealed, + #[serde(rename = "unavailable")] + Unavailable, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceBase { - #[doc = "The ID of user who created this item. Optional."] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<String>, - #[doc = "The date time when this item is created. Optional."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "An identifier for this item. Optional."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "An opaque ETag used to synchronize with the version stored at server end. Optional."] - #[serde( - rename = "storageETag", - default, - skip_serializing_if = "Option::is_none" - )] - pub storage_e_tag: Option<String>, - #[doc = "A URI which can be used to retrieve this item in its raw format. Optional. Note this is distinguished from other URIs that are present in a derived resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The ID of user who created this item. Optional."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<String>, + #[doc = "The date time when this item is created. Optional."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "An identifier for this item. Optional."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "An opaque ETag used to synchronize with the version stored at server end. Optional."] + #[serde( + rename = "storageETag", + default, + skip_serializing_if = "Option::is_none" + )] + pub storage_e_tag: Option<String>, + #[doc = "A URI which can be used to retrieve this item in its raw format. Optional. Note this is distinguished from other URIs that are present in a derived resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ResourceBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/test/mod.rs b/azure_devops_rust_api/src/test/mod.rs index 2223d18f..3ed02041 100644 --- a/azure_devops_rust_api/src/test/mod.rs +++ b/azure_devops_rust_api/src/test/mod.rs @@ -9,5898 +9,5954 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + 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()) + } +} +pub mod runs { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `min_last_updated_date`: Minimum Last Modified Date of run to be queried (Mandatory)."] + #[doc = "* `max_last_updated_date`: Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days)."] + pub fn query( + &self, + organization: impl Into<String>, + project: impl Into<String>, + min_last_updated_date: impl Into<time::OffsetDateTime>, + max_last_updated_date: impl Into<time::OffsetDateTime>, + ) -> 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 = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); + #[doc = "Get a list of test runs."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Run details RunCreateModel"] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::RunCreateModel>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the run to get."] + pub fn get_test_run_by_id( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Run details RunUpdateModel"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the run to update."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::RunUpdateModel>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the run to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the run to get."] + pub fn get_test_run_statistics( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 query { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestRunList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestRunList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) min_last_updated_date: time::OffsetDateTime, + pub(crate) max_last_updated_date: time::OffsetDateTime, + pub(crate) state: Option<String>, + pub(crate) plan_ids: Option<String>, + pub(crate) is_automated: Option<bool>, + pub(crate) publish_context: Option<String>, + pub(crate) build_ids: Option<String>, + pub(crate) build_def_ids: Option<String>, + pub(crate) branch_name: Option<String>, + pub(crate) release_ids: Option<String>, + pub(crate) release_def_ids: Option<String>, + pub(crate) release_env_ids: Option<String>, + pub(crate) release_env_def_ids: Option<String>, + pub(crate) run_title: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + } + impl RequestBuilder { + #[doc = "Current state of the Runs to be queried."] + pub fn state(mut self, state: impl Into<String>) -> Self { + self.state = Some(state.into()); + self + } + #[doc = "Plan Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] + pub fn plan_ids(mut self, plan_ids: impl Into<String>) -> Self { + self.plan_ids = Some(plan_ids.into()); + self + } + #[doc = "Automation type of the Runs to be queried."] + pub fn is_automated(mut self, is_automated: bool) -> Self { + self.is_automated = Some(is_automated); + self + } + #[doc = "PublishContext of the Runs to be queried."] + pub fn publish_context(mut self, publish_context: impl Into<String>) -> Self { + self.publish_context = Some(publish_context.into()); self + } + #[doc = "Build Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] + pub fn build_ids(mut self, build_ids: impl Into<String>) -> Self { + self.build_ids = Some(build_ids.into()); + self + } + #[doc = "Build Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] + pub fn build_def_ids(mut self, build_def_ids: impl Into<String>) -> Self { + self.build_def_ids = Some(build_def_ids.into()); + self + } + #[doc = "Source Branch name of the Runs to be queried."] + pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self { + self.branch_name = Some(branch_name.into()); + self + } + #[doc = "Release Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] + pub fn release_ids(mut self, release_ids: impl Into<String>) -> Self { + self.release_ids = Some(release_ids.into()); + self + } + #[doc = "Release Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] + pub fn release_def_ids(mut self, release_def_ids: impl Into<String>) -> Self { + self.release_def_ids = Some(release_def_ids.into()); + self + } + #[doc = "Release Environment Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] + pub fn release_env_ids(mut self, release_env_ids: impl Into<String>) -> Self { + self.release_env_ids = Some(release_env_ids.into()); + self + } + #[doc = "Release Environment Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] + pub fn release_env_def_ids(mut self, release_env_def_ids: impl Into<String>) -> Self { + self.release_env_def_ids = Some(release_env_def_ids.into()); + self + } + #[doc = "Run Title of the Runs to be queried."] + pub fn run_title(mut self, run_title: impl Into<String>) -> Self { + self.run_title = Some(run_title.into()); + self + } + #[doc = "Number of runs to be queried. Limit is 100"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "continuation token received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs?minLastUpdatedDate={}&maxLastUpdatedDate={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.min_last_updated_date, + &this.max_last_updated_date + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestRunList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestRunList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestRunList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestRunList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_uri: Option<String>, + pub(crate) owner: Option<String>, + pub(crate) tmi_run_id: Option<String>, + pub(crate) plan_id: Option<i32>, + pub(crate) include_run_details: Option<bool>, + pub(crate) automated: Option<bool>, + pub(crate) skip: Option<i32>, + pub(crate) top: Option<i32>, + } + impl RequestBuilder { + #[doc = "URI of the build that the runs used."] + pub fn build_uri(mut self, build_uri: impl Into<String>) -> Self { + self.build_uri = Some(build_uri.into()); + self + } + #[doc = "Team foundation ID of the owner of the runs."] + pub fn owner(mut self, owner: impl Into<String>) -> Self { + self.owner = Some(owner.into()); + self + } + pub fn tmi_run_id(mut self, tmi_run_id: impl Into<String>) -> Self { + self.tmi_run_id = Some(tmi_run_id.into()); + self + } + #[doc = "ID of the test plan that the runs are a part of."] + pub fn plan_id(mut self, plan_id: i32) -> Self { + self.plan_id = Some(plan_id); + self + } + #[doc = "If true, include all the properties of the runs."] + pub fn include_run_details(mut self, include_run_details: bool) -> Self { + self.include_run_details = Some(include_run_details); + self + } + #[doc = "If true, only returns automated runs."] + pub fn automated(mut self, automated: bool) -> Self { + self.automated = Some(automated); self + } + #[doc = "Number of test runs to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Number of test runs to return."] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestRunList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestRunList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestRun> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestRun = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestRun>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TestRun>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_test_run_by_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestRun> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestRun = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) include_details: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(include_details) = &this.include_details { + req + .url_mut() + .query_pairs_mut() + .append_pair("includeDetails", &include_details.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestRun>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TestRun>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestRun> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestRun = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod runs { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::RunUpdateModel, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestRun>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TestRun>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `min_last_updated_date`: Minimum Last Modified Date of run to be queried (Mandatory)."] - #[doc = "* `max_last_updated_date`: Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days)."] - pub fn query( - &self, - organization: impl Into<String>, - project: impl Into<String>, - min_last_updated_date: impl Into<time::OffsetDateTime>, - max_last_updated_date: impl Into<time::OffsetDateTime>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Run details RunCreateModel"] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::RunCreateModel>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the run to get."] - pub fn get_test_run_by_id( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Run details RunUpdateModel"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the run to update."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::RunUpdateModel>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the run to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the run to get."] - pub fn get_test_run_statistics( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestRunList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) min_last_updated_date: time::OffsetDateTime, - pub(crate) max_last_updated_date: time::OffsetDateTime, - pub(crate) state: Option<String>, - pub(crate) plan_ids: Option<String>, - pub(crate) is_automated: Option<bool>, - pub(crate) publish_context: Option<String>, - pub(crate) build_ids: Option<String>, - pub(crate) build_def_ids: Option<String>, - pub(crate) branch_name: Option<String>, - pub(crate) release_ids: Option<String>, - pub(crate) release_def_ids: Option<String>, - pub(crate) release_env_ids: Option<String>, - pub(crate) release_env_def_ids: Option<String>, - pub(crate) run_title: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - } - impl RequestBuilder { - #[doc = "Current state of the Runs to be queried."] - pub fn state(mut self, state: impl Into<String>) -> Self { - self.state = Some(state.into()); - self - } - #[doc = "Plan Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] - pub fn plan_ids(mut self, plan_ids: impl Into<String>) -> Self { - self.plan_ids = Some(plan_ids.into()); - self - } - #[doc = "Automation type of the Runs to be queried."] - pub fn is_automated(mut self, is_automated: bool) -> Self { - self.is_automated = Some(is_automated); - self - } - #[doc = "PublishContext of the Runs to be queried."] - pub fn publish_context(mut self, publish_context: impl Into<String>) -> Self { - self.publish_context = Some(publish_context.into()); - self - } - #[doc = "Build Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] - pub fn build_ids(mut self, build_ids: impl Into<String>) -> Self { - self.build_ids = Some(build_ids.into()); - self - } - #[doc = "Build Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] - pub fn build_def_ids(mut self, build_def_ids: impl Into<String>) -> Self { - self.build_def_ids = Some(build_def_ids.into()); - self - } - #[doc = "Source Branch name of the Runs to be queried."] - pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self { - self.branch_name = Some(branch_name.into()); - self - } - #[doc = "Release Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] - pub fn release_ids(mut self, release_ids: impl Into<String>) -> Self { - self.release_ids = Some(release_ids.into()); - self - } - #[doc = "Release Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] - pub fn release_def_ids(mut self, release_def_ids: impl Into<String>) -> Self { - self.release_def_ids = Some(release_def_ids.into()); - self - } - #[doc = "Release Environment Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] - pub fn release_env_ids(mut self, release_env_ids: impl Into<String>) -> Self { - self.release_env_ids = Some(release_env_ids.into()); - self - } - #[doc = "Release Environment Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10)."] - pub fn release_env_def_ids(mut self, release_env_def_ids: impl Into<String>) -> Self { - self.release_env_def_ids = Some(release_env_def_ids.into()); - self - } - #[doc = "Run Title of the Runs to be queried."] - pub fn run_title(mut self, run_title: impl Into<String>) -> Self { - self.run_title = Some(run_title.into()); - self - } - #[doc = "Number of runs to be queried. Limit is 100"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "continuation token received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs?minLastUpdatedDate={}&maxLastUpdatedDate={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.min_last_updated_date, - &this.max_last_updated_date - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestRunList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestRunList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestRunList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_uri: Option<String>, - pub(crate) owner: Option<String>, - pub(crate) tmi_run_id: Option<String>, - pub(crate) plan_id: Option<i32>, - pub(crate) include_run_details: Option<bool>, - pub(crate) automated: Option<bool>, - pub(crate) skip: Option<i32>, - pub(crate) top: Option<i32>, - } - impl RequestBuilder { - #[doc = "URI of the build that the runs used."] - pub fn build_uri(mut self, build_uri: impl Into<String>) -> Self { - self.build_uri = Some(build_uri.into()); - self - } - #[doc = "Team foundation ID of the owner of the runs."] - pub fn owner(mut self, owner: impl Into<String>) -> Self { - self.owner = Some(owner.into()); - self - } - pub fn tmi_run_id(mut self, tmi_run_id: impl Into<String>) -> Self { - self.tmi_run_id = Some(tmi_run_id.into()); - self - } - #[doc = "ID of the test plan that the runs are a part of."] - pub fn plan_id(mut self, plan_id: i32) -> Self { - self.plan_id = Some(plan_id); - self - } - #[doc = "If true, include all the properties of the runs."] - pub fn include_run_details(mut self, include_run_details: bool) -> Self { - self.include_run_details = Some(include_run_details); - self - } - #[doc = "If true, only returns automated runs."] - pub fn automated(mut self, automated: bool) -> Self { - self.automated = Some(automated); - self - } - #[doc = "Number of test runs to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "Number of test runs to return."] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestRunList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestRunList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestRun> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRun = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestRun>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestRun>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_test_run_by_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestRun> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRun = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) include_details: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(include_details) = &this.include_details { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDetails", &include_details.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestRun>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestRun>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestRun> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRun = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::RunUpdateModel, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestRun>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestRun>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_test_run_statistics { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestRunStatistic> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunStatistic = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs/{}/Statistics", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestRunStatistic>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestRunStatistic>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_test_run_statistics { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestRunStatistic> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestRunStatistic = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs/{}/Statistics", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestRunStatistic>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestRunStatistic>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod attachments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get list of test sub result attachments"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the test run that contains the result."] + #[doc = "* `test_case_result_id`: ID of the test results that contains sub result."] + #[doc = "* `test_sub_result_id`: ID of the test sub result whose attachment has to be downloaded"] + pub fn get_test_sub_result_attachments( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Attachment Request Model."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the test run that contains the result."] + #[doc = "* `test_case_result_id`: ID of the test results that contains sub result."] + #[doc = "* `test_sub_result_id`: ID of the test sub results against which attachment has to be uploaded."] + pub fn create_test_sub_result_attachment( + &self, + organization: impl Into<String>, + body: impl Into<models::TestAttachmentRequestModel>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the test run that contains the result."] + #[doc = "* `test_case_result_id`: ID of the test results that contains sub result."] + #[doc = "* `attachment_id`: ID of the test result attachment to be downloaded"] + #[doc = "* `test_sub_result_id`: ID of the test sub result whose attachment has to be downloaded"] + pub fn get_test_sub_result_attachment_zip( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the test run."] + pub fn get_test_run_attachments( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Attachment details TestAttachmentRequestModel"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the test run against which attachment has to be uploaded."] + pub fn create_test_run_attachment( + &self, + organization: impl Into<String>, + body: impl Into<models::TestAttachmentRequestModel>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the test run whose attachment has to be downloaded."] + #[doc = "* `attachment_id`: ID of the test run attachment to be downloaded."] + pub fn get_test_run_attachment_zip( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the test run that contains the result."] + #[doc = "* `test_case_result_id`: ID of the test result."] + pub fn get_test_result_attachments( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Attachment details TestAttachmentRequestModel"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the test run that contains the result."] + #[doc = "* `test_case_result_id`: ID of the test result against which attachment has to be uploaded."] + pub fn create_test_result_attachment( + &self, + organization: impl Into<String>, + body: impl Into<models::TestAttachmentRequestModel>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the test run that contains the testCaseResultId."] + #[doc = "* `test_case_result_id`: ID of the test result whose attachment has to be downloaded."] + #[doc = "* `attachment_id`: ID of the test result attachment to be downloaded."] + pub fn get_test_result_attachment_zip( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 get_test_sub_result_attachments { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get list of test sub result attachments"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the test run that contains the result."] - #[doc = "* `test_case_result_id`: ID of the test results that contains sub result."] - #[doc = "* `test_sub_result_id`: ID of the test sub result whose attachment has to be downloaded"] - pub fn get_test_sub_result_attachments( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Attachment Request Model."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the test run that contains the result."] - #[doc = "* `test_case_result_id`: ID of the test results that contains sub result."] - #[doc = "* `test_sub_result_id`: ID of the test sub results against which attachment has to be uploaded."] - pub fn create_test_sub_result_attachment( - &self, - organization: impl Into<String>, - body: impl Into<models::TestAttachmentRequestModel>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the test run that contains the result."] - #[doc = "* `test_case_result_id`: ID of the test results that contains sub result."] - #[doc = "* `attachment_id`: ID of the test result attachment to be downloaded"] - #[doc = "* `test_sub_result_id`: ID of the test sub result whose attachment has to be downloaded"] - pub fn get_test_sub_result_attachment_zip( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the test run."] - pub fn get_test_run_attachments( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Attachment details TestAttachmentRequestModel"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the test run against which attachment has to be uploaded."] - pub fn create_test_run_attachment( - &self, - organization: impl Into<String>, - body: impl Into<models::TestAttachmentRequestModel>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the test run whose attachment has to be downloaded."] - #[doc = "* `attachment_id`: ID of the test run attachment to be downloaded."] - pub fn get_test_run_attachment_zip( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the test run that contains the result."] - #[doc = "* `test_case_result_id`: ID of the test result."] - pub fn get_test_result_attachments( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Attachment details TestAttachmentRequestModel"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the test run that contains the result."] - #[doc = "* `test_case_result_id`: ID of the test result against which attachment has to be uploaded."] - pub fn create_test_result_attachment( - &self, - organization: impl Into<String>, - body: impl Into<models::TestAttachmentRequestModel>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the test run that contains the testCaseResultId."] - #[doc = "* `test_case_result_id`: ID of the test result whose attachment has to be downloaded."] - #[doc = "* `attachment_id`: ID of the test result attachment to be downloaded."] - pub fn get_test_result_attachment_zip( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 get_test_sub_result_attachments { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestAttachmentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments?testSubResultId={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.test_case_result_id, - &this.test_sub_result_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let test_sub_result_id = &this.test_sub_result_id; - req.url_mut() - .query_pairs_mut() - .append_pair("testSubResultId", &test_sub_result_id.to_string()); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestAttachmentList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestAttachmentList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_test_sub_result_attachment { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestAttachmentReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentReference = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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, - pub(crate) test_sub_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments?testSubResultId={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.test_case_result_id, - &this.test_sub_result_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestAttachmentReference>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestAttachmentReference>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_test_sub_result_attachment_zip { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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, - pub(crate) test_sub_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments/{}?testSubResultId={}" , this . client . endpoint () , & this . organization , & this . project , & this . run_id , & this . test_case_result_id , & this . attachment_id , & this . test_sub_result_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let test_sub_result_id = &this.test_sub_result_id; - req.url_mut() - .query_pairs_mut() - .append_pair("testSubResultId", &test_sub_result_id.to_string()); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_test_run_attachments { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestAttachmentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/attachments", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestAttachmentList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestAttachmentList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_test_run_attachment { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestAttachmentReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentReference = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestAttachmentRequestModel, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/attachments", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestAttachmentReference>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestAttachmentReference>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_test_run_attachment_zip { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) attachment_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/attachments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.attachment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_test_result_attachments { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestAttachmentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.test_case_result_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestAttachmentList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestAttachmentList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_test_result_attachment { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestAttachmentReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestAttachmentReference = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.test_case_result_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestAttachmentReference>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestAttachmentReference>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_test_result_attachment_zip { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.test_case_result_id, - &this.attachment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestAttachmentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestAttachmentList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments?testSubResultId={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.test_case_result_id, + &this.test_sub_result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let test_sub_result_id = &this.test_sub_result_id; + req + .url_mut() + .query_pairs_mut() + .append_pair("testSubResultId", &test_sub_result_id.to_string()); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestAttachmentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestAttachmentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_test_sub_result_attachment { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestAttachmentReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestAttachmentReference = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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, + pub(crate) test_sub_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments?testSubResultId={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.test_case_result_id, + &this.test_sub_result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestAttachmentReference>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestAttachmentReference>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_test_sub_result_attachment_zip { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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, + pub(crate) test_sub_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments/{}?testSubResultId={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.test_case_result_id, + &this.attachment_id, + &this.test_sub_result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let test_sub_result_id = &this.test_sub_result_id; + req + .url_mut() + .query_pairs_mut() + .append_pair("testSubResultId", &test_sub_result_id.to_string()); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_test_run_attachments { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestAttachmentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestAttachmentList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/attachments", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestAttachmentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestAttachmentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_test_run_attachment { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestAttachmentReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestAttachmentReference = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestAttachmentRequestModel, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/attachments", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestAttachmentReference>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestAttachmentReference>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_test_run_attachment_zip { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) attachment_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/attachments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.attachment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_test_result_attachments { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestAttachmentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestAttachmentList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.test_case_result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestAttachmentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestAttachmentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_test_result_attachment { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestAttachmentReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestAttachmentReference = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.test_case_result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestAttachmentReference>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestAttachmentReference>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_test_result_attachment_zip { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.test_case_result_id, + &this.attachment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod code_coverage { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get code coverage data for a build."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `build_id`: ID of the build for which code coverage data needs to be fetched."] + #[doc = "* `flags`: Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData."] + pub fn get_build_code_coverage( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the test run for which code coverage data needs to be fetched."] + #[doc = "* `flags`: Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData."] + pub fn get_test_run_code_coverage( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 get_build_code_coverage { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get code coverage data for a build."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: ID of the build for which code coverage data needs to be fetched."] - #[doc = "* `flags`: Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData."] - pub fn get_build_code_coverage( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the test run for which code coverage data needs to be fetched."] - #[doc = "* `flags`: Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData."] - pub fn get_test_run_code_coverage( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 get_build_code_coverage { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BuildCoverageList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BuildCoverageList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) build_id: i32, - pub(crate) flags: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/codecoverage", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BuildCoverageList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BuildCoverageList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_test_run_code_coverage { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestRunCoverageList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestRunCoverageList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) flags: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/codecoverage", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let flags = &this.flags; - req.url_mut() - .query_pairs_mut() - .append_pair("flags", &flags.to_string()); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestRunCoverageList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestRunCoverageList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BuildCoverageList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BuildCoverageList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) build_id: i32, + pub(crate) flags: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/codecoverage", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BuildCoverageList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BuildCoverageList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_test_run_code_coverage { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestRunCoverageList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestRunCoverageList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) flags: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/codecoverage", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let flags = &this.flags; + req + .url_mut() + .query_pairs_mut() + .append_pair("flags", &flags.to_string()); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestRunCoverageList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestRunCoverageList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod points { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of test points."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan."] + #[doc = "* `suite_id`: ID of the suite that contains the points."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan."] + #[doc = "* `suite_id`: ID of the suite that contains the point."] + #[doc = "* `point_ids`: ID of the test point to get."] + pub fn get_point( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Data to update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan."] + #[doc = "* `suite_id`: ID of the suite that contains the points."] + #[doc = "* `point_ids`: ID of the test point to get. Use a comma-separated list of IDs to update multiple test points."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::PointUpdateModel>, + project: impl Into<String>, + plan_id: i32, + suite_id: i32, + point_ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: TestPointsQuery to get test points."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_points_by_query( + &self, + organization: impl Into<String>, + body: impl Into<models::TestPointsQuery>, + project: impl Into<String>, + ) -> 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of test points."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan."] - #[doc = "* `suite_id`: ID of the suite that contains the points."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan."] - #[doc = "* `suite_id`: ID of the suite that contains the point."] - #[doc = "* `point_ids`: ID of the test point to get."] - pub fn get_point( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Data to update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan."] - #[doc = "* `suite_id`: ID of the suite that contains the points."] - #[doc = "* `point_ids`: ID of the test point to get. Use a comma-separated list of IDs to update multiple test points."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::PointUpdateModel>, - project: impl Into<String>, - plan_id: i32, - suite_id: i32, - point_ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: TestPointsQuery to get test points."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_points_by_query( - &self, - organization: impl Into<String>, - body: impl Into<models::TestPointsQuery>, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestPointList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_id: i32, - pub(crate) wit_fields: Option<String>, - pub(crate) configuration_id: Option<String>, - pub(crate) test_case_id: Option<String>, - pub(crate) test_point_ids: Option<String>, - pub(crate) include_point_details: Option<bool>, - pub(crate) skip: Option<i32>, - pub(crate) top: Option<i32>, - } - impl RequestBuilder { - #[doc = "Comma-separated list of work item field names."] - pub fn wit_fields(mut self, wit_fields: impl Into<String>) -> Self { - self.wit_fields = Some(wit_fields.into()); - self - } - #[doc = "Get test points for specific configuration."] - pub fn configuration_id(mut self, configuration_id: impl Into<String>) -> Self { - self.configuration_id = Some(configuration_id.into()); - self - } - #[doc = "Get test points for a specific test case, valid when configurationId is not set."] - pub fn test_case_id(mut self, test_case_id: impl Into<String>) -> Self { - self.test_case_id = Some(test_case_id.into()); - self - } - #[doc = "Get test points for comma-separated list of test point IDs, valid only when configurationId and testCaseId are not set."] - pub fn test_point_ids(mut self, test_point_ids: impl Into<String>) -> Self { - self.test_point_ids = Some(test_point_ids.into()); - self - } - #[doc = "Include all properties for the test point."] - pub fn include_point_details(mut self, include_point_details: bool) -> Self { - self.include_point_details = Some(include_point_details); - self - } - #[doc = "Number of test points to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "Number of test points to return."] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestPointList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestPointList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_point { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestPoint> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPoint = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_id: i32, - pub(crate) point_ids: i32, - pub(crate) wit_fields: Option<String>, - } - impl RequestBuilder { - #[doc = "Comma-separated list of work item field names."] - pub fn wit_fields(mut self, wit_fields: impl Into<String>) -> Self { - self.wit_fields = Some(wit_fields.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id, - &this.point_ids - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(wit_fields) = &this.wit_fields { - req.url_mut() - .query_pairs_mut() - .append_pair("witFields", wit_fields); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestPoint>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestPoint>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestPointList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PointUpdateModel, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_id: i32, - pub(crate) point_ids: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id, - &this.point_ids - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestPointList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestPointList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_points_by_query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestPointsQuery> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPointsQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestPointsQuery, - pub(crate) project: String, - pub(crate) skip: Option<i32>, - pub(crate) top: Option<i32>, - } - impl RequestBuilder { - #[doc = "Number of test points to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "Number of test points to return."] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/points", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestPointsQuery>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestPointsQuery>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestPointList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_id: i32, + pub(crate) wit_fields: Option<String>, + pub(crate) configuration_id: Option<String>, + pub(crate) test_case_id: Option<String>, + pub(crate) test_point_ids: Option<String>, + pub(crate) include_point_details: Option<bool>, + pub(crate) skip: Option<i32>, + pub(crate) top: Option<i32>, + } + impl RequestBuilder { + #[doc = "Comma-separated list of work item field names."] + pub fn wit_fields(mut self, wit_fields: impl Into<String>) -> Self { + self.wit_fields = Some(wit_fields.into()); + self + } + #[doc = "Get test points for specific configuration."] + pub fn configuration_id(mut self, configuration_id: impl Into<String>) -> Self { + self.configuration_id = Some(configuration_id.into()); + self + } + #[doc = "Get test points for a specific test case, valid when configurationId is not set."] + pub fn test_case_id(mut self, test_case_id: impl Into<String>) -> Self { + self.test_case_id = Some(test_case_id.into()); + self + } + #[doc = "Get test points for comma-separated list of test point IDs, valid only when configurationId and testCaseId are not set."] + pub fn test_point_ids(mut self, test_point_ids: impl Into<String>) -> Self { + self.test_point_ids = Some(test_point_ids.into()); + self + } + #[doc = "Include all properties for the test point."] + pub fn include_point_details(mut self, include_point_details: bool) -> Self { + self.include_point_details = Some(include_point_details); + self + } + #[doc = "Number of test points to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Number of test points to return."] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestPointList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestPointList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_point { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestPoint> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestPoint = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_id: i32, + pub(crate) point_ids: i32, + pub(crate) wit_fields: Option<String>, + } + impl RequestBuilder { + #[doc = "Comma-separated list of work item field names."] + pub fn wit_fields(mut self, wit_fields: impl Into<String>) -> Self { + self.wit_fields = Some(wit_fields.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id, + &this.point_ids + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(wit_fields) = &this.wit_fields { + req + .url_mut() + .query_pairs_mut() + .append_pair("witFields", wit_fields); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestPoint>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TestPoint>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestPointList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PointUpdateModel, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_id: i32, + pub(crate) point_ids: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id, + &this.point_ids + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestPointList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestPointList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_points_by_query { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestPointsQuery> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestPointsQuery = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestPointsQuery, + pub(crate) project: String, + pub(crate) skip: Option<i32>, + pub(crate) top: Option<i32>, + } + impl RequestBuilder { + #[doc = "Number of test points to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Number of test points to return."] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/points", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestPointsQuery>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestPointsQuery>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod test_suites { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all test cases in a suite."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan that contains the suites."] + #[doc = "* `suite_id`: ID of the suite to get."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan that contains the suites."] + #[doc = "* `suite_id`: ID of the suite that contains the test case."] + #[doc = "* `test_case_ids`: ID of the test case to get."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan that contains the suite."] + #[doc = "* `suite_id`: ID of the test suite to which the test cases must be added."] + #[doc = "* `test_case_ids`: IDs of the test cases to add to the suite. Ids are specified in comma separated format."] + pub fn add( + &self, + organization: impl Into<String>, + project: impl Into<String>, + plan_id: i32, + suite_id: i32, + test_case_ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Model for updation of the properties of test case suite association."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan that contains the suite."] + #[doc = "* `suite_id`: ID of the test suite to which the test cases must be added."] + #[doc = "* `test_case_ids`: IDs of the test cases to add to the suite. Ids are specified in comma separated format."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::SuiteTestCaseUpdateModel>, + project: impl Into<String>, + plan_id: i32, + suite_id: i32, + test_case_ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan that contains the suite."] + #[doc = "* `suite_id`: ID of the suite to get."] + #[doc = "* `test_case_ids`: IDs of the test cases to remove from the suite."] + pub fn remove_test_cases_from_suite_url( + &self, + organization: impl Into<String>, + project: impl Into<String>, + plan_id: i32, + suite_id: i32, + test_case_ids: impl Into<String>, + ) -> 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 list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SuiteTestCaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::SuiteTestCaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SuiteTestCaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SuiteTestCaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SuiteTestCase> { + let bytes = self.0.into_body().collect().await?; + let body: models::SuiteTestCase = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id, + &this.test_case_ids + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SuiteTestCase>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SuiteTestCase>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SuiteTestCaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::SuiteTestCaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id, + &this.test_case_ids + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SuiteTestCaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SuiteTestCaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SuiteTestCaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::SuiteTestCaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } -} -pub mod test_suites { + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::SuiteTestCaseUpdateModel, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_id: i32, + pub(crate) test_case_ids: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id, + &this.test_case_ids + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SuiteTestCaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SuiteTestCaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod remove_test_cases_from_suite_url { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get all test cases in a suite."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan that contains the suites."] - #[doc = "* `suite_id`: ID of the suite to get."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan that contains the suites."] - #[doc = "* `suite_id`: ID of the suite that contains the test case."] - #[doc = "* `test_case_ids`: ID of the test case to get."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan that contains the suite."] - #[doc = "* `suite_id`: ID of the test suite to which the test cases must be added."] - #[doc = "* `test_case_ids`: IDs of the test cases to add to the suite. Ids are specified in comma separated format."] - pub fn add( - &self, - organization: impl Into<String>, - project: impl Into<String>, - plan_id: i32, - suite_id: i32, - test_case_ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Model for updation of the properties of test case suite association."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan that contains the suite."] - #[doc = "* `suite_id`: ID of the test suite to which the test cases must be added."] - #[doc = "* `test_case_ids`: IDs of the test cases to add to the suite. Ids are specified in comma separated format."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::SuiteTestCaseUpdateModel>, - project: impl Into<String>, - plan_id: i32, - suite_id: i32, - test_case_ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan that contains the suite."] - #[doc = "* `suite_id`: ID of the suite to get."] - #[doc = "* `test_case_ids`: IDs of the test cases to remove from the suite."] - pub fn remove_test_cases_from_suite_url( - &self, - organization: impl Into<String>, - project: impl Into<String>, - plan_id: i32, - suite_id: i32, - test_case_ids: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SuiteTestCaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::SuiteTestCaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SuiteTestCaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::SuiteTestCaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SuiteTestCase> { - let bytes = self.0.into_body().collect().await?; - let body: models::SuiteTestCase = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id, - &this.test_case_ids - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SuiteTestCase>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::SuiteTestCase>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SuiteTestCaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::SuiteTestCaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id, - &this.test_case_ids - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SuiteTestCaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::SuiteTestCaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SuiteTestCaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::SuiteTestCaseList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::SuiteTestCaseUpdateModel, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_id: i32, - pub(crate) test_case_ids: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id, - &this.test_case_ids - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SuiteTestCaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::SuiteTestCaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove_test_cases_from_suite_url { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id, - &this.test_case_ids - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id, + &this.test_case_ids + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod result_retention_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get test result retention settings"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Update test result retention settings"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Test result retention settings details to be updated"] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::ResultRetentionSettings>, + project: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get test result retention settings"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - #[doc = "Update test result retention settings"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Test result retention settings details to be updated"] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::ResultRetentionSettings>, - project: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ResultRetentionSettings> { - let bytes = self.0.into_body().collect().await?; - let body: models::ResultRetentionSettings = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/resultretentionsettings", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ResultRetentionSettings>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ResultRetentionSettings>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ResultRetentionSettings> { - let bytes = self.0.into_body().collect().await?; - let body: models::ResultRetentionSettings = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ResultRetentionSettings, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/resultretentionsettings", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ResultRetentionSettings>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ResultRetentionSettings>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ResultRetentionSettings> { + let bytes = self.0.into_body().collect().await?; + let body: models::ResultRetentionSettings = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/resultretentionsettings", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ResultRetentionSettings>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ResultRetentionSettings>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ResultRetentionSettings> { + let bytes = self.0.into_body().collect().await?; + let body: models::ResultRetentionSettings = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ResultRetentionSettings, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/resultretentionsettings", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ResultRetentionSettings>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ResultRetentionSettings>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod test_history { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get history of a test method using TestHistoryQuery"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: TestHistoryQuery to get history"] + #[doc = "* `project`: Project ID or project name"] + pub fn query( + &self, + organization: impl Into<String>, + body: impl Into<models::TestHistoryQuery>, + project: impl Into<String>, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + pub mod query { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get history of a test method using TestHistoryQuery"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: TestHistoryQuery to get history"] - #[doc = "* `project`: Project ID or project name"] - pub fn query( - &self, - organization: impl Into<String>, - body: impl Into<models::TestHistoryQuery>, - project: impl Into<String>, - ) -> query::RequestBuilder { - query::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - } - pub mod query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestHistoryQuery> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestHistoryQuery = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestHistoryQuery, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Results/testhistory", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestHistoryQuery>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestHistoryQuery>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestHistoryQuery> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestHistoryQuery = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestHistoryQuery, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Results/testhistory", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestHistoryQuery>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestHistoryQuery>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod results { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get test results for a test run."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: Test run ID of test results to fetch."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: List of test results to add."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: Test run ID into which test results to add."] + pub fn add( + &self, + organization: impl Into<String>, + body: Vec<models::TestCaseResult>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: List of test results to update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: Test run ID whose test results to update."] + pub fn update( + &self, + organization: impl Into<String>, + body: Vec<models::TestCaseResult>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: Test run ID of a test result to fetch."] + #[doc = "* `test_case_result_id`: Test result ID."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get test results for a test run."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Test run ID of test results to fetch."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: List of test results to add."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Test run ID into which test results to add."] - pub fn add( - &self, - organization: impl Into<String>, - body: Vec<models::TestCaseResult>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: List of test results to update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Test run ID whose test results to update."] - pub fn update( - &self, - organization: impl Into<String>, - body: Vec<models::TestCaseResult>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Test run ID of a test result to fetch."] - #[doc = "* `test_case_result_id`: Test result ID."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestCaseResultList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) details_to_include: Option<String>, - pub(crate) skip: Option<i32>, - pub(crate) top: Option<i32>, - pub(crate) outcomes: Option<String>, - } - 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, details_to_include: impl Into<String>) -> Self { - self.details_to_include = Some(details_to_include.into()); - self - } - #[doc = "Number of test results to skip from beginning."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "Number of test results to return. Maximum is 1000 when details_to_include is None and 200 otherwise."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Comma separated list of test outcomes to filter test results."] - pub fn outcomes(mut self, outcomes: impl Into<String>) -> Self { - self.outcomes = Some(outcomes.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/results", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(details_to_include) = &this.details_to_include { - req.url_mut() - .query_pairs_mut() - .append_pair("detailsToInclude", details_to_include); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestCaseResultList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseResultList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestCaseResultList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::TestCaseResult>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/results", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestCaseResultList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseResultList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestCaseResultList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::TestCaseResult>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/results", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestCaseResultList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseResultList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestCaseResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseResult = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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<String>, - } - 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, details_to_include: impl Into<String>) -> Self { - self.details_to_include = Some(details_to_include.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/results/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.test_case_result_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(details_to_include) = &this.details_to_include { - req.url_mut() - .query_pairs_mut() - .append_pair("detailsToInclude", details_to_include); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestCaseResult>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseResult>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestCaseResultList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestCaseResultList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) details_to_include: Option<String>, + pub(crate) skip: Option<i32>, + pub(crate) top: Option<i32>, + pub(crate) outcomes: Option<String>, + } + 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, details_to_include: impl Into<String>) -> Self { + self.details_to_include = Some(details_to_include.into()); + self + } + #[doc = "Number of test results to skip from beginning."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Number of test results to return. Maximum is 1000 when details_to_include is None and 200 otherwise."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Comma separated list of test outcomes to filter test results."] + pub fn outcomes(mut self, outcomes: impl Into<String>) -> Self { + self.outcomes = Some(outcomes.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/results", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(details_to_include) = &this.details_to_include { + req + .url_mut() + .query_pairs_mut() + .append_pair("detailsToInclude", details_to_include); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestCaseResultList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseResultList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestCaseResultList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestCaseResultList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::TestCaseResult>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/results", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestCaseResultList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseResultList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestCaseResultList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestCaseResultList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::TestCaseResult>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/results", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestCaseResultList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseResultList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestCaseResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestCaseResult = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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<String>, + } + 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, details_to_include: impl Into<String>) -> Self { + self.details_to_include = Some(details_to_include.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/results/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.test_case_result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(details_to_include) = &this.details_to_include { + req + .url_mut() + .query_pairs_mut() + .append_pair("detailsToInclude", details_to_include); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestCaseResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod iterations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get iterations for a result"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the test run that contains the result."] + #[doc = "* `test_case_result_id`: ID of the test result that contains the iterations."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: ID of the test run that contains the result."] + #[doc = "* `test_case_result_id`: ID of the test result that contains the iterations."] + #[doc = "* `iteration_id`: Id of the test results Iteration."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get iterations for a result"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the test run that contains the result."] - #[doc = "* `test_case_result_id`: ID of the test result that contains the iterations."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: ID of the test run that contains the result."] - #[doc = "* `test_case_result_id`: ID of the test result that contains the iterations."] - #[doc = "* `iteration_id`: Id of the test results Iteration."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TestIterationDetailsModelList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestIterationDetailsModelList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/iterations", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.test_case_result_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestIterationDetailsModelList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestIterationDetailsModelList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestIterationDetailsModel> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestIterationDetailsModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) test_case_result_id: i32, - pub(crate) iteration_id: i32, - pub(crate) include_action_results: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/iterations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.test_case_result_id, - &this.iteration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestIterationDetailsModel>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestIterationDetailsModel>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestIterationDetailsModelList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestIterationDetailsModelList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/iterations", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.test_case_result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestIterationDetailsModelList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::TestIterationDetailsModelList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestIterationDetailsModel> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestIterationDetailsModel = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) test_case_result_id: i32, + pub(crate) iteration_id: i32, + pub(crate) include_action_results: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/iterations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.test_case_result_id, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestIterationDetailsModel>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestIterationDetailsModel>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod test_cases { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Delete a test case."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `test_case_id`: Id of test case to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + test_case_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_case_id, + } + } + } + pub mod delete { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Delete a test case."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `test_case_id`: Id of test case to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - test_case_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - test_case_id, - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) test_case_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/test/testcases/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.test_case_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) test_case_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/test/testcases/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.test_case_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod session { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of test sessions"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Test session details for creation"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::TestSession>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Test session details for update"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TestSession>, + project: impl Into<String>, + team: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of test sessions"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Test session details for creation"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::TestSession>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Test session details for update"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TestSession>, - project: impl Into<String>, - team: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - team: team.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestSessionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSessionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) period: Option<i32>, - pub(crate) all_sessions: Option<bool>, - pub(crate) include_all_properties: Option<bool>, - pub(crate) source: Option<String>, - pub(crate) include_only_completed_sessions: Option<bool>, - } - 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); - self - } - #[doc = "If false, returns test sessions for current user. Otherwise, it returns test sessions for all users"] - pub fn all_sessions(mut self, all_sessions: bool) -> Self { - self.all_sessions = Some(all_sessions); - self - } - #[doc = "If true, it returns all properties of the test sessions. Otherwise, it returns the skinny version."] - pub fn include_all_properties(mut self, include_all_properties: bool) -> Self { - self.include_all_properties = Some(include_all_properties); - self - } - #[doc = "Source of the test session."] - pub fn source(mut self, source: impl Into<String>) -> Self { - self.source = Some(source.into()); - self - } - #[doc = "If true, it returns test sessions in completed state. Otherwise, it returns test sessions for all states"] - pub fn include_only_completed_sessions( - mut self, - include_only_completed_sessions: bool, - ) -> Self { - self.include_only_completed_sessions = Some(include_only_completed_sessions); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/test/session", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestSessionList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestSessionList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestSession> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSession = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestSession, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/test/session", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestSession>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestSession>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestSession> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSession = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestSession, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/test/session", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestSession>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestSession>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestSessionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestSessionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) period: Option<i32>, + pub(crate) all_sessions: Option<bool>, + pub(crate) include_all_properties: Option<bool>, + pub(crate) source: Option<String>, + pub(crate) include_only_completed_sessions: Option<bool>, + } + 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); + self + } + #[doc = "If false, returns test sessions for current user. Otherwise, it returns test sessions for all users"] + pub fn all_sessions(mut self, all_sessions: bool) -> Self { + self.all_sessions = Some(all_sessions); + self + } + #[doc = "If true, it returns all properties of the test sessions. Otherwise, it returns the skinny version."] + pub fn include_all_properties(mut self, include_all_properties: bool) -> Self { + self.include_all_properties = Some(include_all_properties); + self + } + #[doc = "Source of the test session."] + pub fn source(mut self, source: impl Into<String>) -> Self { + self.source = Some(source.into()); + self + } + #[doc = "If true, it returns test sessions in completed state. Otherwise, it returns test sessions for all states"] + pub fn include_only_completed_sessions( + mut self, + include_only_completed_sessions: bool, + ) -> Self { + self.include_only_completed_sessions = Some(include_only_completed_sessions); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/test/session", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestSessionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestSessionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestSession> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestSession = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestSession, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/test/session", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestSession>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestSession>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestSession> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestSession = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestSession, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/test/session", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestSession>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestSession>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/test/models.rs b/azure_devops_rust_api/src/test/models.rs index efa5b6d4..91a676e5 100644 --- a/azure_devops_rust_api/src/test/models.rs +++ b/azure_devops_rust_api/src/test/models.rs @@ -8,11099 +8,11009 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AbortTestRunRequest { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub options: Option<i32>, - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub options: Option<i32>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl AbortTestRunRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AfnStrip { - #[doc = "Auxiliary Url to be consumed by MTM"] - #[serde( - rename = "auxiliaryUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub auxiliary_url: Option<String>, - #[doc = "Creation date of the AfnStrip"] - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[doc = "File name of the attachment created"] - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[doc = "ID of AfnStrip. This is same as the attachment ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Project identifier which contains AfnStrip"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<String>, - #[doc = "Service in which this attachment is stored in"] - #[serde(rename = "storedIn", default, skip_serializing_if = "Option::is_none")] - pub stored_in: Option<String>, - #[doc = "Afn strip stream."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stream: Option<String>, - #[doc = "ID of the testcase."] - #[serde( - rename = "testCaseId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_id: Option<i32>, - #[doc = "Backing test result id."] - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[doc = "Backing test run id."] - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, - #[doc = "Byte stream (uncompressed) length of Afn strip."] - #[serde( - rename = "unCompressedStreamLength", - default, - skip_serializing_if = "Option::is_none" - )] - pub un_compressed_stream_length: Option<i64>, - #[doc = "Url of the attachment created."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Auxiliary Url to be consumed by MTM"] + #[serde( + rename = "auxiliaryUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub auxiliary_url: Option<String>, + #[doc = "Creation date of the AfnStrip"] + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[doc = "File name of the attachment created"] + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[doc = "ID of AfnStrip. This is same as the attachment ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Project identifier which contains AfnStrip"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<String>, + #[doc = "Service in which this attachment is stored in"] + #[serde(rename = "storedIn", default, skip_serializing_if = "Option::is_none")] + pub stored_in: Option<String>, + #[doc = "Afn strip stream."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stream: Option<String>, + #[doc = "ID of the testcase."] + #[serde( + rename = "testCaseId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_id: Option<i32>, + #[doc = "Backing test result id."] + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[doc = "Backing test run id."] + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, + #[doc = "Byte stream (uncompressed) length of Afn strip."] + #[serde( + rename = "unCompressedStreamLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub un_compressed_stream_length: Option<i64>, + #[doc = "Url of the attachment created."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl AfnStrip { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedDataForResultTrend { - #[doc = "This is tests execution duration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[serde( - rename = "resultsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_by_outcome: Option<serde_json::Value>, - #[serde( - rename = "runSummaryByState", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary_by_state: Option<serde_json::Value>, - #[doc = ""] - #[serde( - rename = "testResultsContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_results_context: Option<TestResultsContext>, - #[serde( - rename = "totalTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_tests: Option<i32>, + #[doc = "This is tests execution duration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[serde( + rename = "resultsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_by_outcome: Option<serde_json::Value>, + #[serde( + rename = "runSummaryByState", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary_by_state: Option<serde_json::Value>, + #[doc = ""] + #[serde( + rename = "testResultsContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_results_context: Option<TestResultsContext>, + #[serde( + rename = "totalTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_tests: Option<i32>, } impl AggregatedDataForResultTrend { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Result deatils for a particular test result outcome."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedResultDetailsByOutcome { - #[doc = "Number of results for current outcome."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Time taken by results."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[doc = "Test result outcome"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<aggregated_result_details_by_outcome::Outcome>, - #[doc = "Number of results on rerun"] - #[serde( - rename = "rerunResultCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub rerun_result_count: Option<i32>, + #[doc = "Number of results for current outcome."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Time taken by results."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[doc = "Test result outcome"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<aggregated_result_details_by_outcome::Outcome>, + #[doc = "Number of results on rerun"] + #[serde( + rename = "rerunResultCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub rerun_result_count: Option<i32>, } impl AggregatedResultDetailsByOutcome { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod aggregated_result_details_by_outcome { - use super::*; - #[doc = "Test result outcome"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Outcome { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "none")] - None, - #[serde(rename = "passed")] - Passed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "inconclusive")] - Inconclusive, - #[serde(rename = "timeout")] - Timeout, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "blocked")] - Blocked, - #[serde(rename = "notExecuted")] - NotExecuted, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - #[serde(rename = "notApplicable")] - NotApplicable, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "notImpacted")] - NotImpacted, - } + use super::*; + #[doc = "Test result outcome"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Outcome { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "none")] + None, + #[serde(rename = "passed")] + Passed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "inconclusive")] + Inconclusive, + #[serde(rename = "timeout")] + Timeout, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "blocked")] + Blocked, + #[serde(rename = "notExecuted")] + NotExecuted, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + #[serde(rename = "notApplicable")] + NotApplicable, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "notImpacted")] + NotImpacted, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedResultsAnalysis { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[serde( - rename = "notReportedResultsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub not_reported_results_by_outcome: Option<serde_json::Value>, - #[doc = ""] - #[serde( - rename = "previousContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub previous_context: Option<TestResultsContext>, - #[serde( - rename = "resultsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_by_outcome: Option<serde_json::Value>, - #[doc = ""] - #[serde( - rename = "resultsDifference", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_difference: Option<AggregatedResultsDifference>, - #[serde( - rename = "runSummaryByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary_by_outcome: Option<serde_json::Value>, - #[serde( - rename = "runSummaryByState", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary_by_state: Option<serde_json::Value>, - #[serde( - rename = "totalTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_tests: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[serde( + rename = "notReportedResultsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub not_reported_results_by_outcome: Option<serde_json::Value>, + #[doc = ""] + #[serde( + rename = "previousContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub previous_context: Option<TestResultsContext>, + #[serde( + rename = "resultsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_by_outcome: Option<serde_json::Value>, + #[doc = ""] + #[serde( + rename = "resultsDifference", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_difference: Option<AggregatedResultsDifference>, + #[serde( + rename = "runSummaryByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary_by_outcome: Option<serde_json::Value>, + #[serde( + rename = "runSummaryByState", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary_by_state: Option<serde_json::Value>, + #[serde( + rename = "totalTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_tests: Option<i32>, } impl AggregatedResultsAnalysis { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedResultsByOutcome { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[serde( - rename = "groupByField", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_field: Option<String>, - #[serde( - rename = "groupByValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_value: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<aggregated_results_by_outcome::Outcome>, - #[serde( - rename = "rerunResultCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub rerun_result_count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[serde( + rename = "groupByField", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_field: Option<String>, + #[serde( + rename = "groupByValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_value: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<aggregated_results_by_outcome::Outcome>, + #[serde( + rename = "rerunResultCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub rerun_result_count: Option<i32>, } impl AggregatedResultsByOutcome { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod aggregated_results_by_outcome { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Outcome { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "none")] - None, - #[serde(rename = "passed")] - Passed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "inconclusive")] - Inconclusive, - #[serde(rename = "timeout")] - Timeout, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "blocked")] - Blocked, - #[serde(rename = "notExecuted")] - NotExecuted, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - #[serde(rename = "notApplicable")] - NotApplicable, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "notImpacted")] - NotImpacted, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Outcome { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "none")] + None, + #[serde(rename = "passed")] + Passed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "inconclusive")] + Inconclusive, + #[serde(rename = "timeout")] + Timeout, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "blocked")] + Blocked, + #[serde(rename = "notExecuted")] + NotExecuted, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + #[serde(rename = "notApplicable")] + NotApplicable, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "notImpacted")] + NotImpacted, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedResultsDifference { - #[serde( - rename = "increaseInDuration", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_duration: Option<String>, - #[serde( - rename = "increaseInFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_failures: Option<i32>, - #[serde( - rename = "increaseInNonImpactedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_non_impacted_tests: Option<i32>, - #[serde( - rename = "increaseInOtherTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_other_tests: Option<i32>, - #[serde( - rename = "increaseInPassedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_passed_tests: Option<i32>, - #[serde( - rename = "increaseInTotalTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_total_tests: Option<i32>, + #[serde( + rename = "increaseInDuration", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_duration: Option<String>, + #[serde( + rename = "increaseInFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_failures: Option<i32>, + #[serde( + rename = "increaseInNonImpactedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_non_impacted_tests: Option<i32>, + #[serde( + rename = "increaseInOtherTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_other_tests: Option<i32>, + #[serde( + rename = "increaseInPassedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_passed_tests: Option<i32>, + #[serde( + rename = "increaseInTotalTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_total_tests: Option<i32>, } impl AggregatedResultsDifference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedRunsByOutcome { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<aggregated_runs_by_outcome::Outcome>, - #[serde(rename = "runsCount", default, skip_serializing_if = "Option::is_none")] - pub runs_count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<aggregated_runs_by_outcome::Outcome>, + #[serde(rename = "runsCount", default, skip_serializing_if = "Option::is_none")] + pub runs_count: Option<i32>, } impl AggregatedRunsByOutcome { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod aggregated_runs_by_outcome { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Outcome { - #[serde(rename = "passed")] - Passed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "notImpacted")] - NotImpacted, - #[serde(rename = "others")] - Others, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Outcome { + #[serde(rename = "passed")] + Passed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "notImpacted")] + NotImpacted, + #[serde(rename = "others")] + Others, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedRunsByState { - #[serde( - rename = "resultsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_by_outcome: Option<serde_json::Value>, - #[serde(rename = "runsCount", default, skip_serializing_if = "Option::is_none")] - pub runs_count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<aggregated_runs_by_state::State>, + #[serde( + rename = "resultsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_by_outcome: Option<serde_json::Value>, + #[serde(rename = "runsCount", default, skip_serializing_if = "Option::is_none")] + pub runs_count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<aggregated_runs_by_state::State>, } impl AggregatedRunsByState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod aggregated_runs_by_state { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "notStarted")] - NotStarted, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "waiting")] - Waiting, - #[serde(rename = "needsInvestigation")] - NeedsInvestigation, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "notStarted")] + NotStarted, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "waiting")] + Waiting, + #[serde(rename = "needsInvestigation")] + NeedsInvestigation, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BatchResponse { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub responses: Vec<Response>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<batch_response::Status>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub responses: Vec<Response>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<batch_response::Status>, } impl BatchResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod batch_response { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "continue")] - Continue, - #[serde(rename = "switchingProtocols")] - SwitchingProtocols, - #[serde(rename = "ok")] - Ok, - #[serde(rename = "created")] - Created, - #[serde(rename = "accepted")] - Accepted, - #[serde(rename = "nonAuthoritativeInformation")] - NonAuthoritativeInformation, - #[serde(rename = "noContent")] - NoContent, - #[serde(rename = "resetContent")] - ResetContent, - #[serde(rename = "partialContent")] - PartialContent, - #[serde(rename = "multipleChoices")] - MultipleChoices, - #[serde(rename = "ambiguous")] - Ambiguous, - #[serde(rename = "movedPermanently")] - MovedPermanently, - #[serde(rename = "moved")] - Moved, - #[serde(rename = "found")] - Found, - #[serde(rename = "redirect")] - Redirect, - #[serde(rename = "seeOther")] - SeeOther, - #[serde(rename = "redirectMethod")] - RedirectMethod, - #[serde(rename = "notModified")] - NotModified, - #[serde(rename = "useProxy")] - UseProxy, - #[serde(rename = "unused")] - Unused, - #[serde(rename = "temporaryRedirect")] - TemporaryRedirect, - #[serde(rename = "redirectKeepVerb")] - RedirectKeepVerb, - #[serde(rename = "badRequest")] - BadRequest, - #[serde(rename = "unauthorized")] - Unauthorized, - #[serde(rename = "paymentRequired")] - PaymentRequired, - #[serde(rename = "forbidden")] - Forbidden, - #[serde(rename = "notFound")] - NotFound, - #[serde(rename = "methodNotAllowed")] - MethodNotAllowed, - #[serde(rename = "notAcceptable")] - NotAcceptable, - #[serde(rename = "proxyAuthenticationRequired")] - ProxyAuthenticationRequired, - #[serde(rename = "requestTimeout")] - RequestTimeout, - #[serde(rename = "conflict")] - Conflict, - #[serde(rename = "gone")] - Gone, - #[serde(rename = "lengthRequired")] - LengthRequired, - #[serde(rename = "preconditionFailed")] - PreconditionFailed, - #[serde(rename = "requestEntityTooLarge")] - RequestEntityTooLarge, - #[serde(rename = "requestUriTooLong")] - RequestUriTooLong, - #[serde(rename = "unsupportedMediaType")] - UnsupportedMediaType, - #[serde(rename = "requestedRangeNotSatisfiable")] - RequestedRangeNotSatisfiable, - #[serde(rename = "expectationFailed")] - ExpectationFailed, - #[serde(rename = "upgradeRequired")] - UpgradeRequired, - #[serde(rename = "internalServerError")] - InternalServerError, - #[serde(rename = "notImplemented")] - NotImplemented, - #[serde(rename = "badGateway")] - BadGateway, - #[serde(rename = "serviceUnavailable")] - ServiceUnavailable, - #[serde(rename = "gatewayTimeout")] - GatewayTimeout, - #[serde(rename = "httpVersionNotSupported")] - HttpVersionNotSupported, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "continue")] + Continue, + #[serde(rename = "switchingProtocols")] + SwitchingProtocols, + #[serde(rename = "ok")] + Ok, + #[serde(rename = "created")] + Created, + #[serde(rename = "accepted")] + Accepted, + #[serde(rename = "nonAuthoritativeInformation")] + NonAuthoritativeInformation, + #[serde(rename = "noContent")] + NoContent, + #[serde(rename = "resetContent")] + ResetContent, + #[serde(rename = "partialContent")] + PartialContent, + #[serde(rename = "multipleChoices")] + MultipleChoices, + #[serde(rename = "ambiguous")] + Ambiguous, + #[serde(rename = "movedPermanently")] + MovedPermanently, + #[serde(rename = "moved")] + Moved, + #[serde(rename = "found")] + Found, + #[serde(rename = "redirect")] + Redirect, + #[serde(rename = "seeOther")] + SeeOther, + #[serde(rename = "redirectMethod")] + RedirectMethod, + #[serde(rename = "notModified")] + NotModified, + #[serde(rename = "useProxy")] + UseProxy, + #[serde(rename = "unused")] + Unused, + #[serde(rename = "temporaryRedirect")] + TemporaryRedirect, + #[serde(rename = "redirectKeepVerb")] + RedirectKeepVerb, + #[serde(rename = "badRequest")] + BadRequest, + #[serde(rename = "unauthorized")] + Unauthorized, + #[serde(rename = "paymentRequired")] + PaymentRequired, + #[serde(rename = "forbidden")] + Forbidden, + #[serde(rename = "notFound")] + NotFound, + #[serde(rename = "methodNotAllowed")] + MethodNotAllowed, + #[serde(rename = "notAcceptable")] + NotAcceptable, + #[serde(rename = "proxyAuthenticationRequired")] + ProxyAuthenticationRequired, + #[serde(rename = "requestTimeout")] + RequestTimeout, + #[serde(rename = "conflict")] + Conflict, + #[serde(rename = "gone")] + Gone, + #[serde(rename = "lengthRequired")] + LengthRequired, + #[serde(rename = "preconditionFailed")] + PreconditionFailed, + #[serde(rename = "requestEntityTooLarge")] + RequestEntityTooLarge, + #[serde(rename = "requestUriTooLong")] + RequestUriTooLong, + #[serde(rename = "unsupportedMediaType")] + UnsupportedMediaType, + #[serde(rename = "requestedRangeNotSatisfiable")] + RequestedRangeNotSatisfiable, + #[serde(rename = "expectationFailed")] + ExpectationFailed, + #[serde(rename = "upgradeRequired")] + UpgradeRequired, + #[serde(rename = "internalServerError")] + InternalServerError, + #[serde(rename = "notImplemented")] + NotImplemented, + #[serde(rename = "badGateway")] + BadGateway, + #[serde(rename = "serviceUnavailable")] + ServiceUnavailable, + #[serde(rename = "gatewayTimeout")] + GatewayTimeout, + #[serde(rename = "httpVersionNotSupported")] + HttpVersionNotSupported, + } } #[doc = "BuildConfiguration Details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildConfiguration { - #[doc = "Branch name for which build is generated."] - #[serde( - rename = "branchName", - default, - skip_serializing_if = "Option::is_none" - )] - pub branch_name: Option<String>, - #[doc = "BuildDefinitionId for build."] - #[serde( - rename = "buildDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_definition_id: Option<i32>, - #[doc = "Build system."] - #[serde( - rename = "buildSystem", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_system: Option<String>, - #[doc = "Build Creation Date."] - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[doc = "Build flavor (eg Build/Release)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub flavor: Option<String>, - #[doc = "BuildConfiguration Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Build Number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub number: Option<String>, - #[doc = "BuildConfiguration Platform."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub platform: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, - #[doc = "Repository Guid for the Build."] - #[serde( - rename = "repositoryGuid", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_guid: Option<String>, - #[doc = "Repository Type (eg. TFSGit)."] - #[serde( - rename = "repositoryType", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_type: Option<String>, - #[doc = "Source Version(/first commit) for the build was triggered."] - #[serde( - rename = "sourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_version: Option<String>, - #[doc = "Target BranchName."] - #[serde( - rename = "targetBranchName", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_branch_name: Option<String>, - #[doc = "Build Uri."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, + #[doc = "Branch name for which build is generated."] + #[serde( + rename = "branchName", + default, + skip_serializing_if = "Option::is_none" + )] + pub branch_name: Option<String>, + #[doc = "BuildDefinitionId for build."] + #[serde( + rename = "buildDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_definition_id: Option<i32>, + #[doc = "Build system."] + #[serde( + rename = "buildSystem", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_system: Option<String>, + #[doc = "Build Creation Date."] + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[doc = "Build flavor (eg Build/Release)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub flavor: Option<String>, + #[doc = "BuildConfiguration Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Build Number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub number: Option<String>, + #[doc = "BuildConfiguration Platform."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub platform: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, + #[doc = "Repository Guid for the Build."] + #[serde( + rename = "repositoryGuid", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_guid: Option<String>, + #[doc = "Repository Type (eg. TFSGit)."] + #[serde( + rename = "repositoryType", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_type: Option<String>, + #[doc = "Source Version(/first commit) for the build was triggered."] + #[serde( + rename = "sourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_version: Option<String>, + #[doc = "Target BranchName."] + #[serde( + rename = "targetBranchName", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_branch_name: Option<String>, + #[doc = "Build Uri."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, } impl BuildConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Build Coverage Detail"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildCoverage { - #[doc = "Code Coverage File Url"] - #[serde( - rename = "codeCoverageFileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub code_coverage_file_url: Option<String>, - #[doc = "BuildConfiguration Details."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<BuildConfiguration>, - #[doc = "Last Error"] - #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] - pub last_error: Option<String>, - #[doc = "List of Modules"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub modules: Vec<ModuleCoverage>, - #[doc = "State"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, + #[doc = "Code Coverage File Url"] + #[serde( + rename = "codeCoverageFileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub code_coverage_file_url: Option<String>, + #[doc = "BuildConfiguration Details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<BuildConfiguration>, + #[doc = "Last Error"] + #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] + pub last_error: Option<String>, + #[doc = "List of Modules"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub modules: Vec<ModuleCoverage>, + #[doc = "State"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, } impl BuildCoverage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildCoverageList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BuildCoverage>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BuildCoverage>, } impl BuildCoverageList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to a build."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildReference { - #[doc = "Branch name."] - #[serde( - rename = "branchName", - default, - skip_serializing_if = "Option::is_none" - )] - pub branch_name: Option<String>, - #[doc = "Build system."] - #[serde( - rename = "buildSystem", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_system: Option<String>, - #[doc = "Build Definition ID."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "Build ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Build Number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub number: Option<String>, - #[doc = "Repository ID."] - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, - #[doc = "Build URI."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, + #[doc = "Branch name."] + #[serde( + rename = "branchName", + default, + skip_serializing_if = "Option::is_none" + )] + pub branch_name: Option<String>, + #[doc = "Build system."] + #[serde( + rename = "buildSystem", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_system: Option<String>, + #[doc = "Build Definition ID."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "Build ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Build Number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub number: Option<String>, + #[doc = "Repository ID."] + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, + #[doc = "Build URI."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, } impl BuildReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildReference2 { - #[serde( - rename = "branchName", - default, - skip_serializing_if = "Option::is_none" - )] - pub branch_name: Option<String>, - #[serde( - rename = "buildConfigurationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_configuration_id: Option<i32>, - #[serde( - rename = "buildDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_definition_id: Option<i32>, - #[serde( - rename = "buildDeleted", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_deleted: Option<bool>, - #[serde( - rename = "buildFlavor", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_flavor: Option<String>, - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option<i32>, - #[serde( - rename = "buildNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_number: Option<String>, - #[serde( - rename = "buildPlatform", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_platform: Option<String>, - #[serde( - rename = "buildSystem", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_system: Option<String>, - #[serde(rename = "buildUri", default, skip_serializing_if = "Option::is_none")] - pub build_uri: Option<String>, - #[serde( - rename = "coverageId", - default, - skip_serializing_if = "Option::is_none" - )] - pub coverage_id: Option<i32>, - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde(rename = "repoId", default, skip_serializing_if = "Option::is_none")] - pub repo_id: Option<String>, - #[serde(rename = "repoType", default, skip_serializing_if = "Option::is_none")] - pub repo_type: Option<String>, - #[serde( - rename = "sourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_version: Option<String>, + #[serde( + rename = "branchName", + default, + skip_serializing_if = "Option::is_none" + )] + pub branch_name: Option<String>, + #[serde( + rename = "buildConfigurationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_configuration_id: Option<i32>, + #[serde( + rename = "buildDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_definition_id: Option<i32>, + #[serde( + rename = "buildDeleted", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_deleted: Option<bool>, + #[serde( + rename = "buildFlavor", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_flavor: Option<String>, + #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] + pub build_id: Option<i32>, + #[serde( + rename = "buildNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_number: Option<String>, + #[serde( + rename = "buildPlatform", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_platform: Option<String>, + #[serde( + rename = "buildSystem", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_system: Option<String>, + #[serde(rename = "buildUri", default, skip_serializing_if = "Option::is_none")] + pub build_uri: Option<String>, + #[serde( + rename = "coverageId", + default, + skip_serializing_if = "Option::is_none" + )] + pub coverage_id: Option<i32>, + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde(rename = "repoId", default, skip_serializing_if = "Option::is_none")] + pub repo_id: Option<String>, + #[serde(rename = "repoType", default, skip_serializing_if = "Option::is_none")] + pub repo_type: Option<String>, + #[serde( + rename = "sourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_version: Option<String>, } impl BuildReference2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BulkResultUpdateRequest { - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub requests: Vec<ResultUpdateRequest>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub requests: Vec<ResultUpdateRequest>, } impl BulkResultUpdateRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Detail About Clone Operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneOperationInformation { - #[doc = "Clone Statistics Details."] - #[serde( - rename = "cloneStatistics", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_statistics: Option<CloneStatistics>, - #[doc = "If the operation is complete, the DateTime of completion. If operation is not complete, this is DateTime.MaxValue"] - #[serde( - rename = "completionDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completion_date: Option<time::OffsetDateTime>, - #[doc = "DateTime when the operation was started"] - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "destinationObject", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_object: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "destinationPlan", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_plan: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "destinationProject", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_project: Option<ShallowReference>, - #[doc = "If the operation has Failed, Message contains the reason for failure. Null otherwise."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "The ID of the operation"] - #[serde(rename = "opId", default, skip_serializing_if = "Option::is_none")] - pub op_id: Option<i32>, - #[doc = "The type of the object generated as a result of the Clone operation"] - #[serde( - rename = "resultObjectType", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_object_type: Option<clone_operation_information::ResultObjectType>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "sourceObject", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_object: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "sourcePlan", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_plan: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "sourceProject", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_project: Option<ShallowReference>, - #[doc = "Current state of the operation. When State reaches Succeeded or Failed, the operation is complete"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<clone_operation_information::State>, - #[doc = "Url for getting the clone information"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Clone Statistics Details."] + #[serde( + rename = "cloneStatistics", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_statistics: Option<CloneStatistics>, + #[doc = "If the operation is complete, the DateTime of completion. If operation is not complete, this is DateTime.MaxValue"] + #[serde( + rename = "completionDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completion_date: Option<time::OffsetDateTime>, + #[doc = "DateTime when the operation was started"] + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "destinationObject", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_object: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "destinationPlan", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_plan: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "destinationProject", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_project: Option<ShallowReference>, + #[doc = "If the operation has Failed, Message contains the reason for failure. Null otherwise."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "The ID of the operation"] + #[serde(rename = "opId", default, skip_serializing_if = "Option::is_none")] + pub op_id: Option<i32>, + #[doc = "The type of the object generated as a result of the Clone operation"] + #[serde( + rename = "resultObjectType", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_object_type: Option<clone_operation_information::ResultObjectType>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "sourceObject", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_object: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "sourcePlan", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_plan: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "sourceProject", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_project: Option<ShallowReference>, + #[doc = "Current state of the operation. When State reaches Succeeded or Failed, the operation is complete"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<clone_operation_information::State>, + #[doc = "Url for getting the clone information"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl CloneOperationInformation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod clone_operation_information { - use super::*; - #[doc = "The type of the object generated as a result of the Clone operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ResultObjectType { - #[serde(rename = "testSuite")] - TestSuite, - #[serde(rename = "testPlan")] - TestPlan, - } - #[doc = "Current state of the operation. When State reaches Succeeded or Failed, the operation is complete"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "failed")] - Failed, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "succeeded")] - Succeeded, - } + use super::*; + #[doc = "The type of the object generated as a result of the Clone operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ResultObjectType { + #[serde(rename = "testSuite")] + TestSuite, + #[serde(rename = "testPlan")] + TestPlan, + } + #[doc = "Current state of the operation. When State reaches Succeeded or Failed, the operation is complete"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "failed")] + Failed, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "succeeded")] + Succeeded, + } } #[doc = "Clone options for cloning the test suite."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneOptions { - #[doc = "If set to true requirements will be cloned"] - #[serde( - rename = "cloneRequirements", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_requirements: Option<bool>, - #[doc = "copy all suites from a source plan"] - #[serde( - rename = "copyAllSuites", - default, - skip_serializing_if = "Option::is_none" - )] - pub copy_all_suites: Option<bool>, - #[doc = "copy ancestor hierarchy"] - #[serde( - rename = "copyAncestorHierarchy", - default, - skip_serializing_if = "Option::is_none" - )] - pub copy_ancestor_hierarchy: Option<bool>, - #[doc = "Name of the workitem type of the clone"] - #[serde( - rename = "destinationWorkItemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_work_item_type: Option<String>, - #[doc = "Key value pairs where the key value is overridden by the value."] - #[serde( - rename = "overrideParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub override_parameters: Option<serde_json::Value>, - #[doc = "Comment on the link that will link the new clone test case to the original Set null for no comment"] - #[serde( - rename = "relatedLinkComment", - default, - skip_serializing_if = "Option::is_none" - )] - pub related_link_comment: Option<String>, + #[doc = "If set to true requirements will be cloned"] + #[serde( + rename = "cloneRequirements", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_requirements: Option<bool>, + #[doc = "copy all suites from a source plan"] + #[serde( + rename = "copyAllSuites", + default, + skip_serializing_if = "Option::is_none" + )] + pub copy_all_suites: Option<bool>, + #[doc = "copy ancestor hierarchy"] + #[serde( + rename = "copyAncestorHierarchy", + default, + skip_serializing_if = "Option::is_none" + )] + pub copy_ancestor_hierarchy: Option<bool>, + #[doc = "Name of the workitem type of the clone"] + #[serde( + rename = "destinationWorkItemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_work_item_type: Option<String>, + #[doc = "Key value pairs where the key value is overridden by the value."] + #[serde( + rename = "overrideParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub override_parameters: Option<serde_json::Value>, + #[doc = "Comment on the link that will link the new clone test case to the original Set null for no comment"] + #[serde( + rename = "relatedLinkComment", + default, + skip_serializing_if = "Option::is_none" + )] + pub related_link_comment: Option<String>, } impl CloneOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Clone Statistics Details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneStatistics { - #[doc = "Number of requirements cloned so far."] - #[serde( - rename = "clonedRequirementsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub cloned_requirements_count: Option<i32>, - #[doc = "Number of shared steps cloned so far."] - #[serde( - rename = "clonedSharedStepsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub cloned_shared_steps_count: Option<i32>, - #[doc = "Number of test cases cloned so far"] - #[serde( - rename = "clonedTestCasesCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub cloned_test_cases_count: Option<i32>, - #[doc = "Total number of requirements to be cloned"] - #[serde( - rename = "totalRequirementsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_requirements_count: Option<i32>, - #[doc = "Total number of test cases to be cloned"] - #[serde( - rename = "totalTestCasesCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_test_cases_count: Option<i32>, + #[doc = "Number of requirements cloned so far."] + #[serde( + rename = "clonedRequirementsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub cloned_requirements_count: Option<i32>, + #[doc = "Number of shared steps cloned so far."] + #[serde( + rename = "clonedSharedStepsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub cloned_shared_steps_count: Option<i32>, + #[doc = "Number of test cases cloned so far"] + #[serde( + rename = "clonedTestCasesCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub cloned_test_cases_count: Option<i32>, + #[doc = "Total number of requirements to be cloned"] + #[serde( + rename = "totalRequirementsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_requirements_count: Option<i32>, + #[doc = "Total number of test cases to be cloned"] + #[serde( + rename = "totalTestCasesCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_test_cases_count: Option<i32>, } impl CloneStatistics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneTestCaseOptions { - #[doc = "If set to true, include the attachments"] - #[serde( - rename = "includeAttachments", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_attachments: Option<bool>, - #[doc = "If set to true, include the links"] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[doc = "Comment on the link that will link the new clone test case to the original Set null for no comment"] - #[serde( - rename = "relatedLinkComment", - default, - skip_serializing_if = "Option::is_none" - )] - pub related_link_comment: Option<String>, + #[doc = "If set to true, include the attachments"] + #[serde( + rename = "includeAttachments", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_attachments: Option<bool>, + #[doc = "If set to true, include the links"] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[doc = "Comment on the link that will link the new clone test case to the original Set null for no comment"] + #[serde( + rename = "relatedLinkComment", + default, + skip_serializing_if = "Option::is_none" + )] + pub related_link_comment: Option<String>, } impl CloneTestCaseOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the build configuration (platform, flavor) and coverage data for the build"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CodeCoverageData { - #[doc = "Flavor of build for which data is retrieved/published"] - #[serde( - rename = "buildFlavor", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_flavor: Option<String>, - #[doc = "Platform of build for which data is retrieved/published"] - #[serde( - rename = "buildPlatform", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_platform: Option<String>, - #[doc = "List of coverage data for the build"] - #[serde( - rename = "coverageStats", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub coverage_stats: Vec<CodeCoverageStatistics>, + #[doc = "Flavor of build for which data is retrieved/published"] + #[serde( + rename = "buildFlavor", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_flavor: Option<String>, + #[doc = "Platform of build for which data is retrieved/published"] + #[serde( + rename = "buildPlatform", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_platform: Option<String>, + #[doc = "List of coverage data for the build"] + #[serde( + rename = "coverageStats", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub coverage_stats: Vec<CodeCoverageStatistics>, } impl CodeCoverageData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the code coverage statistics for a particular coverage label (modules, statements, blocks, etc.)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CodeCoverageStatistics { - #[doc = "Covered units"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub covered: Option<i32>, - #[doc = "Delta of coverage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub delta: Option<f64>, - #[doc = "Is delta valid"] - #[serde( - rename = "isDeltaAvailable", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_delta_available: Option<bool>, - #[doc = "Label of coverage data (\"Blocks\", \"Statements\", \"Modules\", etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub label: Option<String>, - #[doc = "Position of label"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub position: Option<i32>, - #[doc = "Total units"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total: Option<i32>, + #[doc = "Covered units"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub covered: Option<i32>, + #[doc = "Delta of coverage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub delta: Option<f64>, + #[doc = "Is delta valid"] + #[serde( + rename = "isDeltaAvailable", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_delta_available: Option<bool>, + #[doc = "Label of coverage data (\"Blocks\", \"Statements\", \"Modules\", etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option<String>, + #[doc = "Position of label"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub position: Option<i32>, + #[doc = "Total units"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total: Option<i32>, } impl CodeCoverageStatistics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the code coverage summary results Used to publish or retrieve code coverage summary against a build"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CodeCoverageSummary { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<ShallowReference>, - #[doc = "List of coverage data and details for the build"] - #[serde( - rename = "coverageData", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub coverage_data: Vec<CodeCoverageData>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "deltaBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub delta_build: Option<ShallowReference>, - #[doc = "Uri of build against which difference in coverage is computed"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<code_coverage_summary::Status>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<ShallowReference>, + #[doc = "List of coverage data and details for the build"] + #[serde( + rename = "coverageData", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub coverage_data: Vec<CodeCoverageData>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "deltaBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub delta_build: Option<ShallowReference>, + #[doc = "Uri of build against which difference in coverage is computed"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<code_coverage_summary::Status>, } impl CodeCoverageSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod code_coverage_summary { - use super::*; - #[doc = "Uri of build against which difference in coverage is computed"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "none")] - None, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "finalized")] - Finalized, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "updateRequestQueued")] - UpdateRequestQueued, - } + use super::*; + #[doc = "Uri of build against which difference in coverage is computed"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "none")] + None, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "finalized")] + Finalized, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "updateRequestQueued")] + UpdateRequestQueued, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CodeCoverageSummary2 { - #[serde( - rename = "buildConfigurationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_configuration_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub covered: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub label: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub position: Option<i32>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total: Option<i32>, + #[serde( + rename = "buildConfigurationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_configuration_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub covered: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub position: Option<i32>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total: Option<i32>, } impl CodeCoverageSummary2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Coverage2 { - #[serde( - rename = "coverageId", - default, - skip_serializing_if = "Option::is_none" - )] - pub coverage_id: Option<i32>, - #[serde( - rename = "dateCreated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_created: Option<time::OffsetDateTime>, - #[serde( - rename = "dateModified", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_modified: Option<time::OffsetDateTime>, - #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] - pub last_error: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, + #[serde( + rename = "coverageId", + default, + skip_serializing_if = "Option::is_none" + )] + pub coverage_id: Option<i32>, + #[serde( + rename = "dateCreated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_created: Option<time::OffsetDateTime>, + #[serde( + rename = "dateModified", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_modified: Option<time::OffsetDateTime>, + #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] + pub last_error: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, } impl Coverage2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CoverageStatistics { - #[serde( - rename = "blocksCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub blocks_covered: Option<i32>, - #[serde( - rename = "blocksNotCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub blocks_not_covered: Option<i32>, - #[serde( - rename = "linesCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub lines_covered: Option<i32>, - #[serde( - rename = "linesNotCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub lines_not_covered: Option<i32>, - #[serde( - rename = "linesPartiallyCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub lines_partially_covered: Option<i32>, + #[serde( + rename = "blocksCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub blocks_covered: Option<i32>, + #[serde( + rename = "blocksNotCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub blocks_not_covered: Option<i32>, + #[serde( + rename = "linesCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub lines_covered: Option<i32>, + #[serde( + rename = "linesNotCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub lines_not_covered: Option<i32>, + #[serde( + rename = "linesPartiallyCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub lines_partially_covered: Option<i32>, } impl CoverageStatistics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreateTestMessageLogEntryRequest { - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[serde( - rename = "testMessageLogEntry", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_message_log_entry: Vec<TestMessageLogEntry>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[serde( + rename = "testMessageLogEntry", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_message_log_entry: Vec<TestMessageLogEntry>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl CreateTestMessageLogEntryRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreateTestResultsRequest { - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<LegacyTestCaseResult>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<LegacyTestCaseResult>, } impl CreateTestResultsRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreateTestRunRequest { - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<LegacyTestCaseResult>, - #[doc = ""] - #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] - pub test_run: Option<LegacyTestRun>, - #[doc = ""] - #[serde( - rename = "testSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings: Option<LegacyTestSettings>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<LegacyTestCaseResult>, + #[doc = ""] + #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] + pub test_run: Option<LegacyTestRun>, + #[doc = ""] + #[serde( + rename = "testSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings: Option<LegacyTestSettings>, } impl CreateTestRunRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A custom field information. Allowed Key : Value pairs - ( AttemptId: int value, IsTestResultFlaky: bool)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomTestField { - #[doc = "Field Name."] - #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] - pub field_name: Option<String>, - #[doc = "Field value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = "Field Name."] + #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] + pub field_name: Option<String>, + #[doc = "Field value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl CustomTestField { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomTestFieldDefinition { - #[serde(rename = "fieldId", default, skip_serializing_if = "Option::is_none")] - pub field_id: Option<i32>, - #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] - pub field_name: Option<String>, - #[serde(rename = "fieldType", default, skip_serializing_if = "Option::is_none")] - pub field_type: Option<custom_test_field_definition::FieldType>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<custom_test_field_definition::Scope>, + #[serde(rename = "fieldId", default, skip_serializing_if = "Option::is_none")] + pub field_id: Option<i32>, + #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] + pub field_name: Option<String>, + #[serde(rename = "fieldType", default, skip_serializing_if = "Option::is_none")] + pub field_type: Option<custom_test_field_definition::FieldType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<custom_test_field_definition::Scope>, } impl CustomTestFieldDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod custom_test_field_definition { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum FieldType { - #[serde(rename = "bit")] - Bit, - #[serde(rename = "dateTime")] - DateTime, - #[serde(rename = "int")] - Int, - #[serde(rename = "float")] - Float, - #[serde(rename = "string")] - String, - #[serde(rename = "guid")] - Guid, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Scope { - #[serde(rename = "none")] - None, - #[serde(rename = "testRun")] - TestRun, - #[serde(rename = "testResult")] - TestResult, - #[serde(rename = "system")] - System, - #[serde(rename = "all")] - All, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum FieldType { + #[serde(rename = "bit")] + Bit, + #[serde(rename = "dateTime")] + DateTime, + #[serde(rename = "int")] + Int, + #[serde(rename = "float")] + Float, + #[serde(rename = "string")] + String, + #[serde(rename = "guid")] + Guid, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Scope { + #[serde(rename = "none")] + None, + #[serde(rename = "testRun")] + TestRun, + #[serde(rename = "testResult")] + TestResult, + #[serde(rename = "system")] + System, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DatedTestFieldData { - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<TestFieldData>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<TestFieldData>, } impl DatedTestFieldData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DefaultAfnStripBinding { - #[serde( - rename = "testCaseId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_id: Option<i32>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "testCaseId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_id: Option<i32>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl DefaultAfnStripBinding { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeleteTestRunRequest { - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[serde( - rename = "testRunIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_run_ids: Vec<i32>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[serde( + rename = "testRunIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_run_ids: Vec<i32>, } impl DeleteTestRunRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DownloadAttachmentsRequest { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ids: Vec<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub lengths: Vec<i64>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ids: Vec<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub lengths: Vec<i64>, } impl DownloadAttachmentsRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This is a temporary class to provide the details for the test run environment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DtlEnvironmentDetails { - #[serde( - rename = "csmContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub csm_content: Option<String>, - #[serde( - rename = "csmParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub csm_parameters: Option<String>, - #[serde( - rename = "subscriptionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_name: Option<String>, + #[serde( + rename = "csmContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub csm_content: Option<String>, + #[serde( + rename = "csmParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub csm_parameters: Option<String>, + #[serde( + rename = "subscriptionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_name: Option<String>, } impl DtlEnvironmentDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Failing since information of a test result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FailingSince { - #[doc = "Reference to a build."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<BuildReference>, - #[doc = "Time since failing(UTC)."] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date: Option<time::OffsetDateTime>, - #[doc = "Reference to a release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ReleaseReference>, + #[doc = "Reference to a build."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<BuildReference>, + #[doc = "Time since failing(UTC)."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date: Option<time::OffsetDateTime>, + #[doc = "Reference to a release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ReleaseReference>, } impl FailingSince { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FetchTestResultsRequest { - #[serde( - rename = "idAndRevs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub id_and_revs: Vec<TestCaseResultIdAndRev>, - #[serde( - rename = "includeActionResults", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_action_results: Option<bool>, - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, + #[serde( + rename = "idAndRevs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub id_and_revs: Vec<TestCaseResultIdAndRev>, + #[serde( + rename = "includeActionResults", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_action_results: Option<bool>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, } impl FetchTestResultsRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FetchTestResultsResponse { - #[serde( - rename = "actionResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub action_results: Vec<TestActionResult>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub attachments: Vec<TestResultAttachment>, - #[serde( - rename = "deletedIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub deleted_ids: Vec<LegacyTestCaseResultIdentifier>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<LegacyTestCaseResult>, - #[serde( - rename = "testParameters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_parameters: Vec<TestResultParameter>, + #[serde( + rename = "actionResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub action_results: Vec<TestActionResult>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub attachments: Vec<TestResultAttachment>, + #[serde( + rename = "deletedIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub deleted_ids: Vec<LegacyTestCaseResultIdentifier>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<LegacyTestCaseResult>, + #[serde( + rename = "testParameters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_parameters: Vec<TestResultParameter>, } impl FetchTestResultsResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FieldDetailsForTestResults { - #[doc = "Group by field name"] - #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] - pub field_name: Option<String>, - #[doc = "Group by field values"] - #[serde( - rename = "groupsForField", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub groups_for_field: Vec<serde_json::Value>, + #[doc = "Group by field name"] + #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] + pub field_name: Option<String>, + #[doc = "Group by field values"] + #[serde( + rename = "groupsForField", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub groups_for_field: Vec<serde_json::Value>, } impl FieldDetailsForTestResults { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FileCoverage { - #[doc = "List of line blocks along with their coverage status"] - #[serde( - rename = "lineBlocksCoverage", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub line_blocks_coverage: Vec<LineBlockCoverage>, - #[doc = "File path for which coverage information is sought for"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[doc = "List of line blocks along with their coverage status"] + #[serde( + rename = "lineBlocksCoverage", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub line_blocks_coverage: Vec<LineBlockCoverage>, + #[doc = "File path for which coverage information is sought for"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl FileCoverage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FileCoverageRequest { - #[serde(rename = "filePath", default, skip_serializing_if = "Option::is_none")] - pub file_path: Option<String>, - #[serde( - rename = "pullRequestBaseIterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_base_iteration_id: Option<i32>, - #[serde( - rename = "pullRequestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_id: Option<i32>, - #[serde( - rename = "pullRequestIterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_iteration_id: Option<i32>, - #[serde(rename = "repoId", default, skip_serializing_if = "Option::is_none")] - pub repo_id: Option<String>, + #[serde(rename = "filePath", default, skip_serializing_if = "Option::is_none")] + pub file_path: Option<String>, + #[serde( + rename = "pullRequestBaseIterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_base_iteration_id: Option<i32>, + #[serde( + rename = "pullRequestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_id: Option<i32>, + #[serde( + rename = "pullRequestIterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_iteration_id: Option<i32>, + #[serde(rename = "repoId", default, skip_serializing_if = "Option::is_none")] + pub repo_id: Option<String>, } impl FileCoverageRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FilterPointQuery { - #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] - pub plan_id: Option<i32>, - #[serde( - rename = "pointIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub point_ids: Vec<i32>, - #[serde( - rename = "pointOutcome", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub point_outcome: Vec<String>, - #[serde( - rename = "resultState", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub result_state: Vec<String>, + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option<i32>, + #[serde( + rename = "pointIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub point_ids: Vec<i32>, + #[serde( + rename = "pointOutcome", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub point_outcome: Vec<String>, + #[serde( + rename = "resultState", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub result_state: Vec<String>, } impl FilterPointQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FlakyDetection { - #[doc = ""] - #[serde( - rename = "flakyDetectionPipelines", - default, - skip_serializing_if = "Option::is_none" - )] - pub flaky_detection_pipelines: Option<FlakyDetectionPipelines>, - #[doc = "FlakyDetectionType defines Detection type i.e. 1. System or 2. Manual."] - #[serde( - rename = "flakyDetectionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub flaky_detection_type: Option<flaky_detection::FlakyDetectionType>, + #[doc = ""] + #[serde( + rename = "flakyDetectionPipelines", + default, + skip_serializing_if = "Option::is_none" + )] + pub flaky_detection_pipelines: Option<FlakyDetectionPipelines>, + #[doc = "FlakyDetectionType defines Detection type i.e. 1. System or 2. Manual."] + #[serde( + rename = "flakyDetectionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub flaky_detection_type: Option<flaky_detection::FlakyDetectionType>, } impl FlakyDetection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod flaky_detection { - use super::*; - #[doc = "FlakyDetectionType defines Detection type i.e. 1. System or 2. Manual."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum FlakyDetectionType { - #[serde(rename = "custom")] - Custom, - #[serde(rename = "system")] - System, - } + use super::*; + #[doc = "FlakyDetectionType defines Detection type i.e. 1. System or 2. Manual."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum FlakyDetectionType { + #[serde(rename = "custom")] + Custom, + #[serde(rename = "system")] + System, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FlakyDetectionPipelines { - #[doc = "AllowedPipelines - List All Pipelines allowed for detection."] - #[serde( - rename = "allowedPipelines", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub allowed_pipelines: Vec<i32>, - #[doc = "IsAllPipelinesAllowed if users configure all system's pipelines."] - #[serde( - rename = "isAllPipelinesAllowed", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_all_pipelines_allowed: Option<bool>, + #[doc = "AllowedPipelines - List All Pipelines allowed for detection."] + #[serde( + rename = "allowedPipelines", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub allowed_pipelines: Vec<i32>, + #[doc = "IsAllPipelinesAllowed if users configure all system's pipelines."] + #[serde( + rename = "isAllPipelinesAllowed", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_all_pipelines_allowed: Option<bool>, } impl FlakyDetectionPipelines { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FlakySettings { - #[doc = ""] - #[serde( - rename = "flakyDetection", - default, - skip_serializing_if = "Option::is_none" - )] - pub flaky_detection: Option<FlakyDetection>, - #[doc = "FlakyInSummaryReport defines flaky data should show in summary report or not."] - #[serde( - rename = "flakyInSummaryReport", - default, - skip_serializing_if = "Option::is_none" - )] - pub flaky_in_summary_report: Option<bool>, - #[doc = "IsFlakyBugCreated defines if there is any bug that has been created with flaky testresult."] - #[serde( - rename = "isFlakyBugCreated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_flaky_bug_created: Option<bool>, - #[doc = "ManualMarkUnmarkFlaky defines manual marking unmarking of flaky testcase."] - #[serde( - rename = "manualMarkUnmarkFlaky", - default, - skip_serializing_if = "Option::is_none" - )] - pub manual_mark_unmark_flaky: Option<bool>, + #[doc = ""] + #[serde( + rename = "flakyDetection", + default, + skip_serializing_if = "Option::is_none" + )] + pub flaky_detection: Option<FlakyDetection>, + #[doc = "FlakyInSummaryReport defines flaky data should show in summary report or not."] + #[serde( + rename = "flakyInSummaryReport", + default, + skip_serializing_if = "Option::is_none" + )] + pub flaky_in_summary_report: Option<bool>, + #[doc = "IsFlakyBugCreated defines if there is any bug that has been created with flaky testresult."] + #[serde( + rename = "isFlakyBugCreated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_flaky_bug_created: Option<bool>, + #[doc = "ManualMarkUnmarkFlaky defines manual marking unmarking of flaky testcase."] + #[serde( + rename = "manualMarkUnmarkFlaky", + default, + skip_serializing_if = "Option::is_none" + )] + pub manual_mark_unmark_flaky: Option<bool>, } impl FlakySettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FunctionCoverage { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub class: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option<String>, - #[serde( - rename = "sourceFile", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_file: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub statistics: Option<CoverageStatistics>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub class: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub namespace: Option<String>, + #[serde( + rename = "sourceFile", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_file: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub statistics: Option<CoverageStatistics>, } impl FunctionCoverage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FunctionCoverage2 { - #[serde( - rename = "blocksCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub blocks_covered: Option<i32>, - #[serde( - rename = "blocksNotCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub blocks_not_covered: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub class: Option<String>, - #[serde( - rename = "coverageId", - default, - skip_serializing_if = "Option::is_none" - )] - pub coverage_id: Option<i32>, - #[serde( - rename = "functionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub function_id: Option<i32>, - #[serde( - rename = "linesCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub lines_covered: Option<i32>, - #[serde( - rename = "linesNotCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub lines_not_covered: Option<i32>, - #[serde( - rename = "linesPartiallyCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub lines_partially_covered: Option<i32>, - #[serde(rename = "moduleId", default, skip_serializing_if = "Option::is_none")] - pub module_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option<String>, - #[serde( - rename = "sourceFile", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_file: Option<String>, + #[serde( + rename = "blocksCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub blocks_covered: Option<i32>, + #[serde( + rename = "blocksNotCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub blocks_not_covered: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub class: Option<String>, + #[serde( + rename = "coverageId", + default, + skip_serializing_if = "Option::is_none" + )] + pub coverage_id: Option<i32>, + #[serde( + rename = "functionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub function_id: Option<i32>, + #[serde( + rename = "linesCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub lines_covered: Option<i32>, + #[serde( + rename = "linesNotCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub lines_not_covered: Option<i32>, + #[serde( + rename = "linesPartiallyCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub lines_partially_covered: Option<i32>, + #[serde(rename = "moduleId", default, skip_serializing_if = "Option::is_none")] + pub module_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub namespace: Option<String>, + #[serde( + rename = "sourceFile", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_file: Option<String>, } impl FunctionCoverage2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HttpPostedTcmAttachment { - #[serde( - rename = "attachmentContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub attachment_content: Option<String>, - #[serde( - rename = "contentLength", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_length: Option<i32>, - #[serde( - rename = "contentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_type: Option<String>, - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, + #[serde( + rename = "attachmentContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub attachment_content: Option<String>, + #[serde( + rename = "contentLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_length: Option<i32>, + #[serde( + rename = "contentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_type: Option<String>, + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, } impl HttpPostedTcmAttachment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, + } + } } #[doc = "Job in pipeline. This is related to matrixing in YAML."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobReference { - #[doc = "Attempt number of the job"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character."] - #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] - pub job_name: Option<String>, + #[doc = "Attempt number of the job"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character."] + #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] + pub job_name: Option<String>, } impl JobReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Last result details of test point."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LastResultDetails { - #[doc = "Completed date of last result."] - #[serde( - rename = "dateCompleted", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_completed: Option<time::OffsetDateTime>, - #[doc = "Duration of the last result in milliseconds."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<i64>, - #[doc = ""] - #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] - pub run_by: Option<IdentityRef>, + #[doc = "Completed date of last result."] + #[serde( + rename = "dateCompleted", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_completed: Option<time::OffsetDateTime>, + #[doc = "Duration of the last result in milliseconds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<i64>, + #[doc = ""] + #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] + pub run_by: Option<IdentityRef>, } impl LastResultDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LegacyBuildConfiguration { - #[serde( - rename = "branchName", - default, - skip_serializing_if = "Option::is_none" - )] - pub branch_name: Option<String>, - #[serde( - rename = "buildConfigurationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_configuration_id: Option<i32>, - #[serde( - rename = "buildDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_definition_id: Option<i32>, - #[serde( - rename = "buildDefinitionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_definition_name: Option<String>, - #[serde( - rename = "buildFlavor", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_flavor: Option<String>, - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option<i32>, - #[serde( - rename = "buildNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_number: Option<String>, - #[serde( - rename = "buildPlatform", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_platform: Option<String>, - #[serde( - rename = "buildQuality", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_quality: Option<String>, - #[serde( - rename = "buildSystem", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_system: Option<String>, - #[serde(rename = "buildUri", default, skip_serializing_if = "Option::is_none")] - pub build_uri: Option<String>, - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[serde( - rename = "oldBuildConfigurationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub old_build_configuration_id: Option<i32>, - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, - #[serde( - rename = "repositoryType", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_type: Option<String>, - #[serde( - rename = "sourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_version: Option<String>, - #[serde( - rename = "teamProjectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project_name: Option<String>, + #[serde( + rename = "branchName", + default, + skip_serializing_if = "Option::is_none" + )] + pub branch_name: Option<String>, + #[serde( + rename = "buildConfigurationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_configuration_id: Option<i32>, + #[serde( + rename = "buildDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_definition_id: Option<i32>, + #[serde( + rename = "buildDefinitionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_definition_name: Option<String>, + #[serde( + rename = "buildFlavor", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_flavor: Option<String>, + #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] + pub build_id: Option<i32>, + #[serde( + rename = "buildNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_number: Option<String>, + #[serde( + rename = "buildPlatform", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_platform: Option<String>, + #[serde( + rename = "buildQuality", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_quality: Option<String>, + #[serde( + rename = "buildSystem", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_system: Option<String>, + #[serde(rename = "buildUri", default, skip_serializing_if = "Option::is_none")] + pub build_uri: Option<String>, + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[serde( + rename = "oldBuildConfigurationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub old_build_configuration_id: Option<i32>, + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, + #[serde( + rename = "repositoryType", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_type: Option<String>, + #[serde( + rename = "sourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_version: Option<String>, + #[serde( + rename = "teamProjectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project_name: Option<String>, } impl LegacyBuildConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LegacyReleaseReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[serde( - rename = "environmentCreationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub environment_creation_date: Option<time::OffsetDateTime>, - #[serde( - rename = "primaryArtifactBuildId", - default, - skip_serializing_if = "Option::is_none" - )] - pub primary_artifact_build_id: Option<i32>, - #[serde( - rename = "primaryArtifactProjectId", - default, - skip_serializing_if = "Option::is_none" - )] - pub primary_artifact_project_id: Option<String>, - #[serde( - rename = "primaryArtifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub primary_artifact_type: Option<String>, - #[serde( - rename = "releaseCreationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub release_creation_date: Option<time::OffsetDateTime>, - #[serde( - rename = "releaseDefId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_def_id: Option<i32>, - #[serde( - rename = "releaseEnvDefId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_def_id: Option<i32>, - #[serde( - rename = "releaseEnvId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_id: Option<i32>, - #[serde( - rename = "releaseEnvName", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_name: Option<String>, - #[serde( - rename = "releaseEnvUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_uri: Option<String>, - #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] - pub release_id: Option<i32>, - #[serde( - rename = "releaseName", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_name: Option<String>, - #[serde( - rename = "releaseRefId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_ref_id: Option<i32>, - #[serde( - rename = "releaseUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_uri: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[serde( + rename = "environmentCreationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub environment_creation_date: Option<time::OffsetDateTime>, + #[serde( + rename = "primaryArtifactBuildId", + default, + skip_serializing_if = "Option::is_none" + )] + pub primary_artifact_build_id: Option<i32>, + #[serde( + rename = "primaryArtifactProjectId", + default, + skip_serializing_if = "Option::is_none" + )] + pub primary_artifact_project_id: Option<String>, + #[serde( + rename = "primaryArtifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub primary_artifact_type: Option<String>, + #[serde( + rename = "releaseCreationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub release_creation_date: Option<time::OffsetDateTime>, + #[serde( + rename = "releaseDefId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_def_id: Option<i32>, + #[serde( + rename = "releaseEnvDefId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_def_id: Option<i32>, + #[serde( + rename = "releaseEnvId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_id: Option<i32>, + #[serde( + rename = "releaseEnvName", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_name: Option<String>, + #[serde( + rename = "releaseEnvUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_uri: Option<String>, + #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] + pub release_id: Option<i32>, + #[serde( + rename = "releaseName", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_name: Option<String>, + #[serde( + rename = "releaseRefId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_ref_id: Option<i32>, + #[serde( + rename = "releaseUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_uri: Option<String>, } impl LegacyReleaseReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LegacyTestCaseResult { - #[serde( - rename = "afnStripId", - default, - skip_serializing_if = "Option::is_none" - )] - pub afn_strip_id: Option<i32>, - #[serde(rename = "areaId", default, skip_serializing_if = "Option::is_none")] - pub area_id: Option<i32>, - #[serde(rename = "areaUri", default, skip_serializing_if = "Option::is_none")] - pub area_uri: Option<String>, - #[serde( - rename = "automatedTestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_id: Option<String>, - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[serde( - rename = "automatedTestStorage", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_storage: Option<String>, - #[serde( - rename = "automatedTestType", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_type: Option<String>, - #[serde( - rename = "automatedTestTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_type_id: Option<String>, - #[serde( - rename = "buildNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_number: Option<String>, - #[doc = ""] - #[serde( - rename = "buildReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_reference: Option<LegacyBuildConfiguration>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - rename = "computerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub computer_name: Option<String>, - #[serde( - rename = "configurationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub configuration_id: Option<i32>, - #[serde( - rename = "configurationName", - default, - skip_serializing_if = "Option::is_none" - )] - pub configuration_name: Option<String>, - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[serde( - rename = "customFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub custom_fields: Vec<TestExtensionField>, - #[serde( - rename = "dateCompleted", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_completed: Option<time::OffsetDateTime>, - #[serde( - rename = "dateStarted", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_started: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<i64>, - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "Failing since information of a test result."] - #[serde( - rename = "failingSince", - default, - skip_serializing_if = "Option::is_none" - )] - pub failing_since: Option<FailingSince>, - #[serde( - rename = "failureType", - default, - skip_serializing_if = "Option::is_none" - )] - pub failure_type: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<LegacyTestCaseResultIdentifier>, - #[serde(rename = "isRerun", default, skip_serializing_if = "Option::is_none")] - pub is_rerun: Option<bool>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<String>, - #[serde( - rename = "lastUpdatedByName", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[serde(rename = "ownerName", default, skip_serializing_if = "Option::is_none")] - pub owner_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option<String>, - #[doc = ""] - #[serde( - rename = "releaseReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_reference: Option<LegacyReleaseReference>, - #[serde( - rename = "resetCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub reset_count: Option<i32>, - #[serde( - rename = "resolutionStateId", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_state_id: Option<i32>, - #[serde( - rename = "resultGroupType", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_group_type: Option<legacy_test_case_result::ResultGroupType>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] - pub run_by: Option<String>, - #[serde(rename = "runByName", default, skip_serializing_if = "Option::is_none")] - pub run_by_name: Option<String>, - #[serde( - rename = "sequenceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub sequence_id: Option<i32>, - #[doc = ""] - #[serde( - rename = "stackTrace", - default, - skip_serializing_if = "Option::is_none" - )] - pub stack_trace: Option<TestExtensionField>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde( - rename = "subResultCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub sub_result_count: Option<i32>, - #[serde(rename = "suiteName", default, skip_serializing_if = "Option::is_none")] - pub suite_name: Option<String>, - #[serde( - rename = "testCaseArea", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_area: Option<String>, - #[serde( - rename = "testCaseAreaUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_area_uri: Option<String>, - #[serde( - rename = "testCaseId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_id: Option<i32>, - #[serde( - rename = "testCaseReferenceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_reference_id: Option<i32>, - #[serde( - rename = "testCaseRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_revision: Option<i32>, - #[serde( - rename = "testCaseTitle", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_title: Option<String>, - #[serde( - rename = "testPlanId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_plan_id: Option<i32>, - #[serde( - rename = "testPointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_point_id: Option<i32>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, - #[serde( - rename = "testRunTitle", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_run_title: Option<String>, - #[serde( - rename = "testSuiteId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_suite_id: Option<i32>, + #[serde( + rename = "afnStripId", + default, + skip_serializing_if = "Option::is_none" + )] + pub afn_strip_id: Option<i32>, + #[serde(rename = "areaId", default, skip_serializing_if = "Option::is_none")] + pub area_id: Option<i32>, + #[serde(rename = "areaUri", default, skip_serializing_if = "Option::is_none")] + pub area_uri: Option<String>, + #[serde( + rename = "automatedTestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_id: Option<String>, + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[serde( + rename = "automatedTestStorage", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_storage: Option<String>, + #[serde( + rename = "automatedTestType", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_type: Option<String>, + #[serde( + rename = "automatedTestTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_type_id: Option<String>, + #[serde( + rename = "buildNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_number: Option<String>, + #[doc = ""] + #[serde( + rename = "buildReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_reference: Option<LegacyBuildConfiguration>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + rename = "computerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub computer_name: Option<String>, + #[serde( + rename = "configurationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub configuration_id: Option<i32>, + #[serde( + rename = "configurationName", + default, + skip_serializing_if = "Option::is_none" + )] + pub configuration_name: Option<String>, + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[serde( + rename = "customFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub custom_fields: Vec<TestExtensionField>, + #[serde( + rename = "dateCompleted", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_completed: Option<time::OffsetDateTime>, + #[serde( + rename = "dateStarted", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_started: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<i64>, + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "Failing since information of a test result."] + #[serde( + rename = "failingSince", + default, + skip_serializing_if = "Option::is_none" + )] + pub failing_since: Option<FailingSince>, + #[serde( + rename = "failureType", + default, + skip_serializing_if = "Option::is_none" + )] + pub failure_type: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<LegacyTestCaseResultIdentifier>, + #[serde(rename = "isRerun", default, skip_serializing_if = "Option::is_none")] + pub is_rerun: Option<bool>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<String>, + #[serde( + rename = "lastUpdatedByName", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[serde(rename = "ownerName", default, skip_serializing_if = "Option::is_none")] + pub owner_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub priority: Option<String>, + #[doc = ""] + #[serde( + rename = "releaseReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_reference: Option<LegacyReleaseReference>, + #[serde( + rename = "resetCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub reset_count: Option<i32>, + #[serde( + rename = "resolutionStateId", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_state_id: Option<i32>, + #[serde( + rename = "resultGroupType", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_group_type: Option<legacy_test_case_result::ResultGroupType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] + pub run_by: Option<String>, + #[serde(rename = "runByName", default, skip_serializing_if = "Option::is_none")] + pub run_by_name: Option<String>, + #[serde( + rename = "sequenceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub sequence_id: Option<i32>, + #[doc = ""] + #[serde( + rename = "stackTrace", + default, + skip_serializing_if = "Option::is_none" + )] + pub stack_trace: Option<TestExtensionField>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde( + rename = "subResultCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub sub_result_count: Option<i32>, + #[serde(rename = "suiteName", default, skip_serializing_if = "Option::is_none")] + pub suite_name: Option<String>, + #[serde( + rename = "testCaseArea", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_area: Option<String>, + #[serde( + rename = "testCaseAreaUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_area_uri: Option<String>, + #[serde( + rename = "testCaseId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_id: Option<i32>, + #[serde( + rename = "testCaseReferenceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_reference_id: Option<i32>, + #[serde( + rename = "testCaseRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_revision: Option<i32>, + #[serde( + rename = "testCaseTitle", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_title: Option<String>, + #[serde( + rename = "testPlanId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_plan_id: Option<i32>, + #[serde( + rename = "testPointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_point_id: Option<i32>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, + #[serde( + rename = "testRunTitle", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_run_title: Option<String>, + #[serde( + rename = "testSuiteId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_suite_id: Option<i32>, } impl LegacyTestCaseResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod legacy_test_case_result { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ResultGroupType { - #[serde(rename = "none")] - None, - #[serde(rename = "rerun")] - Rerun, - #[serde(rename = "dataDriven")] - DataDriven, - #[serde(rename = "orderedTest")] - OrderedTest, - #[serde(rename = "generic")] - Generic, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ResultGroupType { + #[serde(rename = "none")] + None, + #[serde(rename = "rerun")] + Rerun, + #[serde(rename = "dataDriven")] + DataDriven, + #[serde(rename = "orderedTest")] + OrderedTest, + #[serde(rename = "generic")] + Generic, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LegacyTestCaseResultIdentifier { - #[serde(rename = "areaUri", default, skip_serializing_if = "Option::is_none")] - pub area_uri: Option<String>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde(rename = "areaUri", default, skip_serializing_if = "Option::is_none")] + pub area_uri: Option<String>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl LegacyTestCaseResultIdentifier { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LegacyTestRun { - #[serde(rename = "bugsCount", default, skip_serializing_if = "Option::is_none")] - pub bugs_count: Option<i32>, - #[serde( - rename = "buildConfigurationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_configuration_id: Option<i32>, - #[serde( - rename = "buildFlavor", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_flavor: Option<String>, - #[serde( - rename = "buildNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_number: Option<String>, - #[serde( - rename = "buildPlatform", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_platform: Option<String>, - #[doc = ""] - #[serde( - rename = "buildReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_reference: Option<LegacyBuildConfiguration>, - #[serde(rename = "buildUri", default, skip_serializing_if = "Option::is_none")] - pub build_uri: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - rename = "completeDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub complete_date: Option<time::OffsetDateTime>, - #[serde( - rename = "configurationIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub configuration_ids: Vec<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub controller: Option<String>, - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[serde( - rename = "csmContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub csm_content: Option<String>, - #[serde( - rename = "csmParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub csm_parameters: Option<String>, - #[serde( - rename = "customFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub custom_fields: Vec<TestExtensionField>, - #[serde( - rename = "dropLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub drop_location: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlAutEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_aut_environment: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlTestEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_test_environment: Option<ShallowReference>, - #[serde( - rename = "dueDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub due_date: Option<time::OffsetDateTime>, - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "This class is used to provide the filters used for discovery"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option<RunFilter>, - #[serde( - rename = "incompleteTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub incomplete_tests: Option<i32>, - #[serde( - rename = "isAutomated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_automated: Option<bool>, - #[serde(rename = "isBvt", default, skip_serializing_if = "Option::is_none")] - pub is_bvt: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub iteration: Option<String>, - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<String>, - #[serde( - rename = "lastUpdatedByName", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by_name: Option<String>, - #[serde( - rename = "legacySharePath", - default, - skip_serializing_if = "Option::is_none" - )] - pub legacy_share_path: Option<String>, - #[serde( - rename = "notApplicableTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub not_applicable_tests: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[serde(rename = "ownerName", default, skip_serializing_if = "Option::is_none")] - pub owner_name: Option<String>, - #[serde( - rename = "passedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub passed_tests: Option<i32>, - #[serde( - rename = "postProcessState", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_process_state: Option<String>, - #[serde( - rename = "publicTestSettingsId", - default, - skip_serializing_if = "Option::is_none" - )] - pub public_test_settings_id: Option<i32>, - #[serde( - rename = "releaseEnvironmentUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment_uri: Option<String>, - #[doc = ""] - #[serde( - rename = "releaseReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_reference: Option<LegacyReleaseReference>, - #[serde( - rename = "releaseUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_uri: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[serde( - rename = "rowVersion", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub row_version: Vec<String>, - #[serde( - rename = "runHasDtlEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_has_dtl_environment: Option<bool>, - #[serde( - rename = "runTimeout", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_timeout: Option<String>, - #[serde( - rename = "serviceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub service_version: Option<String>, - #[serde( - rename = "sourceWorkflow", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_workflow: Option<String>, - #[serde( - rename = "startDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde( - rename = "subscriptionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub substate: Option<String>, - #[serde( - rename = "teamProject", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project: Option<String>, - #[serde( - rename = "teamProjectUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project_uri: Option<String>, - #[serde( - rename = "testConfigurationsMapping", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_configurations_mapping: Option<String>, - #[serde( - rename = "testEnvironmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_environment_id: Option<String>, - #[serde( - rename = "testMessageLogEntries", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_message_log_entries: Vec<TestMessageLogDetails>, - #[serde( - rename = "testMessageLogId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_message_log_id: Option<i32>, - #[serde( - rename = "testPlanId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_plan_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, - #[serde( - rename = "testRunStatistics", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_run_statistics: Vec<LegacyTestRunStatistic>, - #[serde( - rename = "testSettingsId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[serde( - rename = "totalTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_tests: Option<i32>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[serde( - rename = "unanalyzedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub unanalyzed_tests: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i32>, + #[serde(rename = "bugsCount", default, skip_serializing_if = "Option::is_none")] + pub bugs_count: Option<i32>, + #[serde( + rename = "buildConfigurationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_configuration_id: Option<i32>, + #[serde( + rename = "buildFlavor", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_flavor: Option<String>, + #[serde( + rename = "buildNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_number: Option<String>, + #[serde( + rename = "buildPlatform", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_platform: Option<String>, + #[doc = ""] + #[serde( + rename = "buildReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_reference: Option<LegacyBuildConfiguration>, + #[serde(rename = "buildUri", default, skip_serializing_if = "Option::is_none")] + pub build_uri: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + rename = "completeDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub complete_date: Option<time::OffsetDateTime>, + #[serde( + rename = "configurationIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub configuration_ids: Vec<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub controller: Option<String>, + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[serde( + rename = "csmContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub csm_content: Option<String>, + #[serde( + rename = "csmParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub csm_parameters: Option<String>, + #[serde( + rename = "customFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub custom_fields: Vec<TestExtensionField>, + #[serde( + rename = "dropLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub drop_location: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlAutEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_aut_environment: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlTestEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_test_environment: Option<ShallowReference>, + #[serde( + rename = "dueDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub due_date: Option<time::OffsetDateTime>, + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "This class is used to provide the filters used for discovery"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option<RunFilter>, + #[serde( + rename = "incompleteTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub incomplete_tests: Option<i32>, + #[serde( + rename = "isAutomated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_automated: Option<bool>, + #[serde(rename = "isBvt", default, skip_serializing_if = "Option::is_none")] + pub is_bvt: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iteration: Option<String>, + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<String>, + #[serde( + rename = "lastUpdatedByName", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by_name: Option<String>, + #[serde( + rename = "legacySharePath", + default, + skip_serializing_if = "Option::is_none" + )] + pub legacy_share_path: Option<String>, + #[serde( + rename = "notApplicableTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub not_applicable_tests: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[serde(rename = "ownerName", default, skip_serializing_if = "Option::is_none")] + pub owner_name: Option<String>, + #[serde( + rename = "passedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub passed_tests: Option<i32>, + #[serde( + rename = "postProcessState", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_process_state: Option<String>, + #[serde( + rename = "publicTestSettingsId", + default, + skip_serializing_if = "Option::is_none" + )] + pub public_test_settings_id: Option<i32>, + #[serde( + rename = "releaseEnvironmentUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment_uri: Option<String>, + #[doc = ""] + #[serde( + rename = "releaseReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_reference: Option<LegacyReleaseReference>, + #[serde( + rename = "releaseUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_uri: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[serde( + rename = "rowVersion", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub row_version: Vec<String>, + #[serde( + rename = "runHasDtlEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_has_dtl_environment: Option<bool>, + #[serde( + rename = "runTimeout", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_timeout: Option<String>, + #[serde( + rename = "serviceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub service_version: Option<String>, + #[serde( + rename = "sourceWorkflow", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_workflow: Option<String>, + #[serde( + rename = "startDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde( + rename = "subscriptionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub substate: Option<String>, + #[serde( + rename = "teamProject", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project: Option<String>, + #[serde( + rename = "teamProjectUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project_uri: Option<String>, + #[serde( + rename = "testConfigurationsMapping", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_configurations_mapping: Option<String>, + #[serde( + rename = "testEnvironmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_environment_id: Option<String>, + #[serde( + rename = "testMessageLogEntries", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_message_log_entries: Vec<TestMessageLogDetails>, + #[serde( + rename = "testMessageLogId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_message_log_id: Option<i32>, + #[serde( + rename = "testPlanId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_plan_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, + #[serde( + rename = "testRunStatistics", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_run_statistics: Vec<LegacyTestRunStatistic>, + #[serde( + rename = "testSettingsId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[serde( + rename = "totalTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_tests: Option<i32>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[serde( + rename = "unanalyzedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub unanalyzed_tests: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i32>, } impl LegacyTestRun { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LegacyTestRunStatistic { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = "Test Resolution State Details."] - #[serde( - rename = "resolutionState", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_state: Option<TestResolutionState>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = "Test Resolution State Details."] + #[serde( + rename = "resolutionState", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_state: Option<TestResolutionState>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl LegacyTestRunStatistic { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LegacyTestSettings { - #[serde(rename = "areaId", default, skip_serializing_if = "Option::is_none")] - pub area_id: Option<i32>, - #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] - pub area_path: Option<String>, - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<String>, - #[serde( - rename = "createdByName", - default, - skip_serializing_if = "Option::is_none" - )] - pub created_by_name: Option<String>, - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde( - rename = "isAutomated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_automated: Option<bool>, - #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] - pub is_public: Option<bool>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<String>, - #[serde( - rename = "lastUpdatedByName", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by_name: Option<String>, - #[serde( - rename = "machineRoles", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub machine_roles: Vec<TestSettingsMachineRole>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option<String>, - #[serde( - rename = "teamProjectUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project_uri: Option<String>, + #[serde(rename = "areaId", default, skip_serializing_if = "Option::is_none")] + pub area_id: Option<i32>, + #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] + pub area_path: Option<String>, + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<String>, + #[serde( + rename = "createdByName", + default, + skip_serializing_if = "Option::is_none" + )] + pub created_by_name: Option<String>, + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde( + rename = "isAutomated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_automated: Option<bool>, + #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] + pub is_public: Option<bool>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<String>, + #[serde( + rename = "lastUpdatedByName", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by_name: Option<String>, + #[serde( + rename = "machineRoles", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub machine_roles: Vec<TestSettingsMachineRole>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub settings: Option<String>, + #[serde( + rename = "teamProjectUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project_uri: Option<String>, } impl LegacyTestSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LineBlockCoverage { - #[doc = "End of line block"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end: Option<i32>, - #[doc = "Start of line block"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start: Option<i32>, - #[doc = "Coverage status. Covered: 0, NotCovered: 1, PartiallyCovered: 2"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<i32>, + #[doc = "End of line block"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option<i32>, + #[doc = "Start of line block"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option<i32>, + #[doc = "Coverage status. Covered: 0, NotCovered: 1, PartiallyCovered: 2"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<i32>, } impl LineBlockCoverage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LinkedWorkItemsQuery { - #[serde( - rename = "automatedTestNames", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub automated_test_names: Vec<String>, - #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] - pub plan_id: Option<i32>, - #[serde( - rename = "pointIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub point_ids: Vec<i32>, - #[serde( - rename = "suiteIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub suite_ids: Vec<i32>, - #[serde( - rename = "testCaseIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_case_ids: Vec<i32>, - #[serde( - rename = "workItemCategory", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_category: Option<String>, + #[serde( + rename = "automatedTestNames", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub automated_test_names: Vec<String>, + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option<i32>, + #[serde( + rename = "pointIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub point_ids: Vec<i32>, + #[serde( + rename = "suiteIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub suite_ids: Vec<i32>, + #[serde( + rename = "testCaseIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_case_ids: Vec<i32>, + #[serde( + rename = "workItemCategory", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_category: Option<String>, } impl LinkedWorkItemsQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LinkedWorkItemsQueryResult { - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] - pub plan_id: Option<i32>, - #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] - pub point_id: Option<i32>, - #[serde(rename = "suiteId", default, skip_serializing_if = "Option::is_none")] - pub suite_id: Option<i32>, - #[serde( - rename = "testCaseId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_id: Option<i32>, - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<WorkItemReference>, + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option<i32>, + #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] + pub point_id: Option<i32>, + #[serde(rename = "suiteId", default, skip_serializing_if = "Option::is_none")] + pub suite_id: Option<i32>, + #[serde( + rename = "testCaseId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_id: Option<i32>, + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<WorkItemReference>, } impl LinkedWorkItemsQueryResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ModuleCoverage { - #[serde( - rename = "blockCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub block_count: Option<i32>, - #[serde( - rename = "blockData", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub block_data: Vec<String>, - #[doc = "Code Coverage File Url"] - #[serde(rename = "fileUrl", default, skip_serializing_if = "Option::is_none")] - pub file_url: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub functions: Vec<FunctionCoverage>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub signature: Option<String>, - #[serde( - rename = "signatureAge", - default, - skip_serializing_if = "Option::is_none" - )] - pub signature_age: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub statistics: Option<CoverageStatistics>, + #[serde( + rename = "blockCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub block_count: Option<i32>, + #[serde( + rename = "blockData", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub block_data: Vec<String>, + #[doc = "Code Coverage File Url"] + #[serde(rename = "fileUrl", default, skip_serializing_if = "Option::is_none")] + pub file_url: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub functions: Vec<FunctionCoverage>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub signature: Option<String>, + #[serde( + rename = "signatureAge", + default, + skip_serializing_if = "Option::is_none" + )] + pub signature_age: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub statistics: Option<CoverageStatistics>, } impl ModuleCoverage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ModuleCoverage2 { - #[serde( - rename = "blockCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub block_count: Option<i32>, - #[serde( - rename = "blockData", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub block_data: Vec<String>, - #[serde( - rename = "blockDataLength", - default, - skip_serializing_if = "Option::is_none" - )] - pub block_data_length: Option<i32>, - #[serde( - rename = "blocksCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub blocks_covered: Option<i32>, - #[serde( - rename = "blocksNotCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub blocks_not_covered: Option<i32>, - #[serde( - rename = "coverageFileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub coverage_file_url: Option<String>, - #[serde( - rename = "coverageId", - default, - skip_serializing_if = "Option::is_none" - )] - pub coverage_id: Option<i32>, - #[serde( - rename = "linesCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub lines_covered: Option<i32>, - #[serde( - rename = "linesNotCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub lines_not_covered: Option<i32>, - #[serde( - rename = "linesPartiallyCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub lines_partially_covered: Option<i32>, - #[serde(rename = "moduleId", default, skip_serializing_if = "Option::is_none")] - pub module_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub signature: Option<String>, - #[serde( - rename = "signatureAge", - default, - skip_serializing_if = "Option::is_none" - )] - pub signature_age: Option<i32>, + #[serde( + rename = "blockCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub block_count: Option<i32>, + #[serde( + rename = "blockData", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub block_data: Vec<String>, + #[serde( + rename = "blockDataLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub block_data_length: Option<i32>, + #[serde( + rename = "blocksCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub blocks_covered: Option<i32>, + #[serde( + rename = "blocksNotCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub blocks_not_covered: Option<i32>, + #[serde( + rename = "coverageFileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub coverage_file_url: Option<String>, + #[serde( + rename = "coverageId", + default, + skip_serializing_if = "Option::is_none" + )] + pub coverage_id: Option<i32>, + #[serde( + rename = "linesCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub lines_covered: Option<i32>, + #[serde( + rename = "linesNotCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub lines_not_covered: Option<i32>, + #[serde( + rename = "linesPartiallyCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub lines_partially_covered: Option<i32>, + #[serde(rename = "moduleId", default, skip_serializing_if = "Option::is_none")] + pub module_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub signature: Option<String>, + #[serde( + rename = "signatureAge", + default, + skip_serializing_if = "Option::is_none" + )] + pub signature_age: Option<i32>, } impl ModuleCoverage2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Name value pair"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NameValuePair { - #[doc = "Name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Value"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Value"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl NameValuePair { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NewTestResultLoggingSettings { - #[doc = "LogNewTests defines whether or not we will record new test cases coming into the system"] - #[serde( - rename = "logNewTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub log_new_tests: Option<bool>, + #[doc = "LogNewTests defines whether or not we will record new test cases coming into the system"] + #[serde( + rename = "logNewTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub log_new_tests: Option<bool>, } impl NewTestResultLoggingSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Phase in pipeline"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PhaseReference { - #[doc = "Attempt number of the phase"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Name of the phase. Maximum supported length for name is 256 character."] - #[serde(rename = "phaseName", default, skip_serializing_if = "Option::is_none")] - pub phase_name: Option<String>, + #[doc = "Attempt number of the phase"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Name of the phase. Maximum supported length for name is 256 character."] + #[serde(rename = "phaseName", default, skip_serializing_if = "Option::is_none")] + pub phase_name: Option<String>, } impl PhaseReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Pipeline reference"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelineReference { - #[doc = "Job in pipeline. This is related to matrixing in YAML."] - #[serde( - rename = "jobReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_reference: Option<JobReference>, - #[doc = "Phase in pipeline"] - #[serde( - rename = "phaseReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub phase_reference: Option<PhaseReference>, - #[doc = "Reference of the pipeline with which this pipeline instance is related."] - #[serde( - rename = "pipelineId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pipeline_id: Option<i32>, - #[doc = "Stage in pipeline"] - #[serde( - rename = "stageReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub stage_reference: Option<StageReference>, + #[doc = "Job in pipeline. This is related to matrixing in YAML."] + #[serde( + rename = "jobReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_reference: Option<JobReference>, + #[doc = "Phase in pipeline"] + #[serde( + rename = "phaseReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub phase_reference: Option<PhaseReference>, + #[doc = "Reference of the pipeline with which this pipeline instance is related."] + #[serde( + rename = "pipelineId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pipeline_id: Option<i32>, + #[doc = "Stage in pipeline"] + #[serde( + rename = "stageReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub stage_reference: Option<StageReference>, } impl PipelineReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test summary of a pipeline instance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelineTestMetrics { - #[doc = "Pipeline reference"] - #[serde( - rename = "currentContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_context: Option<PipelineReference>, - #[doc = "Results insights for runs with state completed and NeedInvestigation."] - #[serde( - rename = "resultsAnalysis", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_analysis: Option<ResultsAnalysis>, - #[doc = "Summary of results for a pipeline instance."] - #[serde( - rename = "resultSummary", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_summary: Option<ResultSummary>, - #[doc = "Summary of runs for a pipeline instance."] - #[serde( - rename = "runSummary", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary: Option<RunSummary>, - #[doc = "Summary at child node."] - #[serde( - rename = "summaryAtChild", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub summary_at_child: Vec<PipelineTestMetrics>, + #[doc = "Pipeline reference"] + #[serde( + rename = "currentContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_context: Option<PipelineReference>, + #[doc = "Results insights for runs with state completed and NeedInvestigation."] + #[serde( + rename = "resultsAnalysis", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_analysis: Option<ResultsAnalysis>, + #[doc = "Summary of results for a pipeline instance."] + #[serde( + rename = "resultSummary", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_summary: Option<ResultSummary>, + #[doc = "Summary of runs for a pipeline instance."] + #[serde( + rename = "runSummary", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary: Option<RunSummary>, + #[doc = "Summary at child node."] + #[serde( + rename = "summaryAtChild", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub summary_at_child: Vec<PipelineTestMetrics>, } impl PipelineTestMetrics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A model class used for creating and updating test plans."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PlanUpdateModel { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub area: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "buildDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_definition: Option<ShallowReference>, - #[doc = "IDs of configurations to be applied when new test suites and test cases are added to the test plan."] - #[serde( - rename = "configurationIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub configuration_ids: Vec<i32>, - #[doc = "Description of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "End date for the test plan."] - #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")] - pub end_date: Option<String>, - #[doc = "Iteration path assigned to the test plan. This indicates when the target iteration by which the testing in this plan is supposed to be complete and the product is ready to be released."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub iteration: Option<String>, - #[doc = "Name of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Reference to release environment resource."] - #[serde( - rename = "releaseEnvironmentDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment_definition: Option<ReleaseEnvironmentDefinitionReference>, - #[doc = "Start date for the test plan."] - #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")] - pub start_date: Option<String>, - #[doc = "State of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "Test outcome settings"] - #[serde( - rename = "testOutcomeSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_outcome_settings: Option<TestOutcomeSettings>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub area: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "buildDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_definition: Option<ShallowReference>, + #[doc = "IDs of configurations to be applied when new test suites and test cases are added to the test plan."] + #[serde( + rename = "configurationIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub configuration_ids: Vec<i32>, + #[doc = "Description of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "End date for the test plan."] + #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")] + pub end_date: Option<String>, + #[doc = "Iteration path assigned to the test plan. This indicates when the target iteration by which the testing in this plan is supposed to be complete and the product is ready to be released."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iteration: Option<String>, + #[doc = "Name of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Reference to release environment resource."] + #[serde( + rename = "releaseEnvironmentDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment_definition: Option<ReleaseEnvironmentDefinitionReference>, + #[doc = "Start date for the test plan."] + #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")] + pub start_date: Option<String>, + #[doc = "State of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "Test outcome settings"] + #[serde( + rename = "testOutcomeSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_outcome_settings: Option<TestOutcomeSettings>, } impl PlanUpdateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Adding test cases to a suite creates one of more test points based on the default configurations and testers assigned to the test suite. PointAssignment is the list of test points that were created for each of the test cases that were added to the test suite."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PointAssignment { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<ShallowReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tester: Option<IdentityRef>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<ShallowReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tester: Option<IdentityRef>, } impl PointAssignment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PointLastResult { - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] - pub point_id: Option<i32>, + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] + pub point_id: Option<i32>, } impl PointLastResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Model to update test point."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PointUpdateModel { - #[doc = "Outcome to update."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = "Reset test point to active."] - #[serde( - rename = "resetToActive", - default, - skip_serializing_if = "Option::is_none" - )] - pub reset_to_active: Option<bool>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tester: Option<IdentityRef>, + #[doc = "Outcome to update."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = "Reset test point to active."] + #[serde( + rename = "resetToActive", + default, + skip_serializing_if = "Option::is_none" + )] + pub reset_to_active: Option<bool>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tester: Option<IdentityRef>, } impl PointUpdateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test point workitem property."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PointWorkItemProperty { - #[doc = "key value pair of test point work item property."] - #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] - pub work_item: Option<serde_json::Value>, + #[doc = "key value pair of test point work item property."] + #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] + pub work_item: Option<serde_json::Value>, } impl PointWorkItemProperty { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Filter class for test point."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PointsFilter { - #[doc = "List of Configurations for filtering."] - #[serde( - rename = "configurationNames", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub configuration_names: Vec<String>, - #[doc = "List of test case id for filtering."] - #[serde( - rename = "testcaseIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub testcase_ids: Vec<i32>, - #[doc = "List of tester for filtering."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub testers: Vec<IdentityRef>, + #[doc = "List of Configurations for filtering."] + #[serde( + rename = "configurationNames", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub configuration_names: Vec<String>, + #[doc = "List of test case id for filtering."] + #[serde( + rename = "testcaseIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub testcase_ids: Vec<i32>, + #[doc = "List of tester for filtering."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub testers: Vec<IdentityRef>, } impl PointsFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PointsReference2 { - #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] - pub plan_id: Option<i32>, - #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] - pub point_id: Option<i32>, + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option<i32>, + #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] + pub point_id: Option<i32>, } impl PointsReference2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PointsResults2 { - #[serde( - rename = "changeNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_number: Option<i32>, - #[serde( - rename = "lastFailureType", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_failure_type: Option<String>, - #[serde( - rename = "lastResolutionStateId", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_resolution_state_id: Option<i32>, - #[serde( - rename = "lastResultOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_result_outcome: Option<String>, - #[serde( - rename = "lastResultState", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_result_state: Option<String>, - #[serde( - rename = "lastTestResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_test_result_id: Option<i32>, - #[serde( - rename = "lastTestRunId", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_test_run_id: Option<i32>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<String>, - #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] - pub plan_id: Option<i32>, - #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] - pub point_id: Option<i32>, + #[serde( + rename = "changeNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_number: Option<i32>, + #[serde( + rename = "lastFailureType", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_failure_type: Option<String>, + #[serde( + rename = "lastResolutionStateId", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_resolution_state_id: Option<i32>, + #[serde( + rename = "lastResultOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_result_outcome: Option<String>, + #[serde( + rename = "lastResultState", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_result_state: Option<String>, + #[serde( + rename = "lastTestResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_test_result_id: Option<i32>, + #[serde( + rename = "lastTestRunId", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_test_run_id: Option<i32>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<String>, + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option<i32>, + #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] + pub point_id: Option<i32>, } impl PointsResults2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a Generic store for test session data."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PropertyBag { - #[doc = "Generic store for test session data"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bag: Option<serde_json::Value>, + #[doc = "Generic store for test session data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bag: Option<serde_json::Value>, } impl PropertyBag { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryByPointRequest { - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[serde( - rename = "testPlanId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_plan_id: Option<i32>, - #[serde( - rename = "testPointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_point_id: Option<i32>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[serde( + rename = "testPlanId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_plan_id: Option<i32>, + #[serde( + rename = "testPointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_point_id: Option<i32>, } impl QueryByPointRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryByRunRequest { - #[serde( - rename = "includeActionResults", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_action_results: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")] - pub page_size: Option<i32>, - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "includeActionResults", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_action_results: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")] + pub page_size: Option<i32>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl QueryByRunRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryModel { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option<String>, } impl QueryModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryTestActionResultRequest { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<LegacyTestCaseResultIdentifier>, - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<LegacyTestCaseResultIdentifier>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, } impl QueryTestActionResultRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryTestActionResultResponse { - #[serde( - rename = "testActionResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_action_results: Vec<TestActionResult>, - #[serde( - rename = "testAttachments", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_attachments: Vec<TestResultAttachment>, - #[serde( - rename = "testResultParameters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_result_parameters: Vec<TestResultParameter>, + #[serde( + rename = "testActionResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_action_results: Vec<TestActionResult>, + #[serde( + rename = "testAttachments", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_attachments: Vec<TestResultAttachment>, + #[serde( + rename = "testResultParameters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_result_parameters: Vec<TestResultParameter>, } impl QueryTestActionResultResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryTestMessageLogEntryRequest { - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[serde( - rename = "testMessageLogId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_message_log_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[serde( + rename = "testMessageLogId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_message_log_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl QueryTestMessageLogEntryRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryTestRunStatsRequest { - #[serde( - rename = "teamProjectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project_name: Option<String>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "teamProjectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project_name: Option<String>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl QueryTestRunStatsRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryTestRuns2Request { - #[serde( - rename = "includeStatistics", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_statistics: Option<bool>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option<ResultsStoreQuery>, + #[serde( + rename = "includeStatistics", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_statistics: Option<bool>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option<ResultsStoreQuery>, } impl QueryTestRuns2Request { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryTestRunsRequest { - #[serde(rename = "buildUri", default, skip_serializing_if = "Option::is_none")] - pub build_uri: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] - pub plan_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub skip: Option<i32>, - #[serde( - rename = "teamProjectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project_name: Option<String>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub top: Option<i32>, + #[serde(rename = "buildUri", default, skip_serializing_if = "Option::is_none")] + pub build_uri: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub skip: Option<i32>, + #[serde( + rename = "teamProjectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project_name: Option<String>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub top: Option<i32>, } impl QueryTestRunsRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to release environment resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseEnvironmentDefinitionReference { - #[doc = "ID of the release definition that contains the release environment definition."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "ID of the release environment definition."] - #[serde( - rename = "environmentDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_definition_id: Option<i32>, + #[doc = "ID of the release definition that contains the release environment definition."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "ID of the release environment definition."] + #[serde( + rename = "environmentDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_definition_id: Option<i32>, } impl ReleaseEnvironmentDefinitionReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to a release."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseReference { - #[doc = "Number of Release Attempt."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Release Creation Date(UTC)."] - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[doc = "Release definition ID."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "Environment creation Date(UTC)."] - #[serde( - rename = "environmentCreationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub environment_creation_date: Option<time::OffsetDateTime>, - #[doc = "Release environment definition ID."] - #[serde( - rename = "environmentDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_definition_id: Option<i32>, - #[doc = "Release environment definition name."] - #[serde( - rename = "environmentDefinitionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_definition_name: Option<String>, - #[doc = "Release environment ID."] - #[serde( - rename = "environmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_id: Option<i32>, - #[doc = "Release environment name."] - #[serde( - rename = "environmentName", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_name: Option<String>, - #[doc = "Release ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Release name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Number of Release Attempt."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Release Creation Date(UTC)."] + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[doc = "Release definition ID."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "Environment creation Date(UTC)."] + #[serde( + rename = "environmentCreationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub environment_creation_date: Option<time::OffsetDateTime>, + #[doc = "Release environment definition ID."] + #[serde( + rename = "environmentDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_definition_id: Option<i32>, + #[doc = "Release environment definition name."] + #[serde( + rename = "environmentDefinitionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_definition_name: Option<String>, + #[doc = "Release environment ID."] + #[serde( + rename = "environmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_id: Option<i32>, + #[doc = "Release environment name."] + #[serde( + rename = "environmentName", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_name: Option<String>, + #[doc = "Release ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Release name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ReleaseReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseReference2 { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[serde( - rename = "environmentCreationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub environment_creation_date: Option<time::OffsetDateTime>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "releaseCreationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub release_creation_date: Option<time::OffsetDateTime>, - #[serde( - rename = "releaseDefId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_def_id: Option<i32>, - #[serde( - rename = "releaseEnvDefId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_def_id: Option<i32>, - #[serde( - rename = "releaseEnvId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_id: Option<i32>, - #[serde( - rename = "releaseEnvName", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_name: Option<String>, - #[serde( - rename = "releaseEnvUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_uri: Option<String>, - #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] - pub release_id: Option<i32>, - #[serde( - rename = "releaseName", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_name: Option<String>, - #[serde( - rename = "releaseRefId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_ref_id: Option<i32>, - #[serde( - rename = "releaseUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_uri: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[serde( + rename = "environmentCreationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub environment_creation_date: Option<time::OffsetDateTime>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "releaseCreationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub release_creation_date: Option<time::OffsetDateTime>, + #[serde( + rename = "releaseDefId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_def_id: Option<i32>, + #[serde( + rename = "releaseEnvDefId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_def_id: Option<i32>, + #[serde( + rename = "releaseEnvId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_id: Option<i32>, + #[serde( + rename = "releaseEnvName", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_name: Option<String>, + #[serde( + rename = "releaseEnvUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_uri: Option<String>, + #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] + pub release_id: Option<i32>, + #[serde( + rename = "releaseName", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_name: Option<String>, + #[serde( + rename = "releaseRefId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_ref_id: Option<i32>, + #[serde( + rename = "releaseUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_uri: Option<String>, } impl ReleaseReference2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RequirementsToTestsMapping2 { - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<String>, - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[serde(rename = "deletedBy", default, skip_serializing_if = "Option::is_none")] - pub deleted_by: Option<String>, - #[serde( - rename = "deletionDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deletion_date: Option<time::OffsetDateTime>, - #[serde( - rename = "isMigratedToWIT", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_migrated_to_wit: Option<bool>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "testMetadataId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_metadata_id: Option<i32>, - #[serde( - rename = "workItemId", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_id: Option<i32>, + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<String>, + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[serde(rename = "deletedBy", default, skip_serializing_if = "Option::is_none")] + pub deleted_by: Option<String>, + #[serde( + rename = "deletionDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deletion_date: Option<time::OffsetDateTime>, + #[serde( + rename = "isMigratedToWIT", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_migrated_to_wit: Option<bool>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "testMetadataId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_metadata_id: Option<i32>, + #[serde( + rename = "workItemId", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_id: Option<i32>, } impl RequirementsToTestsMapping2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResetTestResultsRequest { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ids: Vec<LegacyTestCaseResultIdentifier>, - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ids: Vec<LegacyTestCaseResultIdentifier>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, } impl ResetTestResultsRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Response { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<response::Status>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<response::Status>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Response { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod response { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "continue")] - Continue, - #[serde(rename = "switchingProtocols")] - SwitchingProtocols, - #[serde(rename = "ok")] - Ok, - #[serde(rename = "created")] - Created, - #[serde(rename = "accepted")] - Accepted, - #[serde(rename = "nonAuthoritativeInformation")] - NonAuthoritativeInformation, - #[serde(rename = "noContent")] - NoContent, - #[serde(rename = "resetContent")] - ResetContent, - #[serde(rename = "partialContent")] - PartialContent, - #[serde(rename = "multipleChoices")] - MultipleChoices, - #[serde(rename = "ambiguous")] - Ambiguous, - #[serde(rename = "movedPermanently")] - MovedPermanently, - #[serde(rename = "moved")] - Moved, - #[serde(rename = "found")] - Found, - #[serde(rename = "redirect")] - Redirect, - #[serde(rename = "seeOther")] - SeeOther, - #[serde(rename = "redirectMethod")] - RedirectMethod, - #[serde(rename = "notModified")] - NotModified, - #[serde(rename = "useProxy")] - UseProxy, - #[serde(rename = "unused")] - Unused, - #[serde(rename = "temporaryRedirect")] - TemporaryRedirect, - #[serde(rename = "redirectKeepVerb")] - RedirectKeepVerb, - #[serde(rename = "badRequest")] - BadRequest, - #[serde(rename = "unauthorized")] - Unauthorized, - #[serde(rename = "paymentRequired")] - PaymentRequired, - #[serde(rename = "forbidden")] - Forbidden, - #[serde(rename = "notFound")] - NotFound, - #[serde(rename = "methodNotAllowed")] - MethodNotAllowed, - #[serde(rename = "notAcceptable")] - NotAcceptable, - #[serde(rename = "proxyAuthenticationRequired")] - ProxyAuthenticationRequired, - #[serde(rename = "requestTimeout")] - RequestTimeout, - #[serde(rename = "conflict")] - Conflict, - #[serde(rename = "gone")] - Gone, - #[serde(rename = "lengthRequired")] - LengthRequired, - #[serde(rename = "preconditionFailed")] - PreconditionFailed, - #[serde(rename = "requestEntityTooLarge")] - RequestEntityTooLarge, - #[serde(rename = "requestUriTooLong")] - RequestUriTooLong, - #[serde(rename = "unsupportedMediaType")] - UnsupportedMediaType, - #[serde(rename = "requestedRangeNotSatisfiable")] - RequestedRangeNotSatisfiable, - #[serde(rename = "expectationFailed")] - ExpectationFailed, - #[serde(rename = "upgradeRequired")] - UpgradeRequired, - #[serde(rename = "internalServerError")] - InternalServerError, - #[serde(rename = "notImplemented")] - NotImplemented, - #[serde(rename = "badGateway")] - BadGateway, - #[serde(rename = "serviceUnavailable")] - ServiceUnavailable, - #[serde(rename = "gatewayTimeout")] - GatewayTimeout, - #[serde(rename = "httpVersionNotSupported")] - HttpVersionNotSupported, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "continue")] + Continue, + #[serde(rename = "switchingProtocols")] + SwitchingProtocols, + #[serde(rename = "ok")] + Ok, + #[serde(rename = "created")] + Created, + #[serde(rename = "accepted")] + Accepted, + #[serde(rename = "nonAuthoritativeInformation")] + NonAuthoritativeInformation, + #[serde(rename = "noContent")] + NoContent, + #[serde(rename = "resetContent")] + ResetContent, + #[serde(rename = "partialContent")] + PartialContent, + #[serde(rename = "multipleChoices")] + MultipleChoices, + #[serde(rename = "ambiguous")] + Ambiguous, + #[serde(rename = "movedPermanently")] + MovedPermanently, + #[serde(rename = "moved")] + Moved, + #[serde(rename = "found")] + Found, + #[serde(rename = "redirect")] + Redirect, + #[serde(rename = "seeOther")] + SeeOther, + #[serde(rename = "redirectMethod")] + RedirectMethod, + #[serde(rename = "notModified")] + NotModified, + #[serde(rename = "useProxy")] + UseProxy, + #[serde(rename = "unused")] + Unused, + #[serde(rename = "temporaryRedirect")] + TemporaryRedirect, + #[serde(rename = "redirectKeepVerb")] + RedirectKeepVerb, + #[serde(rename = "badRequest")] + BadRequest, + #[serde(rename = "unauthorized")] + Unauthorized, + #[serde(rename = "paymentRequired")] + PaymentRequired, + #[serde(rename = "forbidden")] + Forbidden, + #[serde(rename = "notFound")] + NotFound, + #[serde(rename = "methodNotAllowed")] + MethodNotAllowed, + #[serde(rename = "notAcceptable")] + NotAcceptable, + #[serde(rename = "proxyAuthenticationRequired")] + ProxyAuthenticationRequired, + #[serde(rename = "requestTimeout")] + RequestTimeout, + #[serde(rename = "conflict")] + Conflict, + #[serde(rename = "gone")] + Gone, + #[serde(rename = "lengthRequired")] + LengthRequired, + #[serde(rename = "preconditionFailed")] + PreconditionFailed, + #[serde(rename = "requestEntityTooLarge")] + RequestEntityTooLarge, + #[serde(rename = "requestUriTooLong")] + RequestUriTooLong, + #[serde(rename = "unsupportedMediaType")] + UnsupportedMediaType, + #[serde(rename = "requestedRangeNotSatisfiable")] + RequestedRangeNotSatisfiable, + #[serde(rename = "expectationFailed")] + ExpectationFailed, + #[serde(rename = "upgradeRequired")] + UpgradeRequired, + #[serde(rename = "internalServerError")] + InternalServerError, + #[serde(rename = "notImplemented")] + NotImplemented, + #[serde(rename = "badGateway")] + BadGateway, + #[serde(rename = "serviceUnavailable")] + ServiceUnavailable, + #[serde(rename = "gatewayTimeout")] + GatewayTimeout, + #[serde(rename = "httpVersionNotSupported")] + HttpVersionNotSupported, + } } #[doc = "Test result retention settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultRetentionSettings { - #[doc = "Automated test result retention duration in days"] - #[serde( - rename = "automatedResultsRetentionDuration", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_results_retention_duration: Option<i32>, - #[doc = ""] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<IdentityRef>, - #[doc = "Last updated date"] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "Manual test result retention duration in days"] - #[serde( - rename = "manualResultsRetentionDuration", - default, - skip_serializing_if = "Option::is_none" - )] - pub manual_results_retention_duration: Option<i32>, + #[doc = "Automated test result retention duration in days"] + #[serde( + rename = "automatedResultsRetentionDuration", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_results_retention_duration: Option<i32>, + #[doc = ""] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<IdentityRef>, + #[doc = "Last updated date"] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "Manual test result retention duration in days"] + #[serde( + rename = "manualResultsRetentionDuration", + default, + skip_serializing_if = "Option::is_none" + )] + pub manual_results_retention_duration: Option<i32>, } impl ResultRetentionSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Summary of results for a pipeline instance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultSummary { - #[doc = "Result summary of pipeline, group by TestRun state."] - #[serde( - rename = "resultSummaryByRunState", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_summary_by_run_state: Option<serde_json::Value>, + #[doc = "Result summary of pipeline, group by TestRun state."] + #[serde( + rename = "resultSummaryByRunState", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_summary_by_run_state: Option<serde_json::Value>, } impl ResultSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultUpdateRequest { - #[serde( - rename = "actionResultDeletes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub action_result_deletes: Vec<TestActionResult>, - #[serde( - rename = "actionResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub action_results: Vec<TestActionResult>, - #[serde( - rename = "attachmentDeletes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub attachment_deletes: Vec<TestResultAttachmentIdentity>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub attachments: Vec<TestResultAttachment>, - #[serde( - rename = "parameterDeletes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub parameter_deletes: Vec<TestResultParameter>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub parameters: Vec<TestResultParameter>, - #[doc = ""] - #[serde( - rename = "testCaseResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_result: Option<LegacyTestCaseResult>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "actionResultDeletes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub action_result_deletes: Vec<TestActionResult>, + #[serde( + rename = "actionResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub action_results: Vec<TestActionResult>, + #[serde( + rename = "attachmentDeletes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub attachment_deletes: Vec<TestResultAttachmentIdentity>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub attachments: Vec<TestResultAttachment>, + #[serde( + rename = "parameterDeletes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub parameter_deletes: Vec<TestResultParameter>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub parameters: Vec<TestResultParameter>, + #[doc = ""] + #[serde( + rename = "testCaseResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_result: Option<LegacyTestCaseResult>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl ResultUpdateRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultUpdateRequestModel { - #[serde( - rename = "actionResultDeletes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub action_result_deletes: Vec<TestActionResultModel>, - #[serde( - rename = "actionResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub action_results: Vec<TestActionResultModel>, - #[serde( - rename = "parameterDeletes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub parameter_deletes: Vec<TestResultParameterModel>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub parameters: Vec<TestResultParameterModel>, - #[doc = ""] - #[serde( - rename = "testCaseResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_result: Option<TestCaseResultUpdateModel>, + #[serde( + rename = "actionResultDeletes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub action_result_deletes: Vec<TestActionResultModel>, + #[serde( + rename = "actionResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub action_results: Vec<TestActionResultModel>, + #[serde( + rename = "parameterDeletes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub parameter_deletes: Vec<TestResultParameterModel>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub parameters: Vec<TestResultParameterModel>, + #[doc = ""] + #[serde( + rename = "testCaseResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_result: Option<TestCaseResultUpdateModel>, } impl ResultUpdateRequestModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultUpdateResponse { - #[serde( - rename = "attachmentIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub attachment_ids: Vec<i32>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<String>, - #[serde( - rename = "lastUpdatedByName", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by_name: Option<String>, - #[serde( - rename = "maxReservedSubResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_reserved_sub_result_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[serde( - rename = "testPlanId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_plan_id: Option<i32>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, + #[serde( + rename = "attachmentIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub attachment_ids: Vec<i32>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<String>, + #[serde( + rename = "lastUpdatedByName", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by_name: Option<String>, + #[serde( + rename = "maxReservedSubResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_reserved_sub_result_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[serde( + rename = "testPlanId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_plan_id: Option<i32>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, } impl ResultUpdateResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultUpdateResponseModel { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl ResultUpdateResponseModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Results insights for runs with state completed and NeedInvestigation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultsAnalysis { - #[doc = "Pipeline reference"] - #[serde( - rename = "previousContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub previous_context: Option<PipelineReference>, - #[doc = ""] - #[serde( - rename = "resultsDifference", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_difference: Option<AggregatedResultsDifference>, - #[doc = ""] - #[serde( - rename = "testFailuresAnalysis", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_failures_analysis: Option<TestResultFailuresAnalysis>, + #[doc = "Pipeline reference"] + #[serde( + rename = "previousContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub previous_context: Option<PipelineReference>, + #[doc = ""] + #[serde( + rename = "resultsDifference", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_difference: Option<AggregatedResultsDifference>, + #[doc = ""] + #[serde( + rename = "testFailuresAnalysis", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_failures_analysis: Option<TestResultFailuresAnalysis>, } impl ResultsAnalysis { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultsByQueryRequest { - #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")] - pub page_size: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option<ResultsStoreQuery>, + #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")] + pub page_size: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option<ResultsStoreQuery>, } impl ResultsByQueryRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultsByQueryResponse { - #[serde( - rename = "excessIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub excess_ids: Vec<LegacyTestCaseResultIdentifier>, - #[serde( - rename = "testResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_results: Vec<LegacyTestCaseResult>, + #[serde( + rename = "excessIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub excess_ids: Vec<LegacyTestCaseResultIdentifier>, + #[serde( + rename = "testResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_results: Vec<LegacyTestCaseResult>, } impl ResultsByQueryResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultsFilter { - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub branch: Option<String>, - #[serde( - rename = "executedIn", - default, - skip_serializing_if = "Option::is_none" - )] - pub executed_in: Option<results_filter::ExecutedIn>, - #[serde(rename = "groupBy", default, skip_serializing_if = "Option::is_none")] - pub group_by: Option<String>, - #[serde( - rename = "maxCompleteDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub max_complete_date: Option<time::OffsetDateTime>, - #[serde( - rename = "resultsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_count: Option<i32>, - #[serde( - rename = "testCaseId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_id: Option<i32>, - #[serde( - rename = "testCaseReferenceIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_case_reference_ids: Vec<i32>, - #[serde( - rename = "testPlanId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_plan_id: Option<i32>, - #[serde( - rename = "testPointIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_point_ids: Vec<i32>, - #[doc = ""] - #[serde( - rename = "testResultsContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_results_context: Option<TestResultsContext>, - #[serde(rename = "trendDays", default, skip_serializing_if = "Option::is_none")] - pub trend_days: Option<i32>, + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub branch: Option<String>, + #[serde( + rename = "executedIn", + default, + skip_serializing_if = "Option::is_none" + )] + pub executed_in: Option<results_filter::ExecutedIn>, + #[serde(rename = "groupBy", default, skip_serializing_if = "Option::is_none")] + pub group_by: Option<String>, + #[serde( + rename = "maxCompleteDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub max_complete_date: Option<time::OffsetDateTime>, + #[serde( + rename = "resultsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_count: Option<i32>, + #[serde( + rename = "testCaseId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_id: Option<i32>, + #[serde( + rename = "testCaseReferenceIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_case_reference_ids: Vec<i32>, + #[serde( + rename = "testPlanId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_plan_id: Option<i32>, + #[serde( + rename = "testPointIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_point_ids: Vec<i32>, + #[doc = ""] + #[serde( + rename = "testResultsContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_results_context: Option<TestResultsContext>, + #[serde(rename = "trendDays", default, skip_serializing_if = "Option::is_none")] + pub trend_days: Option<i32>, } impl ResultsFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod results_filter { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ExecutedIn { - #[serde(rename = "any")] - Any, - #[serde(rename = "tcm")] - Tcm, - #[serde(rename = "tfs")] - Tfs, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ExecutedIn { + #[serde(rename = "any")] + Any, + #[serde(rename = "tcm")] + Tcm, + #[serde(rename = "tfs")] + Tfs, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultsStoreQuery { - #[serde( - rename = "dayPrecision", - default, - skip_serializing_if = "Option::is_none" - )] - pub day_precision: Option<bool>, - #[serde(rename = "queryText", default, skip_serializing_if = "Option::is_none")] - pub query_text: Option<String>, - #[serde( - rename = "teamProjectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project_name: Option<String>, - #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] - pub time_zone: Option<String>, + #[serde( + rename = "dayPrecision", + default, + skip_serializing_if = "Option::is_none" + )] + pub day_precision: Option<bool>, + #[serde(rename = "queryText", default, skip_serializing_if = "Option::is_none")] + pub query_text: Option<String>, + #[serde( + rename = "teamProjectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project_name: Option<String>, + #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] + pub time_zone: Option<String>, } impl ResultsStoreQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Result summary by the outcome of test results."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultsSummaryByOutcome { - #[doc = "Aggregated result details for each test result outcome."] - #[serde( - rename = "aggregatedResultDetailsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub aggregated_result_details_by_outcome: Option<serde_json::Value>, - #[doc = "Time taken by results."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[doc = "Total number of not reported test results."] - #[serde( - rename = "notReportedTestCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub not_reported_test_count: Option<i32>, - #[doc = "Total number of test results. (It includes NotImpacted test results as well which need to exclude while calculating pass/fail test result percentage)."] - #[serde( - rename = "totalTestCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_test_count: Option<i32>, + #[doc = "Aggregated result details for each test result outcome."] + #[serde( + rename = "aggregatedResultDetailsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub aggregated_result_details_by_outcome: Option<serde_json::Value>, + #[doc = "Time taken by results."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[doc = "Total number of not reported test results."] + #[serde( + rename = "notReportedTestCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub not_reported_test_count: Option<i32>, + #[doc = "Total number of test results. (It includes NotImpacted test results as well which need to exclude while calculating pass/fail test result percentage)."] + #[serde( + rename = "totalTestCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_test_count: Option<i32>, } impl ResultsSummaryByOutcome { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test run create details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunCreateModel { - #[doc = "true if test run is automated, false otherwise. By default it will be false."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub automated: Option<bool>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<ShallowReference>, - #[doc = "Drop location of the build used for test run."] - #[serde( - rename = "buildDropLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_drop_location: Option<String>, - #[doc = "Flavor of the build used for test run. (E.g: Release, Debug)"] - #[serde( - rename = "buildFlavor", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_flavor: Option<String>, - #[doc = "Platform of the build used for test run. (E.g.: x86, amd64)"] - #[serde( - rename = "buildPlatform", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_platform: Option<String>, - #[doc = "BuildConfiguration Details."] - #[serde( - rename = "buildReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_reference: Option<BuildConfiguration>, - #[doc = "Comments entered by those analyzing the run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Completed date time of the run."] - #[serde( - rename = "completeDate", - default, - skip_serializing_if = "Option::is_none" - )] - pub complete_date: Option<String>, - #[doc = "IDs of the test configurations associated with the run."] - #[serde( - rename = "configurationIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub configuration_ids: Vec<i32>, - #[doc = "Name of the test controller used for automated run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub controller: Option<String>, - #[doc = "Additional properties of test Run."] - #[serde( - rename = "customTestFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub custom_test_fields: Vec<CustomTestField>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlAutEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_aut_environment: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlTestEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_test_environment: Option<ShallowReference>, - #[doc = "Due date and time for test run."] - #[serde(rename = "dueDate", default, skip_serializing_if = "Option::is_none")] - pub due_date: Option<String>, - #[doc = "This is a temporary class to provide the details for the test run environment."] - #[serde( - rename = "environmentDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_details: Option<DtlEnvironmentDetails>, - #[doc = "Error message associated with the run."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "This class is used to provide the filters used for discovery"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option<RunFilter>, - #[doc = "The iteration in which to create the run. Root iteration of the team project will be default"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub iteration: Option<String>, - #[doc = "Name of the test run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Pipeline reference"] - #[serde( - rename = "pipelineReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub pipeline_reference: Option<PipelineReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub plan: Option<ShallowReference>, - #[doc = "IDs of the test points to use in the run."] - #[serde( - rename = "pointIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub point_ids: Vec<i32>, - #[doc = "URI of release environment associated with the run."] - #[serde( - rename = "releaseEnvironmentUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment_uri: Option<String>, - #[doc = "Reference to a release."] - #[serde( - rename = "releaseReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_reference: Option<ReleaseReference>, - #[doc = "URI of release associated with the run."] - #[serde( - rename = "releaseUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_uri: Option<String>, - #[doc = "Run summary for run Type = NoConfigRun."] - #[serde( - rename = "runSummary", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub run_summary: Vec<RunSummaryModel>, - #[doc = "Timespan till the run times out."] - #[serde( - rename = "runTimeout", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_timeout: Option<String>, - #[doc = "SourceWorkFlow(CI/CD) of the test run."] - #[serde( - rename = "sourceWorkflow", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_workflow: Option<String>, - #[doc = "Start date time of the run."] - #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")] - pub start_date: Option<String>, - #[doc = "The state of the run. Type TestRunState Valid states - NotStarted, InProgress, Waiting"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "Tags to attach with the test run, maximum of 5 tags can be added to run."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<TestTag>, - #[doc = "TestConfigurationMapping of the test run."] - #[serde( - rename = "testConfigurationsMapping", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_configurations_mapping: Option<String>, - #[doc = "ID of the test environment associated with the run."] - #[serde( - rename = "testEnvironmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_environment_id: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "testSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings: Option<ShallowReference>, - #[doc = "Type of the run(RunType) Valid Values : (Unspecified, Normal, Blocking, Web, MtrRunInitiatedFromWeb, RunWithDtlEnv, NoConfigRun)"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "true if test run is automated, false otherwise. By default it will be false."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub automated: Option<bool>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<ShallowReference>, + #[doc = "Drop location of the build used for test run."] + #[serde( + rename = "buildDropLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_drop_location: Option<String>, + #[doc = "Flavor of the build used for test run. (E.g: Release, Debug)"] + #[serde( + rename = "buildFlavor", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_flavor: Option<String>, + #[doc = "Platform of the build used for test run. (E.g.: x86, amd64)"] + #[serde( + rename = "buildPlatform", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_platform: Option<String>, + #[doc = "BuildConfiguration Details."] + #[serde( + rename = "buildReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_reference: Option<BuildConfiguration>, + #[doc = "Comments entered by those analyzing the run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Completed date time of the run."] + #[serde( + rename = "completeDate", + default, + skip_serializing_if = "Option::is_none" + )] + pub complete_date: Option<String>, + #[doc = "IDs of the test configurations associated with the run."] + #[serde( + rename = "configurationIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub configuration_ids: Vec<i32>, + #[doc = "Name of the test controller used for automated run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub controller: Option<String>, + #[doc = "Additional properties of test Run."] + #[serde( + rename = "customTestFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub custom_test_fields: Vec<CustomTestField>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlAutEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_aut_environment: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlTestEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_test_environment: Option<ShallowReference>, + #[doc = "Due date and time for test run."] + #[serde(rename = "dueDate", default, skip_serializing_if = "Option::is_none")] + pub due_date: Option<String>, + #[doc = "This is a temporary class to provide the details for the test run environment."] + #[serde( + rename = "environmentDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_details: Option<DtlEnvironmentDetails>, + #[doc = "Error message associated with the run."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "This class is used to provide the filters used for discovery"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option<RunFilter>, + #[doc = "The iteration in which to create the run. Root iteration of the team project will be default"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iteration: Option<String>, + #[doc = "Name of the test run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Pipeline reference"] + #[serde( + rename = "pipelineReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub pipeline_reference: Option<PipelineReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plan: Option<ShallowReference>, + #[doc = "IDs of the test points to use in the run."] + #[serde( + rename = "pointIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub point_ids: Vec<i32>, + #[doc = "URI of release environment associated with the run."] + #[serde( + rename = "releaseEnvironmentUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment_uri: Option<String>, + #[doc = "Reference to a release."] + #[serde( + rename = "releaseReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_reference: Option<ReleaseReference>, + #[doc = "URI of release associated with the run."] + #[serde( + rename = "releaseUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_uri: Option<String>, + #[doc = "Run summary for run Type = NoConfigRun."] + #[serde( + rename = "runSummary", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub run_summary: Vec<RunSummaryModel>, + #[doc = "Timespan till the run times out."] + #[serde( + rename = "runTimeout", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_timeout: Option<String>, + #[doc = "SourceWorkFlow(CI/CD) of the test run."] + #[serde( + rename = "sourceWorkflow", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_workflow: Option<String>, + #[doc = "Start date time of the run."] + #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")] + pub start_date: Option<String>, + #[doc = "The state of the run. Type TestRunState Valid states - NotStarted, InProgress, Waiting"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "Tags to attach with the test run, maximum of 5 tags can be added to run."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<TestTag>, + #[doc = "TestConfigurationMapping of the test run."] + #[serde( + rename = "testConfigurationsMapping", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_configurations_mapping: Option<String>, + #[doc = "ID of the test environment associated with the run."] + #[serde( + rename = "testEnvironmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_environment_id: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "testSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings: Option<ShallowReference>, + #[doc = "Type of the run(RunType) Valid Values : (Unspecified, Normal, Blocking, Web, MtrRunInitiatedFromWeb, RunWithDtlEnv, NoConfigRun)"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl RunCreateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This class is used to provide the filters used for discovery"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunFilter { - #[doc = "filter for the test case sources (test containers)"] - #[serde( - rename = "sourceFilter", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_filter: Option<String>, - #[doc = "filter for the test cases"] - #[serde( - rename = "testCaseFilter", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_filter: Option<String>, + #[doc = "filter for the test case sources (test containers)"] + #[serde( + rename = "sourceFilter", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_filter: Option<String>, + #[doc = "filter for the test cases"] + #[serde( + rename = "testCaseFilter", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_filter: Option<String>, } impl RunFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test run statistics per outcome."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunStatistic { - #[doc = "Test result count fo the given outcome."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Test result outcome"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = "Test Resolution State Details."] - #[serde( - rename = "resolutionState", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_state: Option<TestResolutionState>, - #[doc = "ResultMetadata for the given outcome/count."] - #[serde( - rename = "resultMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_metadata: Option<run_statistic::ResultMetadata>, - #[doc = "State of the test run"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, + #[doc = "Test result count fo the given outcome."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Test result outcome"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = "Test Resolution State Details."] + #[serde( + rename = "resolutionState", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_state: Option<TestResolutionState>, + #[doc = "ResultMetadata for the given outcome/count."] + #[serde( + rename = "resultMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_metadata: Option<run_statistic::ResultMetadata>, + #[doc = "State of the test run"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, } impl RunStatistic { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod run_statistic { - use super::*; - #[doc = "ResultMetadata for the given outcome/count."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ResultMetadata { - #[serde(rename = "rerun")] - Rerun, - #[serde(rename = "flaky")] - Flaky, - } + use super::*; + #[doc = "ResultMetadata for the given outcome/count."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ResultMetadata { + #[serde(rename = "rerun")] + Rerun, + #[serde(rename = "flaky")] + Flaky, + } } #[doc = "Summary of runs for a pipeline instance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunSummary { - #[doc = "Total time taken by runs with state completed and NeedInvestigation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[doc = "NoConfig runs count."] - #[serde( - rename = "noConfigRunsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub no_config_runs_count: Option<i32>, - #[doc = "Runs count by outcome for runs with state completed and NeedInvestigation runs."] - #[serde( - rename = "runSummaryByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary_by_outcome: Option<serde_json::Value>, - #[doc = "Runs count by state."] - #[serde( - rename = "runSummaryByState", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary_by_state: Option<serde_json::Value>, - #[doc = "Total runs count."] - #[serde( - rename = "totalRunsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_runs_count: Option<i32>, + #[doc = "Total time taken by runs with state completed and NeedInvestigation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[doc = "NoConfig runs count."] + #[serde( + rename = "noConfigRunsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub no_config_runs_count: Option<i32>, + #[doc = "Runs count by outcome for runs with state completed and NeedInvestigation runs."] + #[serde( + rename = "runSummaryByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary_by_outcome: Option<serde_json::Value>, + #[doc = "Runs count by state."] + #[serde( + rename = "runSummaryByState", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary_by_state: Option<serde_json::Value>, + #[doc = "Total runs count."] + #[serde( + rename = "totalRunsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_runs_count: Option<i32>, } impl RunSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Run summary for each output type of test."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunSummaryModel { - #[doc = "Total time taken in milliseconds."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<i64>, - #[doc = "Number of results for Outcome TestOutcome"] - #[serde( - rename = "resultCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_count: Option<i32>, - #[doc = "Summary is based on outcome"] - #[serde( - rename = "testOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_outcome: Option<run_summary_model::TestOutcome>, + #[doc = "Total time taken in milliseconds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<i64>, + #[doc = "Number of results for Outcome TestOutcome"] + #[serde( + rename = "resultCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_count: Option<i32>, + #[doc = "Summary is based on outcome"] + #[serde( + rename = "testOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_outcome: Option<run_summary_model::TestOutcome>, } impl RunSummaryModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod run_summary_model { - use super::*; - #[doc = "Summary is based on outcome"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TestOutcome { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "none")] - None, - #[serde(rename = "passed")] - Passed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "inconclusive")] - Inconclusive, - #[serde(rename = "timeout")] - Timeout, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "blocked")] - Blocked, - #[serde(rename = "notExecuted")] - NotExecuted, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - #[serde(rename = "notApplicable")] - NotApplicable, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "notImpacted")] - NotImpacted, - } + use super::*; + #[doc = "Summary is based on outcome"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum TestOutcome { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "none")] + None, + #[serde(rename = "passed")] + Passed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "inconclusive")] + Inconclusive, + #[serde(rename = "timeout")] + Timeout, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "blocked")] + Blocked, + #[serde(rename = "notExecuted")] + NotExecuted, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + #[serde(rename = "notApplicable")] + NotApplicable, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "notImpacted")] + NotImpacted, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunUpdateModel { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<ShallowReference>, - #[doc = "Drop location of the build used for test run."] - #[serde( - rename = "buildDropLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_drop_location: Option<String>, - #[doc = "Flavor of the build used for test run. (E.g: Release, Debug)"] - #[serde( - rename = "buildFlavor", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_flavor: Option<String>, - #[doc = "Platform of the build used for test run. (E.g.: x86, amd64)"] - #[serde( - rename = "buildPlatform", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_platform: Option<String>, - #[doc = "Comments entered by those analyzing the run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Completed date time of the run."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none" - )] - pub completed_date: Option<String>, - #[doc = "Name of the test controller used for automated run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub controller: Option<String>, - #[doc = "true to delete inProgess Results , false otherwise."] - #[serde( - rename = "deleteInProgressResults", - default, - skip_serializing_if = "Option::is_none" - )] - pub delete_in_progress_results: Option<bool>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlAutEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_aut_environment: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_environment: Option<ShallowReference>, - #[doc = "This is a temporary class to provide the details for the test run environment."] - #[serde( - rename = "dtlEnvironmentDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_environment_details: Option<DtlEnvironmentDetails>, - #[doc = "Due date and time for test run."] - #[serde(rename = "dueDate", default, skip_serializing_if = "Option::is_none")] - pub due_date: Option<String>, - #[doc = "Error message associated with the run."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "The iteration in which to create the run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub iteration: Option<String>, - #[doc = "Log entries associated with the run. Use a comma-separated list of multiple log entry objects. { logEntry }, { logEntry }, ..."] - #[serde( - rename = "logEntries", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub log_entries: Vec<TestMessageLogDetails>, - #[doc = "Name of the test run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "URI of release environment associated with the run."] - #[serde( - rename = "releaseEnvironmentUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment_uri: Option<String>, - #[doc = "URI of release associated with the run."] - #[serde( - rename = "releaseUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_uri: Option<String>, - #[doc = "Run summary for run Type = NoConfigRun."] - #[serde( - rename = "runSummary", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub run_summary: Vec<RunSummaryModel>, - #[doc = "SourceWorkFlow(CI/CD) of the test run."] - #[serde( - rename = "sourceWorkflow", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_workflow: Option<String>, - #[doc = "Start date time of the run."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none" - )] - pub started_date: Option<String>, - #[doc = "The state of the test run Below are the valid values - NotStarted, InProgress, Completed, Aborted, Waiting"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "The types of sub states for test run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub substate: Option<run_update_model::Substate>, - #[doc = "Tags to attach with the test run."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<TestTag>, - #[doc = "ID of the test environment associated with the run."] - #[serde( - rename = "testEnvironmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_environment_id: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "testSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<ShallowReference>, + #[doc = "Drop location of the build used for test run."] + #[serde( + rename = "buildDropLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_drop_location: Option<String>, + #[doc = "Flavor of the build used for test run. (E.g: Release, Debug)"] + #[serde( + rename = "buildFlavor", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_flavor: Option<String>, + #[doc = "Platform of the build used for test run. (E.g.: x86, amd64)"] + #[serde( + rename = "buildPlatform", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_platform: Option<String>, + #[doc = "Comments entered by those analyzing the run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Completed date time of the run."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none" + )] + pub completed_date: Option<String>, + #[doc = "Name of the test controller used for automated run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub controller: Option<String>, + #[doc = "true to delete inProgess Results , false otherwise."] + #[serde( + rename = "deleteInProgressResults", + default, + skip_serializing_if = "Option::is_none" + )] + pub delete_in_progress_results: Option<bool>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlAutEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_aut_environment: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_environment: Option<ShallowReference>, + #[doc = "This is a temporary class to provide the details for the test run environment."] + #[serde( + rename = "dtlEnvironmentDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_environment_details: Option<DtlEnvironmentDetails>, + #[doc = "Due date and time for test run."] + #[serde(rename = "dueDate", default, skip_serializing_if = "Option::is_none")] + pub due_date: Option<String>, + #[doc = "Error message associated with the run."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "The iteration in which to create the run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iteration: Option<String>, + #[doc = "Log entries associated with the run. Use a comma-separated list of multiple log entry objects. { logEntry }, { logEntry }, ..."] + #[serde( + rename = "logEntries", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub log_entries: Vec<TestMessageLogDetails>, + #[doc = "Name of the test run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "URI of release environment associated with the run."] + #[serde( + rename = "releaseEnvironmentUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment_uri: Option<String>, + #[doc = "URI of release associated with the run."] + #[serde( + rename = "releaseUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_uri: Option<String>, + #[doc = "Run summary for run Type = NoConfigRun."] + #[serde( + rename = "runSummary", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub run_summary: Vec<RunSummaryModel>, + #[doc = "SourceWorkFlow(CI/CD) of the test run."] + #[serde( + rename = "sourceWorkflow", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_workflow: Option<String>, + #[doc = "Start date time of the run."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none" + )] + pub started_date: Option<String>, + #[doc = "The state of the test run Below are the valid values - NotStarted, InProgress, Completed, Aborted, Waiting"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "The types of sub states for test run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub substate: Option<run_update_model::Substate>, + #[doc = "Tags to attach with the test run."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<TestTag>, + #[doc = "ID of the test environment associated with the run."] + #[serde( + rename = "testEnvironmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_environment_id: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "testSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings: Option<ShallowReference>, } impl RunUpdateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod run_update_model { - use super::*; - #[doc = "The types of sub states for test run."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Substate { - #[serde(rename = "none")] - None, - #[serde(rename = "creatingEnvironment")] - CreatingEnvironment, - #[serde(rename = "runningTests")] - RunningTests, - #[serde(rename = "canceledByUser")] - CanceledByUser, - #[serde(rename = "abortedBySystem")] - AbortedBySystem, - #[serde(rename = "timedOut")] - TimedOut, - #[serde(rename = "pendingAnalysis")] - PendingAnalysis, - #[serde(rename = "analyzed")] - Analyzed, - #[serde(rename = "cancellationInProgress")] - CancellationInProgress, - } + use super::*; + #[doc = "The types of sub states for test run."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Substate { + #[serde(rename = "none")] + None, + #[serde(rename = "creatingEnvironment")] + CreatingEnvironment, + #[serde(rename = "runningTests")] + RunningTests, + #[serde(rename = "canceledByUser")] + CanceledByUser, + #[serde(rename = "abortedBySystem")] + AbortedBySystem, + #[serde(rename = "timedOut")] + TimedOut, + #[serde(rename = "pendingAnalysis")] + PendingAnalysis, + #[serde(rename = "analyzed")] + Analyzed, + #[serde(rename = "cancellationInProgress")] + CancellationInProgress, + } } #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ShallowReference { - #[doc = "ID of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the linked resource (definition name, controller name, etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Full http link to the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "ID of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the linked resource (definition name, controller name, etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Full http link to the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ShallowReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ShallowTestCaseResult { - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[serde( - rename = "automatedTestStorage", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_storage: Option<String>, - #[serde( - rename = "durationInMs", - default, - skip_serializing_if = "Option::is_none" - )] - pub duration_in_ms: Option<f64>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(rename = "isReRun", default, skip_serializing_if = "Option::is_none")] - pub is_re_run: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option<i32>, - #[serde(rename = "refId", default, skip_serializing_if = "Option::is_none")] - pub ref_id: Option<i32>, - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[serde( - rename = "testCaseTitle", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_title: Option<String>, + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[serde( + rename = "automatedTestStorage", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_storage: Option<String>, + #[serde( + rename = "durationInMs", + default, + skip_serializing_if = "Option::is_none" + )] + pub duration_in_ms: Option<f64>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(rename = "isReRun", default, skip_serializing_if = "Option::is_none")] + pub is_re_run: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub priority: Option<i32>, + #[serde(rename = "refId", default, skip_serializing_if = "Option::is_none")] + pub ref_id: Option<i32>, + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[serde( + rename = "testCaseTitle", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_title: Option<String>, } impl ShallowTestCaseResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to shared step workitem."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SharedStepModel { - #[doc = "WorkItem shared step ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Shared step workitem revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[doc = "WorkItem shared step ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Shared step workitem revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl SharedStepModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Stage in pipeline"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StageReference { - #[doc = "Attempt number of stage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Name of the stage. Maximum supported length for name is 256 character."] - #[serde(rename = "stageName", default, skip_serializing_if = "Option::is_none")] - pub stage_name: Option<String>, + #[doc = "Attempt number of stage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Name of the stage. Maximum supported length for name is 256 character."] + #[serde(rename = "stageName", default, skip_serializing_if = "Option::is_none")] + pub stage_name: Option<String>, } impl StageReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Suite create model"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SuiteCreateModel { - #[doc = "Name of test suite."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "For query based suites, query string that defines the suite."] - #[serde( - rename = "queryString", - default, - skip_serializing_if = "Option::is_none" - )] - pub query_string: Option<String>, - #[doc = "For requirements test suites, the IDs of the requirements."] - #[serde( - rename = "requirementIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub requirement_ids: Vec<i32>, - #[doc = "Type of test suite to create. It can have value from DynamicTestSuite, StaticTestSuite and RequirementTestSuite."] - #[serde(rename = "suiteType", default, skip_serializing_if = "Option::is_none")] - pub suite_type: Option<String>, + #[doc = "Name of test suite."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "For query based suites, query string that defines the suite."] + #[serde( + rename = "queryString", + default, + skip_serializing_if = "Option::is_none" + )] + pub query_string: Option<String>, + #[doc = "For requirements test suites, the IDs of the requirements."] + #[serde( + rename = "requirementIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub requirement_ids: Vec<i32>, + #[doc = "Type of test suite to create. It can have value from DynamicTestSuite, StaticTestSuite and RequirementTestSuite."] + #[serde(rename = "suiteType", default, skip_serializing_if = "Option::is_none")] + pub suite_type: Option<String>, } impl SuiteCreateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A suite entry defines properties for a test suite."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SuiteEntry { - #[doc = "Id of child suite in the test suite."] - #[serde( - rename = "childSuiteId", - default, - skip_serializing_if = "Option::is_none" - )] - pub child_suite_id: Option<i32>, - #[doc = "Sequence number for the test case or child test suite in the test suite."] - #[serde( - rename = "sequenceNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub sequence_number: Option<i32>, - #[doc = "Id for the test suite."] - #[serde(rename = "suiteId", default, skip_serializing_if = "Option::is_none")] - pub suite_id: Option<i32>, - #[doc = "Id of a test case in the test suite."] - #[serde( - rename = "testCaseId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_id: Option<i32>, + #[doc = "Id of child suite in the test suite."] + #[serde( + rename = "childSuiteId", + default, + skip_serializing_if = "Option::is_none" + )] + pub child_suite_id: Option<i32>, + #[doc = "Sequence number for the test case or child test suite in the test suite."] + #[serde( + rename = "sequenceNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub sequence_number: Option<i32>, + #[doc = "Id for the test suite."] + #[serde(rename = "suiteId", default, skip_serializing_if = "Option::is_none")] + pub suite_id: Option<i32>, + #[doc = "Id of a test case in the test suite."] + #[serde( + rename = "testCaseId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_id: Option<i32>, } impl SuiteEntry { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A model to define sequence of test suite entries in a test suite."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SuiteEntryUpdateModel { - #[doc = "Id of the child suite in the test suite."] - #[serde( - rename = "childSuiteId", - default, - skip_serializing_if = "Option::is_none" - )] - pub child_suite_id: Option<i32>, - #[doc = "Updated sequence number for the test case or child test suite in the test suite."] - #[serde( - rename = "sequenceNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub sequence_number: Option<i32>, - #[doc = "Id of the test case in the test suite."] - #[serde( - rename = "testCaseId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_id: Option<i32>, + #[doc = "Id of the child suite in the test suite."] + #[serde( + rename = "childSuiteId", + default, + skip_serializing_if = "Option::is_none" + )] + pub child_suite_id: Option<i32>, + #[doc = "Updated sequence number for the test case or child test suite in the test suite."] + #[serde( + rename = "sequenceNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub sequence_number: Option<i32>, + #[doc = "Id of the test case in the test suite."] + #[serde( + rename = "testCaseId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_id: Option<i32>, } impl SuiteEntryUpdateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test case for the suite."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SuiteTestCase { - #[doc = "Point Assignment for test suite's test case."] - #[serde( - rename = "pointAssignments", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub point_assignments: Vec<PointAssignment>, - #[doc = "WorkItem reference Details."] - #[serde(rename = "testCase", default, skip_serializing_if = "Option::is_none")] - pub test_case: Option<WorkItemReference>, + #[doc = "Point Assignment for test suite's test case."] + #[serde( + rename = "pointAssignments", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub point_assignments: Vec<PointAssignment>, + #[doc = "WorkItem reference Details."] + #[serde(rename = "testCase", default, skip_serializing_if = "Option::is_none")] + pub test_case: Option<WorkItemReference>, } impl SuiteTestCase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SuiteTestCaseList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<SuiteTestCase>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<SuiteTestCase>, } impl SuiteTestCaseList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test suite update model."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SuiteTestCaseUpdateModel { - #[doc = "Shallow reference of configurations for the test cases in the suite."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub configurations: Vec<ShallowReference>, + #[doc = "Shallow reference of configurations for the test cases in the suite."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub configurations: Vec<ShallowReference>, } impl SuiteTestCaseUpdateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test suite update model."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SuiteUpdateModel { - #[doc = "Shallow reference of default configurations for the suite."] - #[serde( - rename = "defaultConfigurations", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub default_configurations: Vec<ShallowReference>, - #[doc = "Shallow reference of test suite."] - #[serde( - rename = "defaultTesters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub default_testers: Vec<ShallowReference>, - #[doc = "Specifies if the default configurations have to be inherited from the parent test suite in which the test suite is created."] - #[serde( - rename = "inheritDefaultConfigurations", - default, - skip_serializing_if = "Option::is_none" - )] - pub inherit_default_configurations: Option<bool>, - #[doc = "Test suite name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option<ShallowReference>, - #[doc = "For query based suites, the new query string."] - #[serde( - rename = "queryString", - default, - skip_serializing_if = "Option::is_none" - )] - pub query_string: Option<String>, + #[doc = "Shallow reference of default configurations for the suite."] + #[serde( + rename = "defaultConfigurations", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub default_configurations: Vec<ShallowReference>, + #[doc = "Shallow reference of test suite."] + #[serde( + rename = "defaultTesters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub default_testers: Vec<ShallowReference>, + #[doc = "Specifies if the default configurations have to be inherited from the parent test suite in which the test suite is created."] + #[serde( + rename = "inheritDefaultConfigurations", + default, + skip_serializing_if = "Option::is_none" + )] + pub inherit_default_configurations: Option<bool>, + #[doc = "Test suite name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option<ShallowReference>, + #[doc = "For query based suites, the new query string."] + #[serde( + rename = "queryString", + default, + skip_serializing_if = "Option::is_none" + )] + pub query_string: Option<String>, } impl SuiteUpdateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TcmPropertyBag2 { - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<i32>, - #[serde( - rename = "artifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<i32>, + #[serde( + rename = "artifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl TcmPropertyBag2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The Team Context for an operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamContext { - #[doc = "The team project Id or name. Ignored if ProjectId is set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<String>, - #[doc = "The Team Project ID. Required if Project is not set."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "The Team Id or name. Ignored if TeamId is set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub team: Option<String>, - #[doc = "The Team Id"] - #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] - pub team_id: Option<String>, + #[doc = "The team project Id or name. Ignored if ProjectId is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<String>, + #[doc = "The Team Project ID. Required if Project is not set."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "The Team Id or name. Ignored if TeamId is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub team: Option<String>, + #[doc = "The Team Id"] + #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] + pub team_id: Option<String>, } impl TeamContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a shallow reference to a TeamProject."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TeamProjectReference { - #[doc = "Project abbreviation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub abbreviation: Option<String>, - #[doc = "Url to default team identity image."] - #[serde( - rename = "defaultTeamImageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_team_image_url: Option<String>, - #[doc = "The project's description (if any)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Project identifier."] - pub id: String, - #[doc = "Project last update time."] - #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] - pub last_update_time: time::OffsetDateTime, - #[doc = "Project name."] - pub name: String, - #[doc = "Project revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, - #[doc = "Project state."] - pub state: team_project_reference::State, - #[doc = "Url to the full version of the object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Project visibility."] - pub visibility: team_project_reference::Visibility, + #[doc = "Project abbreviation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub abbreviation: Option<String>, + #[doc = "Url to default team identity image."] + #[serde( + rename = "defaultTeamImageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_team_image_url: Option<String>, + #[doc = "The project's description (if any)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Project identifier."] + pub id: String, + #[doc = "Project last update time."] + #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] + pub last_update_time: time::OffsetDateTime, + #[doc = "Project name."] + pub name: String, + #[doc = "Project revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i64>, + #[doc = "Project state."] + pub state: team_project_reference::State, + #[doc = "Url to the full version of the object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Project visibility."] + pub visibility: team_project_reference::Visibility, } impl TeamProjectReference { - pub fn new( - id: String, - last_update_time: time::OffsetDateTime, - name: String, - state: team_project_reference::State, - visibility: team_project_reference::Visibility, - ) -> Self { - Self { - abbreviation: None, - default_team_image_url: None, - description: None, - id, - last_update_time, - name, - revision: None, - state, - url: None, - visibility, - } - } + pub fn new( + id: String, + last_update_time: time::OffsetDateTime, + name: String, + state: team_project_reference::State, + visibility: team_project_reference::Visibility, + ) -> Self { + Self { + abbreviation: None, + default_team_image_url: None, + description: None, + id, + last_update_time, + name, + revision: None, + state, + url: None, + visibility, + } + } } pub mod team_project_reference { - use super::*; - #[doc = "Project state."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "deleting")] - Deleting, - #[serde(rename = "new")] - New, - #[serde(rename = "wellFormed")] - WellFormed, - #[serde(rename = "createPending")] - CreatePending, - #[serde(rename = "all")] - All, - #[serde(rename = "unchanged")] - Unchanged, - #[serde(rename = "deleted")] - Deleted, - } - #[doc = "Project visibility."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Visibility { - #[serde(rename = "private")] - Private, - #[serde(rename = "public")] - Public, - #[serde(rename = "organization")] - Organization, - #[serde(rename = "unchanged")] - Unchanged, - } + use super::*; + #[doc = "Project state."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "deleting")] + Deleting, + #[serde(rename = "new")] + New, + #[serde(rename = "wellFormed")] + WellFormed, + #[serde(rename = "createPending")] + CreatePending, + #[serde(rename = "all")] + All, + #[serde(rename = "unchanged")] + Unchanged, + #[serde(rename = "deleted")] + Deleted, + } + #[doc = "Project visibility."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Visibility { + #[serde(rename = "private")] + Private, + #[serde(rename = "public")] + Public, + #[serde(rename = "organization")] + Organization, + #[serde(rename = "unchanged")] + Unchanged, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestActionResult { - #[serde( - rename = "actionPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_path: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[serde( - rename = "dateCompleted", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_completed: Option<time::OffsetDateTime>, - #[serde( - rename = "dateStarted", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_started: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<i64>, - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<LegacyTestCaseResultIdentifier>, - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[serde( - rename = "sharedStepId", - default, - skip_serializing_if = "Option::is_none" - )] - pub shared_step_id: Option<i32>, - #[serde( - rename = "sharedStepRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub shared_step_revision: Option<i32>, + #[serde( + rename = "actionPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_path: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[serde( + rename = "dateCompleted", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_completed: Option<time::OffsetDateTime>, + #[serde( + rename = "dateStarted", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_started: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<i64>, + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<LegacyTestCaseResultIdentifier>, + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[serde( + rename = "sharedStepId", + default, + skip_serializing_if = "Option::is_none" + )] + pub shared_step_id: Option<i32>, + #[serde( + rename = "sharedStepRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub shared_step_revision: Option<i32>, } impl TestActionResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestActionResult2 { - #[serde( - rename = "actionPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_path: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[serde( - rename = "dateCompleted", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_completed: Option<time::OffsetDateTime>, - #[serde( - rename = "dateStarted", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_started: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<i64>, - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[serde( - rename = "sharedStepId", - default, - skip_serializing_if = "Option::is_none" - )] - pub shared_step_id: Option<i32>, - #[serde( - rename = "sharedStepRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub shared_step_revision: Option<i32>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "actionPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_path: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[serde( + rename = "dateCompleted", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_completed: Option<time::OffsetDateTime>, + #[serde( + rename = "dateStarted", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_started: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<i64>, + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[serde( + rename = "sharedStepId", + default, + skip_serializing_if = "Option::is_none" + )] + pub shared_step_id: Option<i32>, + #[serde( + rename = "sharedStepRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub shared_step_revision: Option<i32>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl TestActionResult2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a test step result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestActionResultModel { - #[serde(flatten)] - pub test_result_model_base: TestResultModelBase, - #[doc = "Path identifier for test step in test case workitem. Note: 1) It is represented in Hexadecimal format with 8 digits for a step. 2) Internally, the step ID value for first step starts with 2 so actionPath = 00000002 step 9, will have an ID = 10 and actionPath = 0000000a step 15, will have an ID =16 and actionPath = 00000010 3) actionPath of shared step is concatenated with the parent step of test case. Example, it would be something of type - 0000000300000001 where 00000003 denotes action path of test step and 00000001 denotes action path for shared step"] - #[serde( - rename = "actionPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_path: Option<String>, - #[doc = "Iteration ID of test action result."] - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[doc = "Reference to shared step workitem."] - #[serde( - rename = "sharedStepModel", - default, - skip_serializing_if = "Option::is_none" - )] - pub shared_step_model: Option<SharedStepModel>, - #[doc = "This is step Id of test case. For shared step, it is step Id of shared step in test case workitem; step Id in shared step. Example: TestCase workitem has two steps: 1) Normal step with Id = 1 2) Shared Step with Id = 2. Inside shared step: a) Normal Step with Id = 1 Value for StepIdentifier for First step: \"1\" Second step: \"2;1\""] - #[serde( - rename = "stepIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub step_identifier: Option<String>, - #[doc = "Url of test action result. Deprecated in hosted environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(flatten)] + pub test_result_model_base: TestResultModelBase, + #[doc = "Path identifier for test step in test case workitem. Note: 1) It is represented in Hexadecimal format with 8 digits for a step. 2) Internally, the step ID value for first step starts with 2 so actionPath = 00000002 step 9, will have an ID = 10 and actionPath = 0000000a step 15, will have an ID =16 and actionPath = 00000010 3) actionPath of shared step is concatenated with the parent step of test case. Example, it would be something of type - 0000000300000001 where 00000003 denotes action path of test step and 00000001 denotes action path for shared step"] + #[serde( + rename = "actionPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_path: Option<String>, + #[doc = "Iteration ID of test action result."] + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[doc = "Reference to shared step workitem."] + #[serde( + rename = "sharedStepModel", + default, + skip_serializing_if = "Option::is_none" + )] + pub shared_step_model: Option<SharedStepModel>, + #[doc = "This is step Id of test case. For shared step, it is step Id of shared step in test case workitem; step Id in shared step. Example: TestCase workitem has two steps: 1) Normal step with Id = 1 2) Shared Step with Id = 2. Inside shared step: a) Normal Step with Id = 1 Value for StepIdentifier for First step: \"1\" Second step: \"2;1\""] + #[serde( + rename = "stepIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub step_identifier: Option<String>, + #[doc = "Url of test action result. Deprecated in hosted environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestActionResultModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestAttachment { - #[doc = "Attachment type."] - #[serde( - rename = "attachmentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub attachment_type: Option<test_attachment::AttachmentType>, - #[doc = "Comment associated with attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Attachment created date."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Attachment file name"] - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[doc = "ID of the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Attachment size."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[doc = "Attachment Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Attachment type."] + #[serde( + rename = "attachmentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub attachment_type: Option<test_attachment::AttachmentType>, + #[doc = "Comment associated with attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Attachment created date."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Attachment file name"] + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[doc = "ID of the attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Attachment size."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[doc = "Attachment Url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestAttachment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_attachment { - use super::*; - #[doc = "Attachment type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AttachmentType { - #[serde(rename = "generalAttachment")] - GeneralAttachment, - #[serde(rename = "codeCoverage")] - CodeCoverage, - #[serde(rename = "consoleLog")] - ConsoleLog, - } + use super::*; + #[doc = "Attachment type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AttachmentType { + #[serde(rename = "generalAttachment")] + GeneralAttachment, + #[serde(rename = "codeCoverage")] + CodeCoverage, + #[serde(rename = "consoleLog")] + ConsoleLog, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestAttachmentList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestAttachment>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestAttachment>, } impl TestAttachmentList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to test attachment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestAttachmentReference { - #[doc = "ID of the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Url to download the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "ID of the attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Url to download the attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestAttachmentReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test attachment request model"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestAttachmentRequestModel { - #[doc = "Attachment type By Default it will be GeneralAttachment. It can be one of the following type. { GeneralAttachment, AfnStrip, BugFilingData, CodeCoverage, IntermediateCollectorData, RunConfig, TestImpactDetails, TmiTestRunDeploymentFiles, TmiTestRunReverseDeploymentFiles, TmiTestResultDetail, TmiTestRunSummary }"] - #[serde( - rename = "attachmentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub attachment_type: Option<String>, - #[doc = "Comment associated with attachment"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Attachment filename"] - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[doc = "Base64 encoded file stream"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stream: Option<String>, + #[doc = "Attachment type By Default it will be GeneralAttachment. It can be one of the following type. { GeneralAttachment, AfnStrip, BugFilingData, CodeCoverage, IntermediateCollectorData, RunConfig, TestImpactDetails, TmiTestRunDeploymentFiles, TmiTestRunReverseDeploymentFiles, TmiTestResultDetail, TmiTestRunSummary }"] + #[serde( + rename = "attachmentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub attachment_type: Option<String>, + #[doc = "Comment associated with attachment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Attachment filename"] + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[doc = "Base64 encoded file stream"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stream: Option<String>, } impl TestAttachmentRequestModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestAuthoringDetails { - #[serde( - rename = "configurationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub configuration_id: Option<i32>, - #[serde( - rename = "isAutomated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_automated: Option<bool>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] - pub point_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option<String>, - #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] - pub run_by: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<test_authoring_details::State>, - #[serde(rename = "suiteId", default, skip_serializing_if = "Option::is_none")] - pub suite_id: Option<i32>, - #[serde(rename = "testerId", default, skip_serializing_if = "Option::is_none")] - pub tester_id: Option<String>, + #[serde( + rename = "configurationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub configuration_id: Option<i32>, + #[serde( + rename = "isAutomated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_automated: Option<bool>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] + pub point_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub priority: Option<String>, + #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] + pub run_by: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<test_authoring_details::State>, + #[serde(rename = "suiteId", default, skip_serializing_if = "Option::is_none")] + pub suite_id: Option<i32>, + #[serde(rename = "testerId", default, skip_serializing_if = "Option::is_none")] + pub tester_id: Option<String>, } impl TestAuthoringDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_authoring_details { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "none")] - None, - #[serde(rename = "ready")] - Ready, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "notReady")] - NotReady, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "maxValue")] - MaxValue, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "none")] + None, + #[serde(rename = "ready")] + Ready, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "notReady")] + NotReady, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "maxValue")] + MaxValue, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseMetadata2 { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub container: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "testMetadataId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_metadata_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub container: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "testMetadataId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_metadata_id: Option<i32>, } impl TestCaseMetadata2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseReference2 { - #[serde(rename = "areaId", default, skip_serializing_if = "Option::is_none")] - pub area_id: Option<i32>, - #[serde( - rename = "automatedTestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_id: Option<String>, - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[serde( - rename = "automatedTestNameHash", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub automated_test_name_hash: Vec<String>, - #[serde( - rename = "automatedTestStorage", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_storage: Option<String>, - #[serde( - rename = "automatedTestStorageHash", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub automated_test_storage_hash: Vec<String>, - #[serde( - rename = "automatedTestType", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_type: Option<String>, - #[serde( - rename = "configurationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub configuration_id: Option<i32>, - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<String>, - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[serde( - rename = "lastRefTestRunDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_ref_test_run_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option<String>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "testCaseId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_id: Option<i32>, - #[serde( - rename = "testCaseRefId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_ref_id: Option<i32>, - #[serde( - rename = "testCaseRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_revision: Option<i32>, - #[serde( - rename = "testCaseTitle", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_title: Option<String>, - #[serde( - rename = "testPointId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_point_id: Option<i32>, + #[serde(rename = "areaId", default, skip_serializing_if = "Option::is_none")] + pub area_id: Option<i32>, + #[serde( + rename = "automatedTestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_id: Option<String>, + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[serde( + rename = "automatedTestNameHash", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub automated_test_name_hash: Vec<String>, + #[serde( + rename = "automatedTestStorage", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_storage: Option<String>, + #[serde( + rename = "automatedTestStorageHash", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub automated_test_storage_hash: Vec<String>, + #[serde( + rename = "automatedTestType", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_type: Option<String>, + #[serde( + rename = "configurationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub configuration_id: Option<i32>, + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<String>, + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[serde( + rename = "lastRefTestRunDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_ref_test_run_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub priority: Option<String>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "testCaseId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_id: Option<i32>, + #[serde( + rename = "testCaseRefId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_ref_id: Option<i32>, + #[serde( + rename = "testCaseRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_revision: Option<i32>, + #[serde( + rename = "testCaseTitle", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_title: Option<String>, + #[serde( + rename = "testPointId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_point_id: Option<i32>, } impl TestCaseReference2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a test result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseResult { - #[doc = "Test attachment ID of action recording."] - #[serde( - rename = "afnStripId", - default, - skip_serializing_if = "Option::is_none" - )] - pub afn_strip_id: Option<i32>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub area: Option<ShallowReference>, - #[doc = "Reference to bugs linked to test result."] - #[serde( - rename = "associatedBugs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub associated_bugs: Vec<ShallowReference>, - #[doc = "ID representing test method in a dll."] - #[serde( - rename = "automatedTestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_id: Option<String>, - #[doc = "Fully qualified name of test executed."] - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[doc = "Container to which test belongs."] - #[serde( - rename = "automatedTestStorage", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_storage: Option<String>, - #[doc = "Type of automated test."] - #[serde( - rename = "automatedTestType", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_type: Option<String>, - #[doc = "TypeId of automated test."] - #[serde( - rename = "automatedTestTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_type_id: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<ShallowReference>, - #[doc = "Reference to a build."] - #[serde( - rename = "buildReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_reference: Option<BuildReference>, - #[doc = "Comment in a test result with maxSize= 1000 chars."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Time when test execution completed(UTC). Completed date should be greater than StartedDate."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Machine name where test executed."] - #[serde( - rename = "computerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub computer_name: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<ShallowReference>, - #[doc = "Timestamp when test result created(UTC)."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Additional properties of test result."] - #[serde( - rename = "customFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub custom_fields: Vec<CustomTestField>, - #[doc = "Duration of test execution in milliseconds. If not provided value will be set as CompletedDate - StartedDate"] - #[serde( - rename = "durationInMs", - default, - skip_serializing_if = "Option::is_none" - )] - pub duration_in_ms: Option<f64>, - #[doc = "Error message in test execution."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "Failing since information of a test result."] - #[serde( - rename = "failingSince", - default, - skip_serializing_if = "Option::is_none" - )] - pub failing_since: Option<FailingSince>, - #[doc = "Failure type of test result. Valid Value= (Known Issue, New Issue, Regression, Unknown, None)"] - #[serde( - rename = "failureType", - default, - skip_serializing_if = "Option::is_none" - )] - pub failure_type: Option<String>, - #[doc = "ID of a test result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Test result details of test iterations used only for Manual Testing."] - #[serde( - rename = "iterationDetails", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub iteration_details: Vec<TestIterationDetailsModel>, - #[doc = ""] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<IdentityRef>, - #[doc = "Last updated datetime of test result(UTC)."] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "Test outcome of test result. Valid values = (Unspecified, None, Passed, Failed, Inconclusive, Timeout, Aborted, Blocked, NotExecuted, Warning, Error, NotApplicable, Paused, InProgress, NotImpacted)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Priority of test executed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option<i32>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ShallowReference>, - #[doc = "Reference to a release."] - #[serde( - rename = "releaseReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_reference: Option<ReleaseReference>, - #[doc = "ResetCount."] - #[serde( - rename = "resetCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub reset_count: Option<i32>, - #[doc = "Resolution state of test result."] - #[serde( - rename = "resolutionState", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_state: Option<String>, - #[doc = "ID of resolution state."] - #[serde( - rename = "resolutionStateId", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_state_id: Option<i32>, - #[doc = "Hierarchy type of the result, default value of None means its leaf node."] - #[serde( - rename = "resultGroupType", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_group_type: Option<test_case_result::ResultGroupType>, - #[doc = "Revision number of test result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = ""] - #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] - pub run_by: Option<IdentityRef>, - #[doc = "Stacktrace with maxSize= 1000 chars."] - #[serde( - rename = "stackTrace", - default, - skip_serializing_if = "Option::is_none" - )] - pub stack_trace: Option<String>, - #[doc = "Time when test execution started(UTC)."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_date: Option<time::OffsetDateTime>, - #[doc = "State of test result. Type TestRunState."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "List of sub results inside a test result, if ResultGroupType is not None, it holds corresponding type sub results."] - #[serde( - rename = "subResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub sub_results: Vec<TestSubResult>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testCase", default, skip_serializing_if = "Option::is_none")] - pub test_case: Option<ShallowReference>, - #[doc = "Reference ID of test used by test result. Type TestResultMetaData"] - #[serde( - rename = "testCaseReferenceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_reference_id: Option<i32>, - #[doc = "TestCaseRevision Number."] - #[serde( - rename = "testCaseRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_revision: Option<i32>, - #[doc = "Name of test."] - #[serde( - rename = "testCaseTitle", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_title: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] - pub test_plan: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testPoint", default, skip_serializing_if = "Option::is_none")] - pub test_point: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] - pub test_run: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testSuite", default, skip_serializing_if = "Option::is_none")] - pub test_suite: Option<ShallowReference>, - #[doc = "Url of test result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Test attachment ID of action recording."] + #[serde( + rename = "afnStripId", + default, + skip_serializing_if = "Option::is_none" + )] + pub afn_strip_id: Option<i32>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub area: Option<ShallowReference>, + #[doc = "Reference to bugs linked to test result."] + #[serde( + rename = "associatedBugs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub associated_bugs: Vec<ShallowReference>, + #[doc = "ID representing test method in a dll."] + #[serde( + rename = "automatedTestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_id: Option<String>, + #[doc = "Fully qualified name of test executed."] + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[doc = "Container to which test belongs."] + #[serde( + rename = "automatedTestStorage", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_storage: Option<String>, + #[doc = "Type of automated test."] + #[serde( + rename = "automatedTestType", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_type: Option<String>, + #[doc = "TypeId of automated test."] + #[serde( + rename = "automatedTestTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_type_id: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<ShallowReference>, + #[doc = "Reference to a build."] + #[serde( + rename = "buildReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_reference: Option<BuildReference>, + #[doc = "Comment in a test result with maxSize= 1000 chars."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Time when test execution completed(UTC). Completed date should be greater than StartedDate."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Machine name where test executed."] + #[serde( + rename = "computerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub computer_name: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<ShallowReference>, + #[doc = "Timestamp when test result created(UTC)."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Additional properties of test result."] + #[serde( + rename = "customFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub custom_fields: Vec<CustomTestField>, + #[doc = "Duration of test execution in milliseconds. If not provided value will be set as CompletedDate - StartedDate"] + #[serde( + rename = "durationInMs", + default, + skip_serializing_if = "Option::is_none" + )] + pub duration_in_ms: Option<f64>, + #[doc = "Error message in test execution."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "Failing since information of a test result."] + #[serde( + rename = "failingSince", + default, + skip_serializing_if = "Option::is_none" + )] + pub failing_since: Option<FailingSince>, + #[doc = "Failure type of test result. Valid Value= (Known Issue, New Issue, Regression, Unknown, None)"] + #[serde( + rename = "failureType", + default, + skip_serializing_if = "Option::is_none" + )] + pub failure_type: Option<String>, + #[doc = "ID of a test result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Test result details of test iterations used only for Manual Testing."] + #[serde( + rename = "iterationDetails", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub iteration_details: Vec<TestIterationDetailsModel>, + #[doc = ""] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<IdentityRef>, + #[doc = "Last updated datetime of test result(UTC)."] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "Test outcome of test result. Valid values = (Unspecified, None, Passed, Failed, Inconclusive, Timeout, Aborted, Blocked, NotExecuted, Warning, Error, NotApplicable, Paused, InProgress, NotImpacted)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Priority of test executed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub priority: Option<i32>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ShallowReference>, + #[doc = "Reference to a release."] + #[serde( + rename = "releaseReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_reference: Option<ReleaseReference>, + #[doc = "ResetCount."] + #[serde( + rename = "resetCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub reset_count: Option<i32>, + #[doc = "Resolution state of test result."] + #[serde( + rename = "resolutionState", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_state: Option<String>, + #[doc = "ID of resolution state."] + #[serde( + rename = "resolutionStateId", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_state_id: Option<i32>, + #[doc = "Hierarchy type of the result, default value of None means its leaf node."] + #[serde( + rename = "resultGroupType", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_group_type: Option<test_case_result::ResultGroupType>, + #[doc = "Revision number of test result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = ""] + #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] + pub run_by: Option<IdentityRef>, + #[doc = "Stacktrace with maxSize= 1000 chars."] + #[serde( + rename = "stackTrace", + default, + skip_serializing_if = "Option::is_none" + )] + pub stack_trace: Option<String>, + #[doc = "Time when test execution started(UTC)."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_date: Option<time::OffsetDateTime>, + #[doc = "State of test result. Type TestRunState."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "List of sub results inside a test result, if ResultGroupType is not None, it holds corresponding type sub results."] + #[serde( + rename = "subResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub sub_results: Vec<TestSubResult>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testCase", default, skip_serializing_if = "Option::is_none")] + pub test_case: Option<ShallowReference>, + #[doc = "Reference ID of test used by test result. Type TestResultMetaData"] + #[serde( + rename = "testCaseReferenceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_reference_id: Option<i32>, + #[doc = "TestCaseRevision Number."] + #[serde( + rename = "testCaseRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_revision: Option<i32>, + #[doc = "Name of test."] + #[serde( + rename = "testCaseTitle", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_title: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] + pub test_plan: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testPoint", default, skip_serializing_if = "Option::is_none")] + pub test_point: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] + pub test_run: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testSuite", default, skip_serializing_if = "Option::is_none")] + pub test_suite: Option<ShallowReference>, + #[doc = "Url of test result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestCaseResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_case_result { - use super::*; - #[doc = "Hierarchy type of the result, default value of None means its leaf node."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ResultGroupType { - #[serde(rename = "none")] - None, - #[serde(rename = "rerun")] - Rerun, - #[serde(rename = "dataDriven")] - DataDriven, - #[serde(rename = "orderedTest")] - OrderedTest, - #[serde(rename = "generic")] - Generic, - } + use super::*; + #[doc = "Hierarchy type of the result, default value of None means its leaf node."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ResultGroupType { + #[serde(rename = "none")] + None, + #[serde(rename = "rerun")] + Rerun, + #[serde(rename = "dataDriven")] + DataDriven, + #[serde(rename = "orderedTest")] + OrderedTest, + #[serde(rename = "generic")] + Generic, + } } #[doc = "Test attachment information in a test iteration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseResultAttachmentModel { - #[doc = "Path identifier test step in test case workitem."] - #[serde( - rename = "actionPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_path: Option<String>, - #[doc = "Attachment ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Iteration ID."] - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[doc = "Name of attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Attachment size."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[doc = "Url to attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Path identifier test step in test case workitem."] + #[serde( + rename = "actionPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_path: Option<String>, + #[doc = "Attachment ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Iteration ID."] + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[doc = "Name of attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Attachment size."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[doc = "Url to attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestCaseResultAttachmentModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseResultIdAndRev { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<LegacyTestCaseResultIdentifier>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<LegacyTestCaseResultIdentifier>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl TestCaseResultIdAndRev { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to a test result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseResultIdentifier { - #[doc = "Test result ID."] - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[doc = "Test run ID."] - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[doc = "Test result ID."] + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[doc = "Test run ID."] + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl TestCaseResultIdentifier { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseResultList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestCaseResult>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestCaseResult>, } impl TestCaseResultList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseResultUpdateModel { - #[serde( - rename = "associatedWorkItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub associated_work_items: Vec<i32>, - #[serde( - rename = "automatedTestTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_type_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none" - )] - pub completed_date: Option<String>, - #[serde( - rename = "computerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub computer_name: Option<String>, - #[serde( - rename = "customFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub custom_fields: Vec<CustomTestField>, - #[serde( - rename = "durationInMs", - default, - skip_serializing_if = "Option::is_none" - )] - pub duration_in_ms: Option<String>, - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[serde( - rename = "failureType", - default, - skip_serializing_if = "Option::is_none" - )] - pub failure_type: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[serde( - rename = "resolutionState", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_state: Option<String>, - #[doc = ""] - #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] - pub run_by: Option<IdentityRef>, - #[serde( - rename = "stackTrace", - default, - skip_serializing_if = "Option::is_none" - )] - pub stack_trace: Option<String>, - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none" - )] - pub started_date: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde( - rename = "testCasePriority", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_priority: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "testResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result: Option<ShallowReference>, + #[serde( + rename = "associatedWorkItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub associated_work_items: Vec<i32>, + #[serde( + rename = "automatedTestTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_type_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none" + )] + pub completed_date: Option<String>, + #[serde( + rename = "computerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub computer_name: Option<String>, + #[serde( + rename = "customFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub custom_fields: Vec<CustomTestField>, + #[serde( + rename = "durationInMs", + default, + skip_serializing_if = "Option::is_none" + )] + pub duration_in_ms: Option<String>, + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[serde( + rename = "failureType", + default, + skip_serializing_if = "Option::is_none" + )] + pub failure_type: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[serde( + rename = "resolutionState", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_state: Option<String>, + #[doc = ""] + #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] + pub run_by: Option<IdentityRef>, + #[serde( + rename = "stackTrace", + default, + skip_serializing_if = "Option::is_none" + )] + pub stack_trace: Option<String>, + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none" + )] + pub started_date: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde( + rename = "testCasePriority", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_priority: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "testResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result: Option<ShallowReference>, } impl TestCaseResultUpdateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestConfiguration { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub area: Option<ShallowReference>, - #[doc = "Description of the configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Id of the configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Is the configuration a default for the test plans"] - #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] - pub is_default: Option<bool>, - #[doc = ""] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<IdentityRef>, - #[doc = "Last Updated Data"] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "Name of the configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, - #[doc = "Revision of the configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "State of the configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<test_configuration::State>, - #[doc = "Url of Configuration Resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Dictionary of Test Variable, Selected Value"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<NameValuePair>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub area: Option<ShallowReference>, + #[doc = "Description of the configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Id of the configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Is the configuration a default for the test plans"] + #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] + pub is_default: Option<bool>, + #[doc = ""] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<IdentityRef>, + #[doc = "Last Updated Data"] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "Name of the configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, + #[doc = "Revision of the the configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "State of the configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<test_configuration::State>, + #[doc = "Url of Configuration Resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Dictionary of Test Variable, Selected Value"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<NameValuePair>, } impl TestConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_configuration { - use super::*; - #[doc = "State of the configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "active")] - Active, - #[serde(rename = "inactive")] - Inactive, - } + use super::*; + #[doc = "State of the configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "active")] + Active, + #[serde(rename = "inactive")] + Inactive, + } } #[doc = "Test environment Detail."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestEnvironment { - #[doc = "Test Environment Id."] - #[serde( - rename = "environmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_id: Option<String>, - #[doc = "Test Environment Name."] - #[serde( - rename = "environmentName", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_name: Option<String>, + #[doc = "Test Environment Id."] + #[serde( + rename = "environmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_id: Option<String>, + #[doc = "Test Environment Name."] + #[serde( + rename = "environmentName", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_name: Option<String>, } impl TestEnvironment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestExecutionReportData { - #[serde( - rename = "reportData", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub report_data: Vec<DatedTestFieldData>, + #[serde( + rename = "reportData", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub report_data: Vec<DatedTestFieldData>, } impl TestExecutionReportData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestExtensionField { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub field: Option<TestExtensionFieldDetails>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub field: Option<TestExtensionFieldDetails>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl TestExtensionField { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestExtensionFieldDetails { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde( - rename = "isResultScoped", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_result_scoped: Option<bool>, - #[serde( - rename = "isRunScoped", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_run_scoped: Option<bool>, - #[serde( - rename = "isSystemField", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_system_field: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<test_extension_field_details::Type>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde( + rename = "isResultScoped", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_result_scoped: Option<bool>, + #[serde( + rename = "isRunScoped", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_run_scoped: Option<bool>, + #[serde( + rename = "isSystemField", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_system_field: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<test_extension_field_details::Type>, } impl TestExtensionFieldDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_extension_field_details { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "bigInt")] - BigInt, - #[serde(rename = "binary")] - Binary, - #[serde(rename = "bit")] - Bit, - #[serde(rename = "char")] - Char, - #[serde(rename = "dateTime")] - DateTime, - #[serde(rename = "decimal")] - Decimal, - #[serde(rename = "float")] - Float, - #[serde(rename = "image")] - Image, - #[serde(rename = "int")] - Int, - #[serde(rename = "money")] - Money, - #[serde(rename = "nChar")] - NChar, - #[serde(rename = "nText")] - NText, - #[serde(rename = "nVarChar")] - NVarChar, - #[serde(rename = "real")] - Real, - #[serde(rename = "uniqueIdentifier")] - UniqueIdentifier, - #[serde(rename = "smallDateTime")] - SmallDateTime, - #[serde(rename = "smallInt")] - SmallInt, - #[serde(rename = "smallMoney")] - SmallMoney, - #[serde(rename = "text")] - Text, - #[serde(rename = "timestamp")] - Timestamp, - #[serde(rename = "tinyInt")] - TinyInt, - #[serde(rename = "varBinary")] - VarBinary, - #[serde(rename = "varChar")] - VarChar, - #[serde(rename = "variant")] - Variant, - #[serde(rename = "xml")] - Xml, - #[serde(rename = "udt")] - Udt, - #[serde(rename = "structured")] - Structured, - #[serde(rename = "date")] - Date, - #[serde(rename = "time")] - Time, - #[serde(rename = "dateTime2")] - DateTime2, - #[serde(rename = "dateTimeOffset")] - DateTimeOffset, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "bigInt")] + BigInt, + #[serde(rename = "binary")] + Binary, + #[serde(rename = "bit")] + Bit, + #[serde(rename = "char")] + Char, + #[serde(rename = "dateTime")] + DateTime, + #[serde(rename = "decimal")] + Decimal, + #[serde(rename = "float")] + Float, + #[serde(rename = "image")] + Image, + #[serde(rename = "int")] + Int, + #[serde(rename = "money")] + Money, + #[serde(rename = "nChar")] + NChar, + #[serde(rename = "nText")] + NText, + #[serde(rename = "nVarChar")] + NVarChar, + #[serde(rename = "real")] + Real, + #[serde(rename = "uniqueIdentifier")] + UniqueIdentifier, + #[serde(rename = "smallDateTime")] + SmallDateTime, + #[serde(rename = "smallInt")] + SmallInt, + #[serde(rename = "smallMoney")] + SmallMoney, + #[serde(rename = "text")] + Text, + #[serde(rename = "timestamp")] + Timestamp, + #[serde(rename = "tinyInt")] + TinyInt, + #[serde(rename = "varBinary")] + VarBinary, + #[serde(rename = "varChar")] + VarChar, + #[serde(rename = "variant")] + Variant, + #[serde(rename = "xml")] + Xml, + #[serde(rename = "udt")] + Udt, + #[serde(rename = "structured")] + Structured, + #[serde(rename = "date")] + Date, + #[serde(rename = "time")] + Time, + #[serde(rename = "dateTime2")] + DateTime2, + #[serde(rename = "dateTimeOffset")] + DateTimeOffset, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestFailureDetails { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - rename = "testResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_results: Vec<TestCaseResultIdentifier>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + rename = "testResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_results: Vec<TestCaseResultIdentifier>, } impl TestFailureDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestFailureType { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, } impl TestFailureType { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestFailuresAnalysis { - #[doc = ""] - #[serde( - rename = "existingFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub existing_failures: Option<TestFailureDetails>, - #[doc = ""] - #[serde( - rename = "fixedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub fixed_tests: Option<TestFailureDetails>, - #[doc = ""] - #[serde( - rename = "newFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_failures: Option<TestFailureDetails>, - #[doc = ""] - #[serde( - rename = "previousContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub previous_context: Option<TestResultsContext>, + #[doc = ""] + #[serde( + rename = "existingFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub existing_failures: Option<TestFailureDetails>, + #[doc = ""] + #[serde( + rename = "fixedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub fixed_tests: Option<TestFailureDetails>, + #[doc = ""] + #[serde( + rename = "newFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_failures: Option<TestFailureDetails>, + #[doc = ""] + #[serde( + rename = "previousContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub previous_context: Option<TestResultsContext>, } impl TestFailuresAnalysis { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestFieldData { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub dimensions: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub measure: Option<i64>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dimensions: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub measure: Option<i64>, } impl TestFieldData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestFieldsEx2 { - #[serde(rename = "fieldId", default, skip_serializing_if = "Option::is_none")] - pub field_id: Option<i32>, - #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] - pub field_name: Option<String>, - #[serde(rename = "fieldType", default, skip_serializing_if = "Option::is_none")] - pub field_type: Option<String>, - #[serde( - rename = "isResultScoped", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_result_scoped: Option<bool>, - #[serde( - rename = "isRunScoped", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_run_scoped: Option<bool>, - #[serde( - rename = "isSystemField", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_system_field: Option<bool>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, + #[serde(rename = "fieldId", default, skip_serializing_if = "Option::is_none")] + pub field_id: Option<i32>, + #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] + pub field_name: Option<String>, + #[serde(rename = "fieldType", default, skip_serializing_if = "Option::is_none")] + pub field_type: Option<String>, + #[serde( + rename = "isResultScoped", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_result_scoped: Option<bool>, + #[serde( + rename = "isRunScoped", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_run_scoped: Option<bool>, + #[serde( + rename = "isSystemField", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_system_field: Option<bool>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, } impl TestFieldsEx2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Flaky Identifier"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestFlakyIdentifier { - #[doc = "Branch Name where Flakiness has to be Marked/Unmarked"] - #[serde( - rename = "branchName", - default, - skip_serializing_if = "Option::is_none" - )] - pub branch_name: Option<String>, - #[doc = "State for Flakiness"] - #[serde(rename = "isFlaky", default, skip_serializing_if = "Option::is_none")] - pub is_flaky: Option<bool>, + #[doc = "Branch Name where Flakiness has to be Marked/Unmarked"] + #[serde( + rename = "branchName", + default, + skip_serializing_if = "Option::is_none" + )] + pub branch_name: Option<String>, + #[doc = "State for Flakiness"] + #[serde(rename = "isFlaky", default, skip_serializing_if = "Option::is_none")] + pub is_flaky: Option<bool>, } impl TestFlakyIdentifier { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Filter to get TestCase result history."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestHistoryQuery { - #[doc = "Automated test name of the TestCase."] - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[doc = "Results to be get for a particular branches."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub branch: Option<String>, - #[doc = "Get the results history only for this BuildDefinitionId. This to get used in query GroupBy should be Branch. If this is provided, Branch will have no use."] - #[serde( - rename = "buildDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_definition_id: Option<i32>, - #[doc = "It will be filled by server. If not null means there are some results still to be get, and we need to call this REST API with this ContinuousToken. It is not supposed to be created (or altered, if received from server in last batch) by user."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[doc = "Group the result on the basis of TestResultGroupBy. This can be Branch, Environment or null(if results are fetched by BuildDefinitionId)"] - #[serde(rename = "groupBy", default, skip_serializing_if = "Option::is_none")] - pub group_by: Option<test_history_query::GroupBy>, - #[doc = "History to get between time interval MaxCompleteDate and (MaxCompleteDate - TrendDays). Default is current date time."] - #[serde( - rename = "maxCompleteDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub max_complete_date: Option<time::OffsetDateTime>, - #[doc = "Get the results history only for this ReleaseEnvDefinitionId. This to get used in query GroupBy should be Environment."] - #[serde( - rename = "releaseEnvDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_definition_id: Option<i32>, - #[doc = "List of TestResultHistoryForGroup which are grouped by GroupBy"] - #[serde( - rename = "resultsForGroup", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results_for_group: Vec<TestResultHistoryForGroup>, - #[doc = "Get the results history only for this testCaseId. This to get used in query to filter the result along with automatedtestname"] - #[serde( - rename = "testCaseId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_id: Option<i32>, - #[doc = "Number of days for which history to collect. Maximum supported value is 7 days. Default is 7 days."] - #[serde(rename = "trendDays", default, skip_serializing_if = "Option::is_none")] - pub trend_days: Option<i32>, + #[doc = "Automated test name of the TestCase."] + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[doc = "Results to be get for a particular branches."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub branch: Option<String>, + #[doc = "Get the results history only for this BuildDefinitionId. This to get used in query GroupBy should be Branch. If this is provided, Branch will have no use."] + #[serde( + rename = "buildDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_definition_id: Option<i32>, + #[doc = "It will be filled by server. If not null means there are some results still to be get, and we need to call this REST API with this ContinuousToken. It is not supposed to be created (or altered, if received from server in last batch) by user."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[doc = "Group the result on the basis of TestResultGroupBy. This can be Branch, Environment or null(if results are fetched by BuildDefinitionId)"] + #[serde(rename = "groupBy", default, skip_serializing_if = "Option::is_none")] + pub group_by: Option<test_history_query::GroupBy>, + #[doc = "History to get between time interval MaxCompleteDate and (MaxCompleteDate - TrendDays). Default is current date time."] + #[serde( + rename = "maxCompleteDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub max_complete_date: Option<time::OffsetDateTime>, + #[doc = "Get the results history only for this ReleaseEnvDefinitionId. This to get used in query GroupBy should be Environment."] + #[serde( + rename = "releaseEnvDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_definition_id: Option<i32>, + #[doc = "List of TestResultHistoryForGroup which are grouped by GroupBy"] + #[serde( + rename = "resultsForGroup", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results_for_group: Vec<TestResultHistoryForGroup>, + #[doc = "Get the results history only for this testCaseId. This to get used in query to filter the result along with automatedtestname"] + #[serde( + rename = "testCaseId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_id: Option<i32>, + #[doc = "Number of days for which history to collect. Maximum supported value is 7 days. Default is 7 days."] + #[serde(rename = "trendDays", default, skip_serializing_if = "Option::is_none")] + pub trend_days: Option<i32>, } impl TestHistoryQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_history_query { - use super::*; - #[doc = "Group the result on the basis of TestResultGroupBy. This can be Branch, Environment or null(if results are fetched by BuildDefinitionId)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum GroupBy { - #[serde(rename = "branch")] - Branch, - #[serde(rename = "environment")] - Environment, - } + use super::*; + #[doc = "Group the result on the basis of TestResultGroupBy. This can be Branch, Environment or null(if results are fetched by BuildDefinitionId)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum GroupBy { + #[serde(rename = "branch")] + Branch, + #[serde(rename = "environment")] + Environment, + } } #[doc = "Represents a test iteration result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestIterationDetailsModel { - #[doc = "Test step results in an iteration."] - #[serde( - rename = "actionResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub action_results: Vec<TestActionResultModel>, - #[doc = "Reference to attachments in test iteration result."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub attachments: Vec<TestCaseResultAttachmentModel>, - #[doc = "Comment in test iteration result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Time when execution completed(UTC)."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Duration of execution."] - #[serde( - rename = "durationInMs", - default, - skip_serializing_if = "Option::is_none" - )] - pub duration_in_ms: Option<f64>, - #[doc = "Error message in test iteration result execution."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "ID of test iteration result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Test outcome if test iteration result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = "Test parameters in an iteration."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub parameters: Vec<TestResultParameterModel>, - #[doc = "Time when execution started(UTC)."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_date: Option<time::OffsetDateTime>, - #[doc = "Url to test iteration result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Test step results in an iteration."] + #[serde( + rename = "actionResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub action_results: Vec<TestActionResultModel>, + #[doc = "Reference to attachments in test iteration result."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub attachments: Vec<TestCaseResultAttachmentModel>, + #[doc = "Comment in test iteration result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Time when execution completed(UTC)."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Duration of execution."] + #[serde( + rename = "durationInMs", + default, + skip_serializing_if = "Option::is_none" + )] + pub duration_in_ms: Option<f64>, + #[doc = "Error message in test iteration result execution."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "ID of test iteration result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Test outcome if test iteration result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = "Test parameters in an iteration."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub parameters: Vec<TestResultParameterModel>, + #[doc = "Time when execution started(UTC)."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_date: Option<time::OffsetDateTime>, + #[doc = "Url to test iteration result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestIterationDetailsModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestIterationDetailsModelList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestIterationDetailsModel>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestIterationDetailsModel>, } impl TestIterationDetailsModelList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents Test Log Result object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestLog { - #[doc = "Test Log Reference object"] - #[serde( - rename = "logReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub log_reference: Option<TestLogReference>, - #[doc = "Meta data for Log file"] - #[serde(rename = "metaData", default, skip_serializing_if = "Option::is_none")] - pub meta_data: Option<serde_json::Value>, - #[doc = "LastUpdatedDate for Log file"] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Size in Bytes for Log file"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, + #[doc = "Test Log Reference object"] + #[serde( + rename = "logReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub log_reference: Option<TestLogReference>, + #[doc = "Meta data for Log file"] + #[serde(rename = "metaData", default, skip_serializing_if = "Option::is_none")] + pub meta_data: Option<serde_json::Value>, + #[doc = "LastUpdatedDate for Log file"] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Size in Bytes for Log file"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, } impl TestLog { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Log Reference object"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestLogReference { - #[doc = "BuildId for test log, if context is build"] - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option<i32>, - #[doc = "FileName for log file"] - #[serde(rename = "filePath", default, skip_serializing_if = "Option::is_none")] - pub file_path: Option<String>, - #[doc = "ReleaseEnvId for test log, if context is Release"] - #[serde( - rename = "releaseEnvId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_id: Option<i32>, - #[doc = "ReleaseId for test log, if context is Release"] - #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] - pub release_id: Option<i32>, - #[doc = "Resultid for test log, if context is run and log is related to result"] - #[serde(rename = "resultId", default, skip_serializing_if = "Option::is_none")] - pub result_id: Option<i32>, - #[doc = "runid for test log, if context is run"] - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option<i32>, - #[doc = "Test Log Scope"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<test_log_reference::Scope>, - #[doc = "SubResultid for test log, if context is run and log is related to subresult"] - #[serde( - rename = "subResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub sub_result_id: Option<i32>, - #[doc = "Log Type"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<test_log_reference::Type>, + #[doc = "BuildId for test log, if context is build"] + #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] + pub build_id: Option<i32>, + #[doc = "FileName for log file"] + #[serde(rename = "filePath", default, skip_serializing_if = "Option::is_none")] + pub file_path: Option<String>, + #[doc = "ReleaseEnvId for test log, if context is Release"] + #[serde( + rename = "releaseEnvId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_id: Option<i32>, + #[doc = "ReleaseId for test log, if context is Release"] + #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] + pub release_id: Option<i32>, + #[doc = "Resultid for test log, if context is run and log is related to result"] + #[serde(rename = "resultId", default, skip_serializing_if = "Option::is_none")] + pub result_id: Option<i32>, + #[doc = "runid for test log, if context is run"] + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option<i32>, + #[doc = "Test Log Scope"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<test_log_reference::Scope>, + #[doc = "SubResultid for test log, if context is run and log is related to subresult"] + #[serde( + rename = "subResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub sub_result_id: Option<i32>, + #[doc = "Log Type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<test_log_reference::Type>, } impl TestLogReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_log_reference { - use super::*; - #[doc = "Test Log Scope"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Scope { - #[serde(rename = "run")] - Run, - } - #[doc = "Log Type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "generalAttachment")] - GeneralAttachment, - } + use super::*; + #[doc = "Test Log Scope"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Scope { + #[serde(rename = "run")] + Run, + } + #[doc = "Log Type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "generalAttachment")] + GeneralAttachment, + } } #[doc = "Represents Test Log Status object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestLogStatus { - #[doc = "Exception message"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub exception: Option<String>, - #[doc = "Test Log Status code"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<test_log_status::Status>, - #[doc = "Blob Transfer Error code"] - #[serde( - rename = "transferFailureType", - default, - skip_serializing_if = "Option::is_none" - )] - pub transfer_failure_type: Option<String>, + #[doc = "Exception message"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub exception: Option<String>, + #[doc = "Test Log Status code"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<test_log_status::Status>, + #[doc = "Blob Transfer Error code"] + #[serde( + rename = "transferFailureType", + default, + skip_serializing_if = "Option::is_none" + )] + pub transfer_failure_type: Option<String>, } impl TestLogStatus { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_log_status { - use super::*; - #[doc = "Test Log Status code"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "success")] - Success, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "fileAlreadyExists")] - FileAlreadyExists, - #[serde(rename = "invalidInput")] - InvalidInput, - #[serde(rename = "invalidFileName")] - InvalidFileName, - #[serde(rename = "invalidContainer")] - InvalidContainer, - #[serde(rename = "transferFailed")] - TransferFailed, - #[serde(rename = "featureDisabled")] - FeatureDisabled, - #[serde(rename = "buildDoesNotExist")] - BuildDoesNotExist, - #[serde(rename = "runDoesNotExist")] - RunDoesNotExist, - #[serde(rename = "containerNotCreated")] - ContainerNotCreated, - #[serde(rename = "apiNotSupported")] - ApiNotSupported, - #[serde(rename = "fileSizeExceeds")] - FileSizeExceeds, - #[serde(rename = "containerNotFound")] - ContainerNotFound, - #[serde(rename = "fileNotFound")] - FileNotFound, - #[serde(rename = "directoryNotFound")] - DirectoryNotFound, - #[serde(rename = "storageCapacityExceeded")] - StorageCapacityExceeded, - } -} -#[doc = "Attachment metadata for test attachments from LogStore."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TestLogStoreAttachment { - #[doc = "Attachment type."] - #[serde( - rename = "attachmentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub attachment_type: Option<test_log_store_attachment::AttachmentType>, - #[doc = "Comment associated with attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Attachment created date."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Attachment file name."] - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[doc = "Attachment size."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[doc = "Attachment Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, -} -impl TestLogStoreAttachment { - pub fn new() -> Self { - Self::default() - } -} -pub mod test_log_store_attachment { - use super::*; - #[doc = "Attachment type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AttachmentType { - #[serde(rename = "generalAttachment")] - GeneralAttachment, - #[serde(rename = "codeCoverage")] - CodeCoverage, - #[serde(rename = "consoleLog")] - ConsoleLog, - } -} -#[doc = "Reference to test attachment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TestLogStoreAttachmentReference { - #[doc = "Url to download the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, -} -impl TestLogStoreAttachmentReference { - pub fn new() -> Self { - Self::default() - } + use super::*; + #[doc = "Test Log Status code"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "success")] + Success, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "fileAlreadyExists")] + FileAlreadyExists, + #[serde(rename = "invalidInput")] + InvalidInput, + #[serde(rename = "invalidFileName")] + InvalidFileName, + #[serde(rename = "invalidContainer")] + InvalidContainer, + #[serde(rename = "transferFailed")] + TransferFailed, + #[serde(rename = "featureDisabled")] + FeatureDisabled, + #[serde(rename = "buildDoesNotExist")] + BuildDoesNotExist, + #[serde(rename = "runDoesNotExist")] + RunDoesNotExist, + #[serde(rename = "containerNotCreated")] + ContainerNotCreated, + #[serde(rename = "apiNotSupported")] + ApiNotSupported, + #[serde(rename = "fileSizeExceeds")] + FileSizeExceeds, + #[serde(rename = "containerNotFound")] + ContainerNotFound, + #[serde(rename = "fileNotFound")] + FileNotFound, + #[serde(rename = "directoryNotFound")] + DirectoryNotFound, + #[serde(rename = "storageCapacityExceeded")] + StorageCapacityExceeded, + } } #[doc = "Represents Test Log store endpoint details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestLogStoreEndpointDetails { - #[doc = "Test log store connection Uri."] - #[serde( - rename = "endpointSASUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_sas_uri: Option<String>, - #[doc = "Test log store endpoint type."] - #[serde( - rename = "endpointType", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_type: Option<test_log_store_endpoint_details::EndpointType>, - #[doc = "Test log store status code"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<test_log_store_endpoint_details::Status>, + #[doc = "Test log store connection Uri."] + #[serde( + rename = "endpointSASUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_sas_uri: Option<String>, + #[doc = "Test log store endpoint type."] + #[serde( + rename = "endpointType", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_type: Option<test_log_store_endpoint_details::EndpointType>, + #[doc = "Test log store status code"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<test_log_store_endpoint_details::Status>, } impl TestLogStoreEndpointDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_log_store_endpoint_details { - use super::*; - #[doc = "Test log store endpoint type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum EndpointType { - #[serde(rename = "root")] - Root, - #[serde(rename = "file")] - File, - } - #[doc = "Test log store status code"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "success")] - Success, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "fileAlreadyExists")] - FileAlreadyExists, - #[serde(rename = "invalidInput")] - InvalidInput, - #[serde(rename = "invalidFileName")] - InvalidFileName, - #[serde(rename = "invalidContainer")] - InvalidContainer, - #[serde(rename = "transferFailed")] - TransferFailed, - #[serde(rename = "featureDisabled")] - FeatureDisabled, - #[serde(rename = "buildDoesNotExist")] - BuildDoesNotExist, - #[serde(rename = "runDoesNotExist")] - RunDoesNotExist, - #[serde(rename = "containerNotCreated")] - ContainerNotCreated, - #[serde(rename = "apiNotSupported")] - ApiNotSupported, - #[serde(rename = "fileSizeExceeds")] - FileSizeExceeds, - #[serde(rename = "containerNotFound")] - ContainerNotFound, - #[serde(rename = "fileNotFound")] - FileNotFound, - #[serde(rename = "directoryNotFound")] - DirectoryNotFound, - #[serde(rename = "storageCapacityExceeded")] - StorageCapacityExceeded, - } + use super::*; + #[doc = "Test log store endpoint type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum EndpointType { + #[serde(rename = "root")] + Root, + #[serde(rename = "file")] + File, + } + #[doc = "Test log store status code"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "success")] + Success, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "fileAlreadyExists")] + FileAlreadyExists, + #[serde(rename = "invalidInput")] + InvalidInput, + #[serde(rename = "invalidFileName")] + InvalidFileName, + #[serde(rename = "invalidContainer")] + InvalidContainer, + #[serde(rename = "transferFailed")] + TransferFailed, + #[serde(rename = "featureDisabled")] + FeatureDisabled, + #[serde(rename = "buildDoesNotExist")] + BuildDoesNotExist, + #[serde(rename = "runDoesNotExist")] + RunDoesNotExist, + #[serde(rename = "containerNotCreated")] + ContainerNotCreated, + #[serde(rename = "apiNotSupported")] + ApiNotSupported, + #[serde(rename = "fileSizeExceeds")] + FileSizeExceeds, + #[serde(rename = "containerNotFound")] + ContainerNotFound, + #[serde(rename = "fileNotFound")] + FileNotFound, + #[serde(rename = "directoryNotFound")] + DirectoryNotFound, + #[serde(rename = "storageCapacityExceeded")] + StorageCapacityExceeded, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestMessageLog2 { - #[serde( - rename = "testMessageLogId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_message_log_id: Option<i32>, + #[serde( + rename = "testMessageLogId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_message_log_id: Option<i32>, } impl TestMessageLog2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestMessageLogDetails { - #[doc = "Date when the resource is created"] - #[serde( - rename = "dateCreated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_created: Option<time::OffsetDateTime>, - #[doc = "Id of the resource"] - #[serde(rename = "entryId", default, skip_serializing_if = "Option::is_none")] - pub entry_id: Option<i32>, - #[doc = "Message of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, + #[doc = "Date when the resource is created"] + #[serde( + rename = "dateCreated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_created: Option<time::OffsetDateTime>, + #[doc = "Id of the resource"] + #[serde(rename = "entryId", default, skip_serializing_if = "Option::is_none")] + pub entry_id: Option<i32>, + #[doc = "Message of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, } impl TestMessageLogDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestMessageLogEntry { - #[serde( - rename = "dateCreated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_created: Option<time::OffsetDateTime>, - #[serde(rename = "entryId", default, skip_serializing_if = "Option::is_none")] - pub entry_id: Option<i32>, - #[serde(rename = "logLevel", default, skip_serializing_if = "Option::is_none")] - pub log_level: Option<String>, - #[serde(rename = "logUser", default, skip_serializing_if = "Option::is_none")] - pub log_user: Option<String>, - #[serde( - rename = "logUserName", - default, - skip_serializing_if = "Option::is_none" - )] - pub log_user_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[serde( - rename = "testMessageLogId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_message_log_id: Option<i32>, + #[serde( + rename = "dateCreated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_created: Option<time::OffsetDateTime>, + #[serde(rename = "entryId", default, skip_serializing_if = "Option::is_none")] + pub entry_id: Option<i32>, + #[serde(rename = "logLevel", default, skip_serializing_if = "Option::is_none")] + pub log_level: Option<String>, + #[serde(rename = "logUser", default, skip_serializing_if = "Option::is_none")] + pub log_user: Option<String>, + #[serde( + rename = "logUserName", + default, + skip_serializing_if = "Option::is_none" + )] + pub log_user_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[serde( + rename = "testMessageLogId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_message_log_id: Option<i32>, } impl TestMessageLogEntry { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestMessageLogEntry2 { - #[serde( - rename = "dateCreated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_created: Option<time::OffsetDateTime>, - #[serde(rename = "entryId", default, skip_serializing_if = "Option::is_none")] - pub entry_id: Option<i32>, - #[serde(rename = "logLevel", default, skip_serializing_if = "Option::is_none")] - pub log_level: Option<String>, - #[serde(rename = "logUser", default, skip_serializing_if = "Option::is_none")] - pub log_user: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[serde( - rename = "testMessageLogId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_message_log_id: Option<i32>, + #[serde( + rename = "dateCreated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_created: Option<time::OffsetDateTime>, + #[serde(rename = "entryId", default, skip_serializing_if = "Option::is_none")] + pub entry_id: Option<i32>, + #[serde(rename = "logLevel", default, skip_serializing_if = "Option::is_none")] + pub log_level: Option<String>, + #[serde(rename = "logUser", default, skip_serializing_if = "Option::is_none")] + pub log_user: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[serde( + rename = "testMessageLogId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_message_log_id: Option<i32>, } impl TestMessageLogEntry2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestMethod { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub container: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub container: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TestMethod { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Class representing a reference to an operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestOperationReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestOperationReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test outcome settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestOutcomeSettings { - #[doc = "Value to configure how test outcomes for the same tests across suites are shown"] - #[serde( - rename = "syncOutcomeAcrossSuites", - default, - skip_serializing_if = "Option::is_none" - )] - pub sync_outcome_across_suites: Option<bool>, + #[doc = "Value to configure how test outcomes for the same tests across suites are shown"] + #[serde( + rename = "syncOutcomeAcrossSuites", + default, + skip_serializing_if = "Option::is_none" + )] + pub sync_outcome_across_suites: Option<bool>, } impl TestOutcomeSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestParameter2 { - #[serde( - rename = "actionPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_path: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub actual: Vec<String>, - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] - pub data_type: Option<String>, - #[serde( - rename = "dateModified", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_modified: Option<time::OffsetDateTime>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub expected: Vec<String>, - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[serde( - rename = "parameterName", - default, - skip_serializing_if = "Option::is_none" - )] - pub parameter_name: Option<String>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "actionPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_path: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub actual: Vec<String>, + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] + pub data_type: Option<String>, + #[serde( + rename = "dateModified", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_modified: Option<time::OffsetDateTime>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub expected: Vec<String>, + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[serde( + rename = "parameterName", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_name: Option<String>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl TestParameter2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The test plan resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPlan { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub area: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "buildDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_definition: Option<ShallowReference>, - #[doc = "Description of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "End date for the test plan."] - #[serde( - rename = "endDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub end_date: Option<time::OffsetDateTime>, - #[doc = "ID of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Iteration path of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub iteration: Option<String>, - #[doc = "Name of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "previousBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub previous_build: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, - #[doc = "Reference to release environment resource."] - #[serde( - rename = "releaseEnvironmentDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment_definition: Option<ReleaseEnvironmentDefinitionReference>, - #[doc = "Revision of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "rootSuite", default, skip_serializing_if = "Option::is_none")] - pub root_suite: Option<ShallowReference>, - #[doc = "Start date for the test plan."] - #[serde( - rename = "startDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_date: Option<time::OffsetDateTime>, - #[doc = "State of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "Test outcome settings"] - #[serde( - rename = "testOutcomeSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_outcome_settings: Option<TestOutcomeSettings>, - #[doc = ""] - #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")] - pub updated_by: Option<IdentityRef>, - #[serde( - rename = "updatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub updated_date: Option<time::OffsetDateTime>, - #[doc = "URL of the test plan resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub area: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "buildDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_definition: Option<ShallowReference>, + #[doc = "Description of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "End date for the test plan."] + #[serde( + rename = "endDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub end_date: Option<time::OffsetDateTime>, + #[doc = "ID of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Iteration path of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iteration: Option<String>, + #[doc = "Name of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "previousBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub previous_build: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, + #[doc = "Reference to release environment resource."] + #[serde( + rename = "releaseEnvironmentDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment_definition: Option<ReleaseEnvironmentDefinitionReference>, + #[doc = "Revision of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "rootSuite", default, skip_serializing_if = "Option::is_none")] + pub root_suite: Option<ShallowReference>, + #[doc = "Start date for the test plan."] + #[serde( + rename = "startDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_date: Option<time::OffsetDateTime>, + #[doc = "State of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "Test outcome settings"] + #[serde( + rename = "testOutcomeSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_outcome_settings: Option<TestOutcomeSettings>, + #[doc = ""] + #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")] + pub updated_by: Option<IdentityRef>, + #[serde( + rename = "updatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub updated_date: Option<time::OffsetDateTime>, + #[doc = "URL of the test plan resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestPlan { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPlanCloneRequest { - #[doc = "The test plan resource."] - #[serde( - rename = "destinationTestPlan", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_test_plan: Option<TestPlan>, - #[doc = "Clone options for cloning the test suite."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub options: Option<CloneOptions>, - #[serde( - rename = "suiteIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub suite_ids: Vec<i32>, + #[doc = "The test plan resource."] + #[serde( + rename = "destinationTestPlan", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_test_plan: Option<TestPlan>, + #[doc = "Clone options for cloning the test suite."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub options: Option<CloneOptions>, + #[serde( + rename = "suiteIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub suite_ids: Vec<i32>, } impl TestPlanCloneRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPlanHubData { - #[serde( - rename = "selectedSuiteId", - default, - skip_serializing_if = "Option::is_none" - )] - pub selected_suite_id: Option<i32>, - #[doc = "The test plan resource."] - #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] - pub test_plan: Option<TestPlan>, - #[serde( - rename = "testPoints", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_points: Vec<TestPoint>, - #[serde( - rename = "testSuites", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_suites: Vec<TestSuite>, - #[serde( - rename = "totalTestPoints", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_test_points: Option<i32>, + #[serde( + rename = "selectedSuiteId", + default, + skip_serializing_if = "Option::is_none" + )] + pub selected_suite_id: Option<i32>, + #[doc = "The test plan resource."] + #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] + pub test_plan: Option<TestPlan>, + #[serde( + rename = "testPoints", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_points: Vec<TestPoint>, + #[serde( + rename = "testSuites", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_suites: Vec<TestSuite>, + #[serde( + rename = "totalTestPoints", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_test_points: Option<i32>, } impl TestPlanHubData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPlansWithSelection { - #[serde( - rename = "lastSelectedPlan", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_selected_plan: Option<i32>, - #[serde( - rename = "lastSelectedSuite", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_selected_suite: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub plans: Vec<TestPlan>, + #[serde( + rename = "lastSelectedPlan", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_selected_plan: Option<i32>, + #[serde( + rename = "lastSelectedSuite", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_selected_suite: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub plans: Vec<TestPlan>, } impl TestPlansWithSelection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test point."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPoint { - #[doc = ""] - #[serde( - rename = "assignedTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_to: Option<IdentityRef>, - #[doc = "Automated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub automated: Option<bool>, - #[doc = "Comment associated with test point."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<ShallowReference>, - #[doc = "Failure type of test point."] - #[serde( - rename = "failureType", - default, - skip_serializing_if = "Option::is_none" - )] - pub failure_type: Option<String>, - #[doc = "ID of the test point."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Last date when test point was reset to Active."] - #[serde( - rename = "lastResetToActive", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_reset_to_active: Option<time::OffsetDateTime>, - #[doc = "Last resolution state id of test point."] - #[serde( - rename = "lastResolutionStateId", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_resolution_state_id: Option<i32>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "lastResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_result: Option<ShallowReference>, - #[doc = "Last result details of test point."] - #[serde( - rename = "lastResultDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_result_details: Option<LastResultDetails>, - #[doc = "Last result state of test point."] - #[serde( - rename = "lastResultState", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_result_state: Option<String>, - #[doc = "LastRun build number of test point."] - #[serde( - rename = "lastRunBuildNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_run_build_number: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "lastTestRun", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_test_run: Option<ShallowReference>, - #[doc = ""] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<IdentityRef>, - #[doc = "Last updated date of test point."] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "Outcome of test point."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = "Revision number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "State of test point."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub suite: Option<ShallowReference>, - #[doc = "WorkItem reference Details."] - #[serde(rename = "testCase", default, skip_serializing_if = "Option::is_none")] - pub test_case: Option<WorkItemReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] - pub test_plan: Option<ShallowReference>, - #[doc = "Test point Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Work item properties of test point."] - #[serde( - rename = "workItemProperties", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_properties: Vec<serde_json::Value>, + #[doc = ""] + #[serde( + rename = "assignedTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_to: Option<IdentityRef>, + #[doc = "Automated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub automated: Option<bool>, + #[doc = "Comment associated with test point."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<ShallowReference>, + #[doc = "Failure type of test point."] + #[serde( + rename = "failureType", + default, + skip_serializing_if = "Option::is_none" + )] + pub failure_type: Option<String>, + #[doc = "ID of the test point."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Last date when test point was reset to Active."] + #[serde( + rename = "lastResetToActive", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_reset_to_active: Option<time::OffsetDateTime>, + #[doc = "Last resolution state id of test point."] + #[serde( + rename = "lastResolutionStateId", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_resolution_state_id: Option<i32>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "lastResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_result: Option<ShallowReference>, + #[doc = "Last result details of test point."] + #[serde( + rename = "lastResultDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_result_details: Option<LastResultDetails>, + #[doc = "Last result state of test point."] + #[serde( + rename = "lastResultState", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_result_state: Option<String>, + #[doc = "LastRun build number of test point."] + #[serde( + rename = "lastRunBuildNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_run_build_number: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "lastTestRun", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_test_run: Option<ShallowReference>, + #[doc = ""] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<IdentityRef>, + #[doc = "Last updated date of test point."] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "Outcome of test point."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = "Revision number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "State of test point."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub suite: Option<ShallowReference>, + #[doc = "WorkItem reference Details."] + #[serde(rename = "testCase", default, skip_serializing_if = "Option::is_none")] + pub test_case: Option<WorkItemReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] + pub test_plan: Option<ShallowReference>, + #[doc = "Test point Url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Work item properties of test point."] + #[serde( + rename = "workItemProperties", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_properties: Vec<serde_json::Value>, } impl TestPoint { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPointList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestPoint>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestPoint>, } impl TestPointList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPointReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<test_point_reference::State>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<test_point_reference::State>, } impl TestPointReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_point_reference { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "none")] - None, - #[serde(rename = "ready")] - Ready, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "notReady")] - NotReady, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "maxValue")] - MaxValue, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "none")] + None, + #[serde(rename = "ready")] + Ready, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "notReady")] + NotReady, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "maxValue")] + MaxValue, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPointsEvent { - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[serde( - rename = "testPoints", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_points: Vec<TestPointReference>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[serde( + rename = "testPoints", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_points: Vec<TestPointReference>, } impl TestPointsEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test point query class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPointsQuery { - #[doc = "Order by results."] - #[serde(rename = "orderBy", default, skip_serializing_if = "Option::is_none")] - pub order_by: Option<String>, - #[doc = "List of test points"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub points: Vec<TestPoint>, - #[doc = "Filter class for test point."] - #[serde( - rename = "pointsFilter", - default, - skip_serializing_if = "Option::is_none" - )] - pub points_filter: Option<PointsFilter>, - #[doc = "List of workitem fields to get."] - #[serde( - rename = "witFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub wit_fields: Vec<String>, + #[doc = "Order by results."] + #[serde(rename = "orderBy", default, skip_serializing_if = "Option::is_none")] + pub order_by: Option<String>, + #[doc = "List of test points"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub points: Vec<TestPoint>, + #[doc = "Filter class for test point."] + #[serde( + rename = "pointsFilter", + default, + skip_serializing_if = "Option::is_none" + )] + pub points_filter: Option<PointsFilter>, + #[doc = "List of workitem fields to get."] + #[serde( + rename = "witFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub wit_fields: Vec<String>, } impl TestPointsQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPointsUpdatedEvent { - #[serde(flatten)] - pub test_points_event: TestPointsEvent, + #[serde(flatten)] + pub test_points_event: TestPointsEvent, } impl TestPointsUpdatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Resolution State Details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResolutionState { - #[doc = "Test Resolution state Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Test Resolution State Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, + #[doc = "Test Resolution state Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Test Resolution State Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, } impl TestResolutionState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResult2 { - #[serde( - rename = "afnStripId", - default, - skip_serializing_if = "Option::is_none" - )] - pub afn_strip_id: Option<i32>, - #[serde( - rename = "computerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub computer_name: Option<String>, - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[serde( - rename = "dateCompleted", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_completed: Option<time::OffsetDateTime>, - #[serde( - rename = "dateStarted", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_started: Option<time::OffsetDateTime>, - #[serde( - rename = "effectivePointState", - default, - skip_serializing_if = "Option::is_none" - )] - pub effective_point_state: Option<String>, - #[serde( - rename = "failureType", - default, - skip_serializing_if = "Option::is_none" - )] - pub failure_type: Option<String>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "resetCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub reset_count: Option<i32>, - #[serde( - rename = "resolutionStateId", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_state_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] - pub run_by: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde( - rename = "testCaseRefId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_ref_id: Option<i32>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "afnStripId", + default, + skip_serializing_if = "Option::is_none" + )] + pub afn_strip_id: Option<i32>, + #[serde( + rename = "computerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub computer_name: Option<String>, + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[serde( + rename = "dateCompleted", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_completed: Option<time::OffsetDateTime>, + #[serde( + rename = "dateStarted", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_started: Option<time::OffsetDateTime>, + #[serde( + rename = "effectivePointState", + default, + skip_serializing_if = "Option::is_none" + )] + pub effective_point_state: Option<String>, + #[serde( + rename = "failureType", + default, + skip_serializing_if = "Option::is_none" + )] + pub failure_type: Option<String>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "resetCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub reset_count: Option<i32>, + #[serde( + rename = "resolutionStateId", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_state_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] + pub run_by: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde( + rename = "testCaseRefId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_ref_id: Option<i32>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl TestResult2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultAcrossProjectResponse { - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[doc = ""] - #[serde( - rename = "testResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result: Option<LegacyTestCaseResult>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[doc = ""] + #[serde( + rename = "testResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result: Option<LegacyTestCaseResult>, } impl TestResultAcrossProjectResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultAttachment { - #[serde( - rename = "actionPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_path: Option<String>, - #[serde( - rename = "attachmentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub attachment_type: Option<test_result_attachment::AttachmentType>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[serde( - rename = "downloadQueryString", - default, - skip_serializing_if = "Option::is_none" - )] - pub download_query_string: Option<String>, - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde( - rename = "isComplete", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_complete: Option<bool>, - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub length: Option<i64>, - #[serde(rename = "sessionId", default, skip_serializing_if = "Option::is_none")] - pub session_id: Option<i32>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, - #[serde(rename = "tmiRunId", default, skip_serializing_if = "Option::is_none")] - pub tmi_run_id: Option<String>, + #[serde( + rename = "actionPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_path: Option<String>, + #[serde( + rename = "attachmentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub attachment_type: Option<test_result_attachment::AttachmentType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[serde( + rename = "downloadQueryString", + default, + skip_serializing_if = "Option::is_none" + )] + pub download_query_string: Option<String>, + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde( + rename = "isComplete", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_complete: Option<bool>, + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub length: Option<i64>, + #[serde(rename = "sessionId", default, skip_serializing_if = "Option::is_none")] + pub session_id: Option<i32>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, + #[serde(rename = "tmiRunId", default, skip_serializing_if = "Option::is_none")] + pub tmi_run_id: Option<String>, } impl TestResultAttachment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_result_attachment { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AttachmentType { - #[serde(rename = "generalAttachment")] - GeneralAttachment, - #[serde(rename = "codeCoverage")] - CodeCoverage, - #[serde(rename = "consoleLog")] - ConsoleLog, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AttachmentType { + #[serde(rename = "generalAttachment")] + GeneralAttachment, + #[serde(rename = "codeCoverage")] + CodeCoverage, + #[serde(rename = "consoleLog")] + ConsoleLog, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultAttachmentIdentity { - #[serde( - rename = "attachmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub attachment_id: Option<i32>, - #[serde(rename = "sessionId", default, skip_serializing_if = "Option::is_none")] - pub session_id: Option<i32>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "attachmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub attachment_id: Option<i32>, + #[serde(rename = "sessionId", default, skip_serializing_if = "Option::is_none")] + pub session_id: Option<i32>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl TestResultAttachmentIdentity { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultCreateModel { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub area: Option<ShallowReference>, - #[serde( - rename = "associatedWorkItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub associated_work_items: Vec<i32>, - #[serde( - rename = "automatedTestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_id: Option<String>, - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[serde( - rename = "automatedTestStorage", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_storage: Option<String>, - #[serde( - rename = "automatedTestType", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_type: Option<String>, - #[serde( - rename = "automatedTestTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_type_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none" - )] - pub completed_date: Option<String>, - #[serde( - rename = "computerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub computer_name: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<ShallowReference>, - #[serde( - rename = "customFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub custom_fields: Vec<CustomTestField>, - #[serde( - rename = "durationInMs", - default, - skip_serializing_if = "Option::is_none" - )] - pub duration_in_ms: Option<String>, - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[serde( - rename = "failureType", - default, - skip_serializing_if = "Option::is_none" - )] - pub failure_type: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[serde( - rename = "resolutionState", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_state: Option<String>, - #[doc = ""] - #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] - pub run_by: Option<IdentityRef>, - #[serde( - rename = "stackTrace", - default, - skip_serializing_if = "Option::is_none" - )] - pub stack_trace: Option<String>, - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none" - )] - pub started_date: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testCase", default, skip_serializing_if = "Option::is_none")] - pub test_case: Option<ShallowReference>, - #[serde( - rename = "testCasePriority", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_priority: Option<String>, - #[serde( - rename = "testCaseTitle", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_title: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testPoint", default, skip_serializing_if = "Option::is_none")] - pub test_point: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub area: Option<ShallowReference>, + #[serde( + rename = "associatedWorkItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub associated_work_items: Vec<i32>, + #[serde( + rename = "automatedTestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_id: Option<String>, + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[serde( + rename = "automatedTestStorage", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_storage: Option<String>, + #[serde( + rename = "automatedTestType", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_type: Option<String>, + #[serde( + rename = "automatedTestTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_type_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none" + )] + pub completed_date: Option<String>, + #[serde( + rename = "computerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub computer_name: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<ShallowReference>, + #[serde( + rename = "customFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub custom_fields: Vec<CustomTestField>, + #[serde( + rename = "durationInMs", + default, + skip_serializing_if = "Option::is_none" + )] + pub duration_in_ms: Option<String>, + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[serde( + rename = "failureType", + default, + skip_serializing_if = "Option::is_none" + )] + pub failure_type: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[serde( + rename = "resolutionState", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_state: Option<String>, + #[doc = ""] + #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] + pub run_by: Option<IdentityRef>, + #[serde( + rename = "stackTrace", + default, + skip_serializing_if = "Option::is_none" + )] + pub stack_trace: Option<String>, + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none" + )] + pub started_date: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testCase", default, skip_serializing_if = "Option::is_none")] + pub test_case: Option<ShallowReference>, + #[serde( + rename = "testCasePriority", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_priority: Option<String>, + #[serde( + rename = "testCaseTitle", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_title: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testPoint", default, skip_serializing_if = "Option::is_none")] + pub test_point: Option<ShallowReference>, } impl TestResultCreateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultDocument { - #[doc = "Class representing a reference to an operation."] - #[serde( - rename = "operationReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_reference: Option<TestOperationReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub payload: Option<TestResultPayload>, + #[doc = "Class representing a reference to an operation."] + #[serde( + rename = "operationReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_reference: Option<TestOperationReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub payload: Option<TestResultPayload>, } impl TestResultDocument { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The test failure type resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TestResultFailureType { - #[doc = "ID of the test failure type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the test failure type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, -} -impl TestResultFailureType { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The test failure type request model"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TestResultFailureTypeRequestModel { - #[doc = "Name of the test failure type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, -} -impl TestResultFailureTypeRequestModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultFailuresAnalysis { - #[doc = ""] - #[serde( - rename = "existingFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub existing_failures: Option<TestFailureDetails>, - #[doc = ""] - #[serde( - rename = "fixedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub fixed_tests: Option<TestFailureDetails>, - #[doc = ""] - #[serde( - rename = "newFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_failures: Option<TestFailureDetails>, + #[doc = ""] + #[serde( + rename = "existingFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub existing_failures: Option<TestFailureDetails>, + #[doc = ""] + #[serde( + rename = "fixedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub fixed_tests: Option<TestFailureDetails>, + #[doc = ""] + #[serde( + rename = "newFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_failures: Option<TestFailureDetails>, } impl TestResultFailuresAnalysis { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultHistory { - #[serde( - rename = "groupByField", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_field: Option<String>, - #[serde( - rename = "resultsForGroup", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results_for_group: Vec<TestResultHistoryDetailsForGroup>, + #[serde( + rename = "groupByField", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_field: Option<String>, + #[serde( + rename = "resultsForGroup", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results_for_group: Vec<TestResultHistoryDetailsForGroup>, } impl TestResultHistory { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultHistoryDetailsForGroup { - #[serde( - rename = "groupByValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_value: Option<serde_json::Value>, - #[doc = "Represents a test result."] - #[serde( - rename = "latestResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_result: Option<TestCaseResult>, + #[serde( + rename = "groupByValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_value: Option<serde_json::Value>, + #[doc = "Represents a test result."] + #[serde( + rename = "latestResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_result: Option<TestCaseResult>, } impl TestResultHistoryDetailsForGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "List of test results filtered on the basis of GroupByValue"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultHistoryForGroup { - #[doc = "Display name of the group."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Name or Id of the group identifier by which results are grouped together."] - #[serde( - rename = "groupByValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_value: Option<String>, - #[doc = "List of results for GroupByValue"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<TestCaseResult>, + #[doc = "Display name of the group."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Name or Id of the group identifier by which results are grouped together."] + #[serde( + rename = "groupByValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_value: Option<String>, + #[doc = "List of results for GroupByValue"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<TestCaseResult>, } impl TestResultHistoryForGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a Meta Data of a test result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultMetaData { - #[doc = "AutomatedTestName of test result."] - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[doc = "AutomatedTestStorage of test result."] - #[serde( - rename = "automatedTestStorage", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_storage: Option<String>, - #[doc = "List of Flaky Identifier for TestCaseReferenceId"] - #[serde( - rename = "flakyIdentifiers", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub flaky_identifiers: Vec<TestFlakyIdentifier>, - #[doc = "Owner of test result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[doc = "Priority of test result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option<i32>, - #[doc = "ID of TestCaseReference."] - #[serde( - rename = "testCaseReferenceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_reference_id: Option<i32>, - #[doc = "TestCaseTitle of test result."] - #[serde( - rename = "testCaseTitle", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_title: Option<String>, + #[doc = "AutomatedTestName of test result."] + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[doc = "AutomatedTestStorage of test result."] + #[serde( + rename = "automatedTestStorage", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_storage: Option<String>, + #[doc = "List of Flaky Identifier for TestCaseReferenceId"] + #[serde( + rename = "flakyIdentifiers", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub flaky_identifiers: Vec<TestFlakyIdentifier>, + #[doc = "Owner of test result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[doc = "Priority of test result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub priority: Option<i32>, + #[doc = "ID of TestCaseReference."] + #[serde( + rename = "testCaseReferenceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_reference_id: Option<i32>, + #[doc = "TestCaseTitle of test result."] + #[serde( + rename = "testCaseTitle", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_title: Option<String>, } impl TestResultMetaData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a TestResultMetaData Input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultMetaDataUpdateInput { - #[doc = "List of Flaky Identifiers"] - #[serde( - rename = "flakyIdentifiers", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub flaky_identifiers: Vec<TestFlakyIdentifier>, + #[doc = "List of Flaky Identifiers"] + #[serde( + rename = "flakyIdentifiers", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub flaky_identifiers: Vec<TestFlakyIdentifier>, } impl TestResultMetaDataUpdateInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultMetaDataUpdateResponse { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<String>, } impl TestResultMetaDataUpdateResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultModelBase { - #[doc = "Comment in result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Time when execution completed(UTC)."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Duration of execution."] - #[serde( - rename = "durationInMs", - default, - skip_serializing_if = "Option::is_none" - )] - pub duration_in_ms: Option<f64>, - #[doc = "Error message in result."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "Test outcome of result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = "Time when execution started(UTC)."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_date: Option<time::OffsetDateTime>, + #[doc = "Comment in result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Time when execution completed(UTC)."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Duration of execution."] + #[serde( + rename = "durationInMs", + default, + skip_serializing_if = "Option::is_none" + )] + pub duration_in_ms: Option<f64>, + #[doc = "Error message in result."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "Test outcome of result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = "Time when execution started(UTC)."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_date: Option<time::OffsetDateTime>, } impl TestResultModelBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultParameter { - #[serde( - rename = "actionPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_path: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub actual: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub expected: Vec<String>, - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[serde( - rename = "parameterName", - default, - skip_serializing_if = "Option::is_none" - )] - pub parameter_name: Option<String>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "actionPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_path: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub actual: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub expected: Vec<String>, + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[serde( + rename = "parameterName", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_name: Option<String>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl TestResultParameter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test parameter information in a test iteration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultParameterModel { - #[doc = "Test step path where parameter is referenced."] - #[serde( - rename = "actionPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_path: Option<String>, - #[doc = "Iteration ID."] - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[doc = "Name of parameter."] - #[serde( - rename = "parameterName", - default, - skip_serializing_if = "Option::is_none" - )] - pub parameter_name: Option<String>, - #[doc = "This is step Id of test case. For shared step, it is step Id of shared step in test case workitem; step Id in shared step. Example: TestCase workitem has two steps: 1) Normal step with Id = 1 2) Shared Step with Id = 2. Inside shared step: a) Normal Step with Id = 1 Value for StepIdentifier for First step: \"1\" Second step: \"2;1\""] - #[serde( - rename = "stepIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub step_identifier: Option<String>, - #[doc = "Url of test parameter. Deprecated in hosted environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Value of parameter."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Test step path where parameter is referenced."] + #[serde( + rename = "actionPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_path: Option<String>, + #[doc = "Iteration ID."] + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[doc = "Name of parameter."] + #[serde( + rename = "parameterName", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_name: Option<String>, + #[doc = "This is step Id of test case. For shared step, it is step Id of shared step in test case workitem; step Id in shared step. Example: TestCase workitem has two steps: 1) Normal step with Id = 1 2) Shared Step with Id = 2. Inside shared step: a) Normal Step with Id = 1 Value for StepIdentifier for First step: \"1\" Second step: \"2;1\""] + #[serde( + rename = "stepIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub step_identifier: Option<String>, + #[doc = "Url of test parameter. Deprecated in hosted environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Value of parameter."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl TestResultParameterModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultPayload { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stream: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stream: Option<String>, } impl TestResultPayload { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultReset2 { - #[serde( - rename = "auditIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub audit_identity: Option<String>, - #[serde( - rename = "dateModified", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_modified: Option<time::OffsetDateTime>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[serde( - rename = "testResultRV", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_result_rv: Vec<String>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "auditIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub audit_identity: Option<String>, + #[serde( + rename = "dateModified", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_modified: Option<time::OffsetDateTime>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[serde( + rename = "testResultRV", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_result_rv: Vec<String>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl TestResultReset2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultSummary { - #[doc = ""] - #[serde( - rename = "aggregatedResultsAnalysis", - default, - skip_serializing_if = "Option::is_none" - )] - pub aggregated_results_analysis: Option<AggregatedResultsAnalysis>, - #[serde( - rename = "noConfigRunsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub no_config_runs_count: Option<i32>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde( - rename = "teamProject", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project: Option<TeamProjectReference>, - #[doc = ""] - #[serde( - rename = "testFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_failures: Option<TestFailuresAnalysis>, - #[doc = ""] - #[serde( - rename = "testResultsContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_results_context: Option<TestResultsContext>, - #[serde( - rename = "totalRunsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_runs_count: Option<i32>, + #[doc = ""] + #[serde( + rename = "aggregatedResultsAnalysis", + default, + skip_serializing_if = "Option::is_none" + )] + pub aggregated_results_analysis: Option<AggregatedResultsAnalysis>, + #[serde( + rename = "noConfigRunsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub no_config_runs_count: Option<i32>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde( + rename = "teamProject", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project: Option<TeamProjectReference>, + #[doc = ""] + #[serde( + rename = "testFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_failures: Option<TestFailuresAnalysis>, + #[doc = ""] + #[serde( + rename = "testResultsContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_results_context: Option<TestResultsContext>, + #[serde( + rename = "totalRunsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_runs_count: Option<i32>, } impl TestResultSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultTrendFilter { - #[serde( - rename = "branchNames", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub branch_names: Vec<String>, - #[serde( - rename = "buildCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_count: Option<i32>, - #[serde( - rename = "definitionIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub definition_ids: Vec<i32>, - #[serde( - rename = "envDefinitionIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub env_definition_ids: Vec<i32>, - #[serde( - rename = "maxCompleteDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub max_complete_date: Option<time::OffsetDateTime>, - #[serde( - rename = "publishContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub publish_context: Option<String>, - #[serde( - rename = "testRunTitles", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_run_titles: Vec<String>, - #[serde(rename = "trendDays", default, skip_serializing_if = "Option::is_none")] - pub trend_days: Option<i32>, + #[serde( + rename = "branchNames", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub branch_names: Vec<String>, + #[serde( + rename = "buildCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_count: Option<i32>, + #[serde( + rename = "definitionIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub definition_ids: Vec<i32>, + #[serde( + rename = "envDefinitionIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub env_definition_ids: Vec<i32>, + #[serde( + rename = "maxCompleteDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub max_complete_date: Option<time::OffsetDateTime>, + #[serde( + rename = "publishContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub publish_context: Option<String>, + #[serde( + rename = "testRunTitles", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_run_titles: Vec<String>, + #[serde(rename = "trendDays", default, skip_serializing_if = "Option::is_none")] + pub trend_days: Option<i32>, } impl TestResultTrendFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsContext { - #[doc = "Reference to a build."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<BuildReference>, - #[serde( - rename = "contextType", - default, - skip_serializing_if = "Option::is_none" - )] - pub context_type: Option<test_results_context::ContextType>, - #[doc = "Pipeline reference"] - #[serde( - rename = "pipelineReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub pipeline_reference: Option<PipelineReference>, - #[doc = "Reference to a release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ReleaseReference>, + #[doc = "Reference to a build."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<BuildReference>, + #[serde( + rename = "contextType", + default, + skip_serializing_if = "Option::is_none" + )] + pub context_type: Option<test_results_context::ContextType>, + #[doc = "Pipeline reference"] + #[serde( + rename = "pipelineReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub pipeline_reference: Option<PipelineReference>, + #[doc = "Reference to a release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ReleaseReference>, } impl TestResultsContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_results_context { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ContextType { - #[serde(rename = "build")] - Build, - #[serde(rename = "release")] - Release, - #[serde(rename = "pipeline")] - Pipeline, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ContextType { + #[serde(rename = "build")] + Build, + #[serde(rename = "release")] + Release, + #[serde(rename = "pipeline")] + Pipeline, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsDetails { - #[serde( - rename = "groupByField", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_field: Option<String>, - #[serde( - rename = "resultsForGroup", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results_for_group: Vec<TestResultsDetailsForGroup>, + #[serde( + rename = "groupByField", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_field: Option<String>, + #[serde( + rename = "resultsForGroup", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results_for_group: Vec<TestResultsDetailsForGroup>, } impl TestResultsDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsDetailsForGroup { - #[serde( - rename = "groupByValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_value: Option<serde_json::Value>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<TestCaseResult>, - #[serde( - rename = "resultsCountByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_count_by_outcome: Option<serde_json::Value>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, + #[serde( + rename = "groupByValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_value: Option<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<TestCaseResult>, + #[serde( + rename = "resultsCountByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_count_by_outcome: Option<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, } impl TestResultsDetailsForGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsEx2 { - #[serde(rename = "bitValue", default, skip_serializing_if = "Option::is_none")] - pub bit_value: Option<bool>, - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[serde( - rename = "dateTimeValue", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_time_value: Option<time::OffsetDateTime>, - #[serde(rename = "fieldId", default, skip_serializing_if = "Option::is_none")] - pub field_id: Option<i32>, - #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] - pub field_name: Option<String>, - #[serde( - rename = "floatValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub float_value: Option<f64>, - #[serde(rename = "guidValue", default, skip_serializing_if = "Option::is_none")] - pub guid_value: Option<String>, - #[serde(rename = "intValue", default, skip_serializing_if = "Option::is_none")] - pub int_value: Option<i32>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "stringValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub string_value: Option<String>, - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde(rename = "bitValue", default, skip_serializing_if = "Option::is_none")] + pub bit_value: Option<bool>, + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[serde( + rename = "dateTimeValue", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_time_value: Option<time::OffsetDateTime>, + #[serde(rename = "fieldId", default, skip_serializing_if = "Option::is_none")] + pub field_id: Option<i32>, + #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] + pub field_name: Option<String>, + #[serde( + rename = "floatValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub float_value: Option<f64>, + #[serde(rename = "guidValue", default, skip_serializing_if = "Option::is_none")] + pub guid_value: Option<String>, + #[serde(rename = "intValue", default, skip_serializing_if = "Option::is_none")] + pub int_value: Option<i32>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "stringValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub string_value: Option<String>, + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl TestResultsEx2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsGroupsForBuild { - #[doc = "BuildId for which groupby result is fetched."] - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option<i32>, - #[doc = "The group by results"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub fields: Vec<FieldDetailsForTestResults>, + #[doc = "BuildId for which groupby result is fetched."] + #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] + pub build_id: Option<i32>, + #[doc = "The group by results"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub fields: Vec<FieldDetailsForTestResults>, } impl TestResultsGroupsForBuild { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsGroupsForRelease { - #[doc = "The group by results"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub fields: Vec<FieldDetailsForTestResults>, - #[doc = "Release Environment Id for which groupby result is fetched."] - #[serde( - rename = "releaseEnvId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_id: Option<i32>, - #[doc = "ReleaseId for which groupby result is fetched."] - #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] - pub release_id: Option<i32>, + #[doc = "The group by results"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub fields: Vec<FieldDetailsForTestResults>, + #[doc = "Release Environment Id for which groupby result is fetched."] + #[serde( + rename = "releaseEnvId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_id: Option<i32>, + #[doc = "ReleaseId for which groupby result is fetched."] + #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] + pub release_id: Option<i32>, } impl TestResultsGroupsForRelease { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsQuery { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub fields: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<TestCaseResult>, - #[doc = ""] - #[serde( - rename = "resultsFilter", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_filter: Option<ResultsFilter>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub fields: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<TestCaseResult>, + #[doc = ""] + #[serde( + rename = "resultsFilter", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_filter: Option<ResultsFilter>, } impl TestResultsQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsSettings { - #[doc = ""] - #[serde( - rename = "flakySettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub flaky_settings: Option<FlakySettings>, - #[doc = ""] - #[serde( - rename = "newTestResultLoggingSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_test_result_logging_settings: Option<NewTestResultLoggingSettings>, + #[doc = ""] + #[serde( + rename = "flakySettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub flaky_settings: Option<FlakySettings>, + #[doc = ""] + #[serde( + rename = "newTestResultLoggingSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_test_result_logging_settings: Option<NewTestResultLoggingSettings>, } impl TestResultsSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsUpdateSettings { - #[doc = ""] - #[serde( - rename = "flakySettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub flaky_settings: Option<FlakySettings>, - #[doc = ""] - #[serde( - rename = "newTestResultLoggingSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_test_result_logging_settings: Option<NewTestResultLoggingSettings>, + #[doc = ""] + #[serde( + rename = "flakySettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub flaky_settings: Option<FlakySettings>, + #[doc = ""] + #[serde( + rename = "newTestResultLoggingSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_test_result_logging_settings: Option<NewTestResultLoggingSettings>, } impl TestResultsUpdateSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsWithWatermark { - #[serde( - rename = "changedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub changed_date: Option<time::OffsetDateTime>, - #[serde( - rename = "pointsResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub points_results: Vec<PointsResults2>, - #[serde(rename = "resultId", default, skip_serializing_if = "Option::is_none")] - pub result_id: Option<i32>, - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option<i32>, + #[serde( + rename = "changedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub changed_date: Option<time::OffsetDateTime>, + #[serde( + rename = "pointsResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub points_results: Vec<PointsResults2>, + #[serde(rename = "resultId", default, skip_serializing_if = "Option::is_none")] + pub result_id: Option<i32>, + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option<i32>, } impl TestResultsWithWatermark { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test run details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRun { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<ShallowReference>, - #[doc = "BuildConfiguration Details."] - #[serde( - rename = "buildConfiguration", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_configuration: Option<BuildConfiguration>, - #[doc = "Comments entered by those analyzing the run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Completed date time of the run."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Test Run Controller."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub controller: Option<String>, - #[doc = "Test Run CreatedDate."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "List of Custom Fields for TestRun."] - #[serde( - rename = "customFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub custom_fields: Vec<CustomTestField>, - #[doc = "Drop Location for the test Run."] - #[serde( - rename = "dropLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub drop_location: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlAutEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_aut_environment: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_environment: Option<ShallowReference>, - #[doc = "This is a temporary class to provide the details for the test run environment."] - #[serde( - rename = "dtlEnvironmentCreationDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_environment_creation_details: Option<DtlEnvironmentDetails>, - #[doc = "Due date and time for test run."] - #[serde( - rename = "dueDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub due_date: Option<time::OffsetDateTime>, - #[doc = "Error message associated with the run."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "This class is used to provide the filters used for discovery"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option<RunFilter>, - #[doc = "ID of the test run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Number of Incomplete Tests."] - #[serde( - rename = "incompleteTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub incomplete_tests: Option<i32>, - #[doc = "true if test run is automated, false otherwise."] - #[serde( - rename = "isAutomated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_automated: Option<bool>, - #[doc = "The iteration to which the run belongs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub iteration: Option<String>, - #[doc = ""] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<IdentityRef>, - #[doc = "Last updated date and time"] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "Name of the test run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Number of Not Applicable Tests."] - #[serde( - rename = "notApplicableTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub not_applicable_tests: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Number of passed tests in the run"] - #[serde( - rename = "passedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub passed_tests: Option<i32>, - #[doc = "Phase/State for the testRun."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub phase: Option<String>, - #[doc = "Pipeline reference"] - #[serde( - rename = "pipelineReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub pipeline_reference: Option<PipelineReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub plan: Option<ShallowReference>, - #[doc = "Post Process State."] - #[serde( - rename = "postProcessState", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_process_state: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, - #[doc = "Reference to a release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ReleaseReference>, - #[doc = "Release Environment Uri for TestRun."] - #[serde( - rename = "releaseEnvironmentUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment_uri: Option<String>, - #[doc = "Release Uri for TestRun."] - #[serde( - rename = "releaseUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_uri: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "RunSummary by outcome."] - #[serde( - rename = "runStatistics", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub run_statistics: Vec<RunStatistic>, - #[doc = "Start date time of the run."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_date: Option<time::OffsetDateTime>, - #[doc = "The state of the run. Type TestRunState Valid states - Unspecified ,NotStarted, InProgress, Completed, Waiting, Aborted, NeedsInvestigation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "TestRun Substate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub substate: Option<test_run::Substate>, - #[doc = "Tags attached with this test run."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<TestTag>, - #[doc = "Test environment Detail."] - #[serde( - rename = "testEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_environment: Option<TestEnvironment>, - #[serde( - rename = "testMessageLogId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_message_log_id: Option<i32>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "testSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings: Option<ShallowReference>, - #[doc = "Total tests in the run"] - #[serde( - rename = "totalTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_tests: Option<i32>, - #[doc = "Number of failed tests in the run."] - #[serde( - rename = "unanalyzedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub unanalyzed_tests: Option<i32>, - #[doc = "Url of the test run"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Web Access Url for TestRun."] - #[serde( - rename = "webAccessUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub web_access_url: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<ShallowReference>, + #[doc = "BuildConfiguration Details."] + #[serde( + rename = "buildConfiguration", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_configuration: Option<BuildConfiguration>, + #[doc = "Comments entered by those analyzing the run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Completed date time of the run."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Test Run Controller."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub controller: Option<String>, + #[doc = "Test Run CreatedDate."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "List of Custom Fields for TestRun."] + #[serde( + rename = "customFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub custom_fields: Vec<CustomTestField>, + #[doc = "Drop Location for the test Run."] + #[serde( + rename = "dropLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub drop_location: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlAutEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_aut_environment: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_environment: Option<ShallowReference>, + #[doc = "This is a temporary class to provide the details for the test run environment."] + #[serde( + rename = "dtlEnvironmentCreationDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_environment_creation_details: Option<DtlEnvironmentDetails>, + #[doc = "Due date and time for test run."] + #[serde( + rename = "dueDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub due_date: Option<time::OffsetDateTime>, + #[doc = "Error message associated with the run."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "This class is used to provide the filters used for discovery"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option<RunFilter>, + #[doc = "ID of the test run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Number of Incomplete Tests."] + #[serde( + rename = "incompleteTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub incomplete_tests: Option<i32>, + #[doc = "true if test run is automated, false otherwise."] + #[serde( + rename = "isAutomated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_automated: Option<bool>, + #[doc = "The iteration to which the run belongs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iteration: Option<String>, + #[doc = ""] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<IdentityRef>, + #[doc = "Last updated date and time"] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "Name of the test run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Number of Not Applicable Tests."] + #[serde( + rename = "notApplicableTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub not_applicable_tests: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Number of passed tests in the run"] + #[serde( + rename = "passedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub passed_tests: Option<i32>, + #[doc = "Phase/State for the testRun."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phase: Option<String>, + #[doc = "Pipeline reference"] + #[serde( + rename = "pipelineReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub pipeline_reference: Option<PipelineReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plan: Option<ShallowReference>, + #[doc = "Post Process State."] + #[serde( + rename = "postProcessState", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_process_state: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, + #[doc = "Reference to a release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ReleaseReference>, + #[doc = "Release Environment Uri for TestRun."] + #[serde( + rename = "releaseEnvironmentUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment_uri: Option<String>, + #[doc = "Release Uri for TestRun."] + #[serde( + rename = "releaseUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_uri: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "RunSummary by outcome."] + #[serde( + rename = "runStatistics", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub run_statistics: Vec<RunStatistic>, + #[doc = "Start date time of the run."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_date: Option<time::OffsetDateTime>, + #[doc = "The state of the run. Type TestRunState Valid states - Unspecified ,NotStarted, InProgress, Completed, Waiting, Aborted, NeedsInvestigation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "TestRun Substate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub substate: Option<test_run::Substate>, + #[doc = "Tags attached with this test run."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<TestTag>, + #[doc = "Test environment Detail."] + #[serde( + rename = "testEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_environment: Option<TestEnvironment>, + #[serde( + rename = "testMessageLogId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_message_log_id: Option<i32>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "testSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings: Option<ShallowReference>, + #[doc = "Total tests in the run"] + #[serde( + rename = "totalTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_tests: Option<i32>, + #[doc = "Number of failed tests in the run."] + #[serde( + rename = "unanalyzedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub unanalyzed_tests: Option<i32>, + #[doc = "Url of the test run"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Web Access Url for TestRun."] + #[serde( + rename = "webAccessUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub web_access_url: Option<String>, } impl TestRun { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_run { - use super::*; - #[doc = "TestRun Substate."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Substate { - #[serde(rename = "none")] - None, - #[serde(rename = "creatingEnvironment")] - CreatingEnvironment, - #[serde(rename = "runningTests")] - RunningTests, - #[serde(rename = "canceledByUser")] - CanceledByUser, - #[serde(rename = "abortedBySystem")] - AbortedBySystem, - #[serde(rename = "timedOut")] - TimedOut, - #[serde(rename = "pendingAnalysis")] - PendingAnalysis, - #[serde(rename = "analyzed")] - Analyzed, - #[serde(rename = "cancellationInProgress")] - CancellationInProgress, - } + use super::*; + #[doc = "TestRun Substate."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Substate { + #[serde(rename = "none")] + None, + #[serde(rename = "creatingEnvironment")] + CreatingEnvironment, + #[serde(rename = "runningTests")] + RunningTests, + #[serde(rename = "canceledByUser")] + CanceledByUser, + #[serde(rename = "abortedBySystem")] + AbortedBySystem, + #[serde(rename = "timedOut")] + TimedOut, + #[serde(rename = "pendingAnalysis")] + PendingAnalysis, + #[serde(rename = "analyzed")] + Analyzed, + #[serde(rename = "cancellationInProgress")] + CancellationInProgress, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRun2 { - #[serde( - rename = "buildConfigurationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_configuration_id: Option<i32>, - #[serde( - rename = "buildNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_number: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde( - rename = "completeDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub complete_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub controller: Option<String>, - #[serde( - rename = "coverageId", - default, - skip_serializing_if = "Option::is_none" - )] - pub coverage_id: Option<i32>, - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[serde( - rename = "deletedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub deleted_on: Option<time::OffsetDateTime>, - #[serde( - rename = "dropLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub drop_location: Option<String>, - #[serde( - rename = "dueDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub due_date: Option<time::OffsetDateTime>, - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[serde( - rename = "incompleteTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub incomplete_tests: Option<i32>, - #[serde( - rename = "isAutomated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_automated: Option<bool>, - #[serde(rename = "isBvt", default, skip_serializing_if = "Option::is_none")] - pub is_bvt: Option<bool>, - #[serde( - rename = "isMigrated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_migrated: Option<bool>, - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<String>, - #[serde( - rename = "legacySharePath", - default, - skip_serializing_if = "Option::is_none" - )] - pub legacy_share_path: Option<String>, - #[serde( - rename = "maxReservedResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_reserved_result_id: Option<i32>, - #[serde( - rename = "notApplicableTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub not_applicable_tests: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[serde( - rename = "passedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub passed_tests: Option<i32>, - #[serde( - rename = "postProcessState", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_process_state: Option<String>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "publicTestSettingsId", - default, - skip_serializing_if = "Option::is_none" - )] - pub public_test_settings_id: Option<i32>, - #[serde( - rename = "releaseEnvironmentUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment_uri: Option<String>, - #[serde( - rename = "releaseUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_uri: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[serde( - rename = "startDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde( - rename = "testEnvironmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_environment_id: Option<String>, - #[serde( - rename = "testMessageLogId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_message_log_id: Option<i32>, - #[serde( - rename = "testPlanId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_plan_id: Option<i32>, - #[serde( - rename = "testRunContextId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_run_context_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, - #[serde( - rename = "testSettingsId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[serde( - rename = "totalTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_tests: Option<i32>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[serde( - rename = "unanalyzedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub unanalyzed_tests: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i32>, + #[serde( + rename = "buildConfigurationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_configuration_id: Option<i32>, + #[serde( + rename = "buildNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_number: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde( + rename = "completeDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub complete_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub controller: Option<String>, + #[serde( + rename = "coverageId", + default, + skip_serializing_if = "Option::is_none" + )] + pub coverage_id: Option<i32>, + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[serde( + rename = "deletedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub deleted_on: Option<time::OffsetDateTime>, + #[serde( + rename = "dropLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub drop_location: Option<String>, + #[serde( + rename = "dueDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub due_date: Option<time::OffsetDateTime>, + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[serde( + rename = "incompleteTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub incomplete_tests: Option<i32>, + #[serde( + rename = "isAutomated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_automated: Option<bool>, + #[serde(rename = "isBvt", default, skip_serializing_if = "Option::is_none")] + pub is_bvt: Option<bool>, + #[serde( + rename = "isMigrated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_migrated: Option<bool>, + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<String>, + #[serde( + rename = "legacySharePath", + default, + skip_serializing_if = "Option::is_none" + )] + pub legacy_share_path: Option<String>, + #[serde( + rename = "maxReservedResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_reserved_result_id: Option<i32>, + #[serde( + rename = "notApplicableTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub not_applicable_tests: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[serde( + rename = "passedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub passed_tests: Option<i32>, + #[serde( + rename = "postProcessState", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_process_state: Option<String>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "publicTestSettingsId", + default, + skip_serializing_if = "Option::is_none" + )] + pub public_test_settings_id: Option<i32>, + #[serde( + rename = "releaseEnvironmentUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment_uri: Option<String>, + #[serde( + rename = "releaseUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_uri: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[serde( + rename = "startDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde( + rename = "testEnvironmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_environment_id: Option<String>, + #[serde( + rename = "testMessageLogId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_message_log_id: Option<i32>, + #[serde( + rename = "testPlanId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_plan_id: Option<i32>, + #[serde( + rename = "testRunContextId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_run_context_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, + #[serde( + rename = "testSettingsId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[serde( + rename = "totalTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_tests: Option<i32>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[serde( + rename = "unanalyzedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub unanalyzed_tests: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i32>, } impl TestRun2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunCanceledEvent { - #[serde(flatten)] - pub test_run_event: TestRunEvent, + #[serde(flatten)] + pub test_run_event: TestRunEvent, } impl TestRunCanceledEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunContext2 { - #[serde( - rename = "buildRefId", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_ref_id: Option<i32>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "releaseRefId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_ref_id: Option<i32>, - #[serde( - rename = "sourceWorkflow", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_workflow: Option<String>, - #[serde( - rename = "testRunContextId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_run_context_id: Option<i32>, + #[serde( + rename = "buildRefId", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_ref_id: Option<i32>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "releaseRefId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_ref_id: Option<i32>, + #[serde( + rename = "sourceWorkflow", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_workflow: Option<String>, + #[serde( + rename = "testRunContextId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_run_context_id: Option<i32>, } impl TestRunContext2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Run Code Coverage Details"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunCoverage { - #[doc = "Last Error"] - #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] - pub last_error: Option<String>, - #[doc = "List of Modules Coverage"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub modules: Vec<ModuleCoverage>, - #[doc = "State"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] - pub test_run: Option<ShallowReference>, + #[doc = "Last Error"] + #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] + pub last_error: Option<String>, + #[doc = "List of Modules Coverage"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub modules: Vec<ModuleCoverage>, + #[doc = "State"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] + pub test_run: Option<ShallowReference>, } impl TestRunCoverage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunCoverageList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestRunCoverage>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestRunCoverage>, } impl TestRunCoverageList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunCreatedEvent { - #[serde(flatten)] - pub test_run_event: TestRunEvent, + #[serde(flatten)] + pub test_run_event: TestRunEvent, } impl TestRunCreatedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunEvent { - #[doc = "Test run details."] - #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] - pub test_run: Option<TestRun>, + #[doc = "Test run details."] + #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] + pub test_run: Option<TestRun>, } impl TestRunEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunEx2 { - #[serde(rename = "bitValue", default, skip_serializing_if = "Option::is_none")] - pub bit_value: Option<bool>, - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[serde( - rename = "dateTimeValue", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_time_value: Option<time::OffsetDateTime>, - #[serde(rename = "fieldId", default, skip_serializing_if = "Option::is_none")] - pub field_id: Option<i32>, - #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] - pub field_name: Option<String>, - #[serde( - rename = "floatValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub float_value: Option<f64>, - #[serde(rename = "guidValue", default, skip_serializing_if = "Option::is_none")] - pub guid_value: Option<String>, - #[serde(rename = "intValue", default, skip_serializing_if = "Option::is_none")] - pub int_value: Option<i32>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "stringValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub string_value: Option<String>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde(rename = "bitValue", default, skip_serializing_if = "Option::is_none")] + pub bit_value: Option<bool>, + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[serde( + rename = "dateTimeValue", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_time_value: Option<time::OffsetDateTime>, + #[serde(rename = "fieldId", default, skip_serializing_if = "Option::is_none")] + pub field_id: Option<i32>, + #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] + pub field_name: Option<String>, + #[serde( + rename = "floatValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub float_value: Option<f64>, + #[serde(rename = "guidValue", default, skip_serializing_if = "Option::is_none")] + pub guid_value: Option<String>, + #[serde(rename = "intValue", default, skip_serializing_if = "Option::is_none")] + pub int_value: Option<i32>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "stringValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub string_value: Option<String>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl TestRunEx2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunExtended2 { - #[serde( - rename = "autEnvironmentUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub aut_environment_url: Option<String>, - #[serde( - rename = "csmContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub csm_content: Option<String>, - #[serde( - rename = "csmParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub csm_parameters: Option<String>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "sourceFilter", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_filter: Option<String>, - #[serde( - rename = "subscriptionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub substate: Option<String>, - #[serde( - rename = "testCaseFilter", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_filter: Option<String>, - #[serde( - rename = "testEnvironmentUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_environment_url: Option<String>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[serde( + rename = "autEnvironmentUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub aut_environment_url: Option<String>, + #[serde( + rename = "csmContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub csm_content: Option<String>, + #[serde( + rename = "csmParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub csm_parameters: Option<String>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "sourceFilter", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_filter: Option<String>, + #[serde( + rename = "subscriptionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub substate: Option<String>, + #[serde( + rename = "testCaseFilter", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_filter: Option<String>, + #[serde( + rename = "testEnvironmentUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_environment_url: Option<String>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl TestRunExtended2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestRun>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestRun>, } impl TestRunList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunStartedEvent { - #[serde(flatten)] - pub test_run_event: TestRunEvent, + #[serde(flatten)] + pub test_run_event: TestRunEvent, } impl TestRunStartedEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test run statistics."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunStatistic { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub run: Option<ShallowReference>, - #[serde( - rename = "runStatistics", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub run_statistics: Vec<RunStatistic>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub run: Option<ShallowReference>, + #[serde( + rename = "runStatistics", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub run_statistics: Vec<RunStatistic>, } impl TestRunStatistic { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunSummary2 { - #[serde(rename = "isRerun", default, skip_serializing_if = "Option::is_none")] - pub is_rerun: Option<bool>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "resultCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_count: Option<i32>, - #[serde( - rename = "resultDuration", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_duration: Option<i64>, - #[serde( - rename = "runDuration", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_duration: Option<i64>, - #[serde( - rename = "testOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_outcome: Option<String>, - #[serde( - rename = "testRunCompletedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub test_run_completed_date: Option<time::OffsetDateTime>, - #[serde( - rename = "testRunContextId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_run_context_id: Option<i32>, - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, - #[serde( - rename = "testRunStatsId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_run_stats_id: Option<i64>, + #[serde(rename = "isRerun", default, skip_serializing_if = "Option::is_none")] + pub is_rerun: Option<bool>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "resultCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_count: Option<i32>, + #[serde( + rename = "resultDuration", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_duration: Option<i64>, + #[serde( + rename = "runDuration", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_duration: Option<i64>, + #[serde( + rename = "testOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_outcome: Option<String>, + #[serde( + rename = "testRunCompletedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub test_run_completed_date: Option<time::OffsetDateTime>, + #[serde( + rename = "testRunContextId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_run_context_id: Option<i32>, + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, + #[serde( + rename = "testRunStatsId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_run_stats_id: Option<i32>, } impl TestRunSummary2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunWithDtlEnvEvent { - #[serde(flatten)] - pub test_run_event: TestRunEvent, - #[serde( - rename = "configurationIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub configuration_ids: Vec<i32>, - #[serde( - rename = "mappedTestRunEventType", - default, - skip_serializing_if = "Option::is_none" - )] - pub mapped_test_run_event_type: Option<String>, - #[serde( - rename = "runTimeout", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_timeout: Option<String>, - #[serde( - rename = "testConfigurationsMapping", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_configurations_mapping: Option<String>, + #[serde(flatten)] + pub test_run_event: TestRunEvent, + #[serde( + rename = "configurationIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub configuration_ids: Vec<i32>, + #[serde( + rename = "mappedTestRunEventType", + default, + skip_serializing_if = "Option::is_none" + )] + pub mapped_test_run_event_type: Option<String>, + #[serde( + rename = "runTimeout", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_timeout: Option<String>, + #[serde( + rename = "testConfigurationsMapping", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_configurations_mapping: Option<String>, } impl TestRunWithDtlEnvEvent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Session"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSession { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub area: Option<ShallowReference>, - #[doc = "Comments in the test session"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Duration of the session"] - #[serde( - rename = "endDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub end_date: Option<time::OffsetDateTime>, - #[doc = "Id of the test session"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = ""] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<IdentityRef>, - #[doc = "Last updated date"] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, - #[doc = "The class to represent a Generic store for test session data."] - #[serde( - rename = "propertyBag", - default, - skip_serializing_if = "Option::is_none" - )] - pub property_bag: Option<PropertyBag>, - #[doc = "Revision of the test session"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "Source of the test session"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<test_session::Source>, - #[doc = "Start date"] - #[serde( - rename = "startDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_date: Option<time::OffsetDateTime>, - #[doc = "State of the test session"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<test_session::State>, - #[doc = "Title of the test session"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[doc = "Url of Test Session Resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub area: Option<ShallowReference>, + #[doc = "Comments in the test session"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Duration of the session"] + #[serde( + rename = "endDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub end_date: Option<time::OffsetDateTime>, + #[doc = "Id of the test session"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = ""] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<IdentityRef>, + #[doc = "Last updated date"] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, + #[doc = "The class to represent a Generic store for test session data."] + #[serde( + rename = "propertyBag", + default, + skip_serializing_if = "Option::is_none" + )] + pub property_bag: Option<PropertyBag>, + #[doc = "Revision of the test session"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "Source of the test session"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<test_session::Source>, + #[doc = "Start date"] + #[serde( + rename = "startDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_date: Option<time::OffsetDateTime>, + #[doc = "State of the test session"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<test_session::State>, + #[doc = "Title of the test session"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[doc = "Url of Test Session Resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestSession { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_session { - use super::*; - #[doc = "Source of the test session"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Source { - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "xtDesktop")] - XtDesktop, - #[serde(rename = "feedbackDesktop")] - FeedbackDesktop, - #[serde(rename = "xtWeb")] - XtWeb, - #[serde(rename = "feedbackWeb")] - FeedbackWeb, - #[serde(rename = "xtDesktop2")] - XtDesktop2, - #[serde(rename = "sessionInsightsForAll")] - SessionInsightsForAll, - } - #[doc = "State of the test session"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "notStarted")] - NotStarted, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "declined")] - Declined, - } + use super::*; + #[doc = "Source of the test session"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Source { + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "xtDesktop")] + XtDesktop, + #[serde(rename = "feedbackDesktop")] + FeedbackDesktop, + #[serde(rename = "xtWeb")] + XtWeb, + #[serde(rename = "feedbackWeb")] + FeedbackWeb, + #[serde(rename = "xtDesktop2")] + XtDesktop2, + #[serde(rename = "sessionInsightsForAll")] + SessionInsightsForAll, + } + #[doc = "State of the test session"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "notStarted")] + NotStarted, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "declined")] + Declined, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSessionExploredWorkItemReference { - #[serde(flatten)] - pub test_session_work_item_reference: TestSessionWorkItemReference, - #[doc = "Workitem references of workitems filed as a part of the current workitem exploration."] - #[serde( - rename = "associatedWorkItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub associated_work_items: Vec<TestSessionWorkItemReference>, - #[doc = "Time when exploration of workitem ended."] - #[serde( - rename = "endTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub end_time: Option<time::OffsetDateTime>, - #[doc = "Time when explore of workitem was started."] - #[serde( - rename = "startTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_time: Option<time::OffsetDateTime>, + #[serde(flatten)] + pub test_session_work_item_reference: TestSessionWorkItemReference, + #[doc = "Workitem references of workitems filed as a part of the current workitem exploration."] + #[serde( + rename = "associatedWorkItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub associated_work_items: Vec<TestSessionWorkItemReference>, + #[doc = "Time when exploration of workitem ended."] + #[serde( + rename = "endTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub end_time: Option<time::OffsetDateTime>, + #[doc = "Time when explore of workitem was started."] + #[serde( + rename = "startTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_time: Option<time::OffsetDateTime>, } impl TestSessionExploredWorkItemReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSessionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestSession>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestSession>, } impl TestSessionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSessionWorkItemReference { - #[doc = "Id of the workitem"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Type of the workitem"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Id of the workitem"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Type of the workitem"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl TestSessionWorkItemReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the test settings of the run. Used to create test settings and fetch test settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSettings { - #[doc = "Area path required to create test settings"] - #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] - pub area_path: Option<String>, - #[doc = "Description of the test settings. Used in create test settings."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Indicates if the tests settings is public or private.Used in create test settings."] - #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] - pub is_public: Option<bool>, - #[doc = "Xml string of machine roles. Used in create test settings."] - #[serde( - rename = "machineRoles", - default, - skip_serializing_if = "Option::is_none" - )] - pub machine_roles: Option<String>, - #[doc = "Test settings content."] - #[serde( - rename = "testSettingsContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_content: Option<String>, - #[doc = "Test settings id."] - #[serde( - rename = "testSettingsId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_id: Option<i32>, - #[doc = "Test settings name."] - #[serde( - rename = "testSettingsName", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_name: Option<String>, + #[doc = "Area path required to create test settings"] + #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] + pub area_path: Option<String>, + #[doc = "Description of the test settings. Used in create test settings."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Indicates if the tests settings is public or private.Used in create test settings."] + #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] + pub is_public: Option<bool>, + #[doc = "Xml string of machine roles. Used in create test settings."] + #[serde( + rename = "machineRoles", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_roles: Option<String>, + #[doc = "Test settings content."] + #[serde( + rename = "testSettingsContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_content: Option<String>, + #[doc = "Test settings id."] + #[serde( + rename = "testSettingsId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_id: Option<i32>, + #[doc = "Test settings name."] + #[serde( + rename = "testSettingsName", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_name: Option<String>, } impl TestSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the test settings of the run. Used to create test settings and fetch test settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSettings2 { - #[doc = "Area path required to create test settings"] - #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] - pub area_path: Option<String>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Description of the test settings. Used in create test settings."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Indicates if the tests settings is public or private.Used in create test settings."] - #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] - pub is_public: Option<bool>, - #[doc = ""] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<IdentityRef>, - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "Xml string of machine roles. Used in create test settings."] - #[serde( - rename = "machineRoles", - default, - skip_serializing_if = "Option::is_none" - )] - pub machine_roles: Option<String>, - #[doc = "Test settings content."] - #[serde( - rename = "testSettingsContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_content: Option<String>, - #[doc = "Test settings id."] - #[serde( - rename = "testSettingsId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_id: Option<i32>, - #[doc = "Test settings name."] - #[serde( - rename = "testSettingsName", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_name: Option<String>, + #[doc = "Area path required to create test settings"] + #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] + pub area_path: Option<String>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Description of the test settings. Used in create test settings."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Indicates if the tests settings is public or private.Used in create test settings."] + #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] + pub is_public: Option<bool>, + #[doc = ""] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<IdentityRef>, + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "Xml string of machine roles. Used in create test settings."] + #[serde( + rename = "machineRoles", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_roles: Option<String>, + #[doc = "Test settings content."] + #[serde( + rename = "testSettingsContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_content: Option<String>, + #[doc = "Test settings id."] + #[serde( + rename = "testSettingsId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_id: Option<i32>, + #[doc = "Test settings name."] + #[serde( + rename = "testSettingsName", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_name: Option<String>, } impl TestSettings2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSettingsMachineRole { - #[serde( - rename = "isExecution", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_execution: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde( + rename = "isExecution", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_execution: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TestSettingsMachineRole { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a sub result of a test result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSubResult { - #[doc = "Comment in sub result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Time when test execution completed(UTC)."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Machine where test executed."] - #[serde( - rename = "computerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub computer_name: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<ShallowReference>, - #[doc = "Additional properties of sub result."] - #[serde( - rename = "customFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub custom_fields: Vec<CustomTestField>, - #[doc = "Name of sub result."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Duration of test execution."] - #[serde( - rename = "durationInMs", - default, - skip_serializing_if = "Option::is_none" - )] - pub duration_in_ms: Option<i64>, - #[doc = "Error message in sub result."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "ID of sub result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Time when result last updated(UTC)."] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "Outcome of sub result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = "Immediate parent ID of sub result."] - #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option<i32>, - #[doc = "Hierarchy type of the result, default value of None means its leaf node."] - #[serde( - rename = "resultGroupType", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_group_type: Option<test_sub_result::ResultGroupType>, - #[doc = "Index number of sub result."] - #[serde( - rename = "sequenceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub sequence_id: Option<i32>, - #[doc = "Stacktrace."] - #[serde( - rename = "stackTrace", - default, - skip_serializing_if = "Option::is_none" - )] - pub stack_trace: Option<String>, - #[doc = "Time when test execution started(UTC)."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_date: Option<time::OffsetDateTime>, - #[doc = "List of sub results inside a sub result, if ResultGroupType is not None, it holds corresponding type sub results."] - #[serde( - rename = "subResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub sub_results: Vec<TestSubResult>, - #[doc = "Reference to a test result."] - #[serde( - rename = "testResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result: Option<TestCaseResultIdentifier>, - #[doc = "Url of sub result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Comment in sub result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Time when test execution completed(UTC)."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Machine where test executed."] + #[serde( + rename = "computerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub computer_name: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<ShallowReference>, + #[doc = "Additional properties of sub result."] + #[serde( + rename = "customFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub custom_fields: Vec<CustomTestField>, + #[doc = "Name of sub result."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Duration of test execution."] + #[serde( + rename = "durationInMs", + default, + skip_serializing_if = "Option::is_none" + )] + pub duration_in_ms: Option<i64>, + #[doc = "Error message in sub result."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "ID of sub result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Time when result last updated(UTC)."] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "Outcome of sub result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = "Immediate parent ID of sub result."] + #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option<i32>, + #[doc = "Hierarchy type of the result, default value of None means its leaf node."] + #[serde( + rename = "resultGroupType", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_group_type: Option<test_sub_result::ResultGroupType>, + #[doc = "Index number of sub result."] + #[serde( + rename = "sequenceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub sequence_id: Option<i32>, + #[doc = "Stacktrace."] + #[serde( + rename = "stackTrace", + default, + skip_serializing_if = "Option::is_none" + )] + pub stack_trace: Option<String>, + #[doc = "Time when test execution started(UTC)."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_date: Option<time::OffsetDateTime>, + #[doc = "List of sub results inside a sub result, if ResultGroupType is not None, it holds corresponding type sub results."] + #[serde( + rename = "subResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub sub_results: Vec<TestSubResult>, + #[doc = "Reference to a test result."] + #[serde( + rename = "testResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result: Option<TestCaseResultIdentifier>, + #[doc = "Url of sub result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestSubResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_sub_result { - use super::*; - #[doc = "Hierarchy type of the result, default value of None means its leaf node."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ResultGroupType { - #[serde(rename = "none")] - None, - #[serde(rename = "rerun")] - Rerun, - #[serde(rename = "dataDriven")] - DataDriven, - #[serde(rename = "orderedTest")] - OrderedTest, - #[serde(rename = "generic")] - Generic, - } + use super::*; + #[doc = "Hierarchy type of the result, default value of None means its leaf node."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ResultGroupType { + #[serde(rename = "none")] + None, + #[serde(rename = "rerun")] + Rerun, + #[serde(rename = "dataDriven")] + DataDriven, + #[serde(rename = "orderedTest")] + OrderedTest, + #[serde(rename = "generic")] + Generic, + } } #[doc = "Test suite"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSuite { - #[doc = "Area uri of the test suite."] - #[serde(rename = "areaUri", default, skip_serializing_if = "Option::is_none")] - pub area_uri: Option<String>, - #[doc = "Child test suites of current test suite."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub children: Vec<TestSuite>, - #[doc = "Test suite default configuration."] - #[serde( - rename = "defaultConfigurations", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub default_configurations: Vec<ShallowReference>, - #[doc = "Test suite default testers."] - #[serde( - rename = "defaultTesters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub default_testers: Vec<ShallowReference>, - #[doc = "Id of test suite."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Default configuration was inherited or not."] - #[serde( - rename = "inheritDefaultConfigurations", - default, - skip_serializing_if = "Option::is_none" - )] - pub inherit_default_configurations: Option<bool>, - #[doc = "Last error for test suite."] - #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] - pub last_error: Option<String>, - #[doc = "Last populated date."] - #[serde( - rename = "lastPopulatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_populated_date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<IdentityRef>, - #[doc = "Last update date."] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "Name of test suite."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub plan: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, - #[doc = "Test suite query string, for dynamic suites."] - #[serde( - rename = "queryString", - default, - skip_serializing_if = "Option::is_none" - )] - pub query_string: Option<String>, - #[doc = "Test suite requirement id."] - #[serde( - rename = "requirementId", - default, - skip_serializing_if = "Option::is_none" - )] - pub requirement_id: Option<i32>, - #[doc = "Test suite revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "State of test suite."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "List of shallow reference of suites."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub suites: Vec<ShallowReference>, - #[doc = "Test suite type."] - #[serde(rename = "suiteType", default, skip_serializing_if = "Option::is_none")] - pub suite_type: Option<String>, - #[doc = "Test cases count."] - #[serde( - rename = "testCaseCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_count: Option<i32>, - #[doc = "Test case url."] - #[serde( - rename = "testCasesUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_cases_url: Option<String>, - #[doc = "Used in tree view. If test suite is root suite then, it is name of plan otherwise title of the suite."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, - #[doc = "Url of test suite."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Area uri of the test suite."] + #[serde(rename = "areaUri", default, skip_serializing_if = "Option::is_none")] + pub area_uri: Option<String>, + #[doc = "Child test suites of current test suite."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub children: Vec<TestSuite>, + #[doc = "Test suite default configuration."] + #[serde( + rename = "defaultConfigurations", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub default_configurations: Vec<ShallowReference>, + #[doc = "Test suite default testers."] + #[serde( + rename = "defaultTesters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub default_testers: Vec<ShallowReference>, + #[doc = "Id of test suite."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Default configuration was inherited or not."] + #[serde( + rename = "inheritDefaultConfigurations", + default, + skip_serializing_if = "Option::is_none" + )] + pub inherit_default_configurations: Option<bool>, + #[doc = "Last error for test suite."] + #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] + pub last_error: Option<String>, + #[doc = "Last populated date."] + #[serde( + rename = "lastPopulatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_populated_date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<IdentityRef>, + #[doc = "Last update date."] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "Name of test suite."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plan: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, + #[doc = "Test suite query string, for dynamic suites."] + #[serde( + rename = "queryString", + default, + skip_serializing_if = "Option::is_none" + )] + pub query_string: Option<String>, + #[doc = "Test suite requirement id."] + #[serde( + rename = "requirementId", + default, + skip_serializing_if = "Option::is_none" + )] + pub requirement_id: Option<i32>, + #[doc = "Test suite revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "State of test suite."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "List of shallow reference of suites."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub suites: Vec<ShallowReference>, + #[doc = "Test suite type."] + #[serde(rename = "suiteType", default, skip_serializing_if = "Option::is_none")] + pub suite_type: Option<String>, + #[doc = "Test cases count."] + #[serde( + rename = "testCaseCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_count: Option<i32>, + #[doc = "Test case url."] + #[serde( + rename = "testCasesUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_cases_url: Option<String>, + #[doc = "Used in tree view. If test suite is root suite then, it is name of plan otherwise title of the suite."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, + #[doc = "Url of test suite."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestSuite { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test suite clone request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSuiteCloneRequest { - #[doc = "Clone options for cloning the test suite."] - #[serde( - rename = "cloneOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_options: Option<CloneOptions>, - #[doc = "Suite id under which, we have to clone the suite."] - #[serde( - rename = "destinationSuiteId", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_suite_id: Option<i32>, - #[doc = "Destination suite project name."] - #[serde( - rename = "destinationSuiteProjectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_suite_project_name: Option<String>, + #[doc = "Clone options for cloning the test suite."] + #[serde( + rename = "cloneOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_options: Option<CloneOptions>, + #[doc = "Suite id under which, we have to clone the suite."] + #[serde( + rename = "destinationSuiteId", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_suite_id: Option<i32>, + #[doc = "Destination suite project name."] + #[serde( + rename = "destinationSuiteProjectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_suite_project_name: Option<String>, } impl TestSuiteCloneRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSummaryForWorkItem { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub summary: Option<AggregatedDataForResultTrend>, - #[doc = "WorkItem reference Details."] - #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] - pub work_item: Option<WorkItemReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub summary: Option<AggregatedDataForResultTrend>, + #[doc = "WorkItem reference Details."] + #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] + pub work_item: Option<WorkItemReference>, } impl TestSummaryForWorkItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Tag attached to a run or result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestTag { - #[doc = "Name of the tag, alphanumeric value less than 30 chars"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Name of the tag, alphanumeric value less than 30 chars"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TestTag { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test tag summary for build or release grouped by test run."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestTagSummary { - #[doc = "Dictionary which contains tags associated with a test run."] - #[serde( - rename = "tagsGroupByTestArtifact", - default, - skip_serializing_if = "Option::is_none" - )] - pub tags_group_by_test_artifact: Option<serde_json::Value>, + #[doc = "Dictionary which contains tags associated with a test run."] + #[serde( + rename = "tagsGroupByTestArtifact", + default, + skip_serializing_if = "Option::is_none" + )] + pub tags_group_by_test_artifact: Option<serde_json::Value>, } impl TestTagSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Tags to update to a run or result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestTagsUpdateModel { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<serde_json::Value>, } impl TestTagsUpdateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestToWorkItemLinks { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub test: Option<TestMethod>, - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<WorkItemReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub test: Option<TestMethod>, + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<WorkItemReference>, } impl TestToWorkItemLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestVariable { - #[doc = "Description of the test variable"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Id of the test variable"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the test variable"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, - #[doc = "Revision"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "Url of the test variable"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "List of allowed values"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<String>, + #[doc = "Description of the test variable"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Id of the test variable"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the test variable"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, + #[doc = "Revision"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "Url of the test variable"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "List of allowed values"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<String>, } impl TestVariable { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateTestRunRequest { - #[serde( - rename = "attachmentsToAdd", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub attachments_to_add: Vec<TestResultAttachment>, - #[serde( - rename = "attachmentsToDelete", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub attachments_to_delete: Vec<TestResultAttachmentIdentity>, - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[serde( - rename = "shouldHyderate", - default, - skip_serializing_if = "Option::is_none" - )] - pub should_hyderate: Option<bool>, - #[doc = ""] - #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] - pub test_run: Option<LegacyTestRun>, + #[serde( + rename = "attachmentsToAdd", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub attachments_to_add: Vec<TestResultAttachment>, + #[serde( + rename = "attachmentsToDelete", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub attachments_to_delete: Vec<TestResultAttachmentIdentity>, + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[serde( + rename = "shouldHyderate", + default, + skip_serializing_if = "Option::is_none" + )] + pub should_hyderate: Option<bool>, + #[doc = ""] + #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] + pub test_run: Option<LegacyTestRun>, } impl UpdateTestRunRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateTestRunResponse { - #[serde( - rename = "attachmentIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub attachment_ids: Vec<i32>, - #[doc = ""] - #[serde( - rename = "updatedProperties", - default, - skip_serializing_if = "Option::is_none" - )] - pub updated_properties: Option<UpdatedProperties>, + #[serde( + rename = "attachmentIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub attachment_ids: Vec<i32>, + #[doc = ""] + #[serde( + rename = "updatedProperties", + default, + skip_serializing_if = "Option::is_none" + )] + pub updated_properties: Option<UpdatedProperties>, } impl UpdateTestRunResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdatedProperties { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<String>, - #[serde( - rename = "lastUpdatedByName", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde( + rename = "lastUpdated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated: Option<time::OffsetDateTime>, + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<String>, + #[serde( + rename = "lastUpdatedByName", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl UpdatedProperties { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UploadAttachmentsRequest { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub attachments: Vec<HttpPostedTcmAttachment>, - #[serde( - rename = "requestParams", - default, - skip_serializing_if = "Option::is_none" - )] - pub request_params: Option<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub attachments: Vec<HttpPostedTcmAttachment>, + #[serde( + rename = "requestParams", + default, + skip_serializing_if = "Option::is_none" + )] + pub request_params: Option<serde_json::Value>, } impl UploadAttachmentsRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "WorkItem reference Details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemReference { - #[doc = "WorkItem Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "WorkItem Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "WorkItem Type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "WorkItem Url. Valid Values : (Bug, Task, User Story, Test Case)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "WorkItem WebUrl."] - #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] - pub web_url: Option<String>, + #[doc = "WorkItem Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "WorkItem Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "WorkItem Type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "WorkItem Url. Valid Values : (Bug, Task, User Story, Test Case)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "WorkItem WebUrl."] + #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] + pub web_url: Option<String>, } impl WorkItemReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemToTestLinks { - #[serde( - rename = "executedIn", - default, - skip_serializing_if = "Option::is_none" - )] - pub executed_in: Option<work_item_to_test_links::ExecutedIn>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tests: Vec<TestMethod>, - #[doc = "WorkItem reference Details."] - #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] - pub work_item: Option<WorkItemReference>, + #[serde( + rename = "executedIn", + default, + skip_serializing_if = "Option::is_none" + )] + pub executed_in: Option<work_item_to_test_links::ExecutedIn>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tests: Vec<TestMethod>, + #[doc = "WorkItem reference Details."] + #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] + pub work_item: Option<WorkItemReference>, } impl WorkItemToTestLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod work_item_to_test_links { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ExecutedIn { - #[serde(rename = "any")] - Any, - #[serde(rename = "tcm")] - Tcm, - #[serde(rename = "tfs")] - Tfs, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ExecutedIn { + #[serde(rename = "any")] + Any, + #[serde(rename = "tcm")] + Tcm, + #[serde(rename = "tfs")] + Tfs, + } } diff --git a/azure_devops_rust_api/src/test_plan/mod.rs b/azure_devops_rust_api/src/test_plan/mod.rs index 7076209b..9d7b02aa 100644 --- a/azure_devops_rust_api/src/test_plan/mod.rs +++ b/azure_devops_rust_api/src/test_plan/mod.rs @@ -9,5397 +9,5457 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + 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()) + } +} +pub mod suite_test_case { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan from which test cases are to be removed."] + #[doc = "* `suite_id`: ID of the test suite from which test cases are to be removed."] + #[doc = "* `test_case_ids`: Test Case Ids to be removed."] + pub fn remove_test_cases_from_suite( + &self, + organization: impl Into<String>, + project: impl Into<String>, + plan_id: i32, + suite_id: i32, + test_case_ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan for which test cases are requested."] + #[doc = "* `suite_id`: ID of the test suite for which test cases are requested."] + pub fn get_test_case_list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: SuiteTestCaseCreateUpdateParameters object."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan to which test cases are to be added."] + #[doc = "* `suite_id`: ID of the test suite to which test cases are to be added."] + pub fn add( + &self, + organization: impl Into<String>, + body: Vec<models::SuiteTestCaseCreateUpdateParameters>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A SuiteTestCaseCreateUpdateParameters object."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan to which test cases are to be updated."] + #[doc = "* `suite_id`: ID of the test suite to which test cases are to be updated."] + pub fn update( + &self, + organization: impl Into<String>, + body: Vec<models::SuiteTestCaseCreateUpdateParameters>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan from which test cases are to be removed."] + #[doc = "* `suite_id`: ID of the test suite from which test cases are to be removed."] + #[doc = "* `test_ids`: Comma separated string of Test Case Ids to be removed."] + pub fn remove_test_cases_list_from_suite( + &self, + organization: impl Into<String>, + project: impl Into<String>, + plan_id: i32, + suite_id: i32, + test_ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan for which test cases are requested."] + #[doc = "* `suite_id`: ID of the test suite for which test cases are requested."] + #[doc = "* `test_case_id`: Test Case Id to be fetched."] + pub fn get_test_case( + &self, + organization: impl Into<String>, + project: impl Into<String>, + plan_id: i32, + suite_id: i32, + test_case_id: impl Into<String>, + ) -> 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 remove_test_cases_from_suite { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase?testCaseIds={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id, + &this.test_case_ids + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let test_case_ids = &this.test_case_ids; + req + .url_mut() + .query_pairs_mut() + .append_pair("testCaseIds", test_case_ids); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_test_case_list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestCaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestCaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_id: i32, + pub(crate) test_ids: Option<String>, + pub(crate) configuration_ids: Option<String>, + pub(crate) wit_fields: Option<String>, + pub(crate) continuation_token: Option<String>, + pub(crate) return_identity_ref: Option<bool>, + pub(crate) expand: Option<bool>, + pub(crate) exclude_flags: Option<String>, + pub(crate) is_recursive: Option<bool>, + } + impl RequestBuilder { + #[doc = "Test Case Ids to be fetched."] + pub fn test_ids(mut self, test_ids: impl Into<String>) -> Self { + self.test_ids = Some(test_ids.into()); + self + } + #[doc = "Fetch Test Cases which contains all the configuration Ids specified."] + pub fn configuration_ids(mut self, configuration_ids: impl Into<String>) -> Self { + self.configuration_ids = Some(configuration_ids.into()); + self + } + #[doc = "Get the list of witFields."] + pub fn wit_fields(mut self, wit_fields: impl Into<String>) -> Self { + self.wit_fields = Some(wit_fields.into()); self + } + #[doc = "If the list of test cases returned is not complete, a continuation token to query next batch of test cases is included in the response header as \"x-ms-continuationtoken\". Omit this parameter to get the first batch of test cases."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default."] + pub fn return_identity_ref(mut self, return_identity_ref: bool) -> Self { + self.return_identity_ref = Some(return_identity_ref); + self + } + #[doc = "If set to false, will get a smaller payload containing only basic details about the suite test case object"] + pub fn expand(mut self, expand: bool) -> Self { + self.expand = Some(expand); + self + } + #[doc = "Flag to exclude various values from payload. For example to remove point assignments pass exclude = 1. To remove extra information (links, test plan , test suite) pass exclude = 2. To remove both extra information and point assignments pass exclude = 3 (1 + 2)."] + pub fn exclude_flags(mut self, exclude_flags: impl Into<String>) -> Self { + self.exclude_flags = Some(exclude_flags.into()); + self + } + pub fn is_recursive(mut self, is_recursive: bool) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestCaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestCaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestCaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::SuiteTestCaseCreateUpdateParameters>, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestCaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestCaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestCaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::SuiteTestCaseCreateUpdateParameters>, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestCaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod remove_test_cases_list_from_suite { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let test_ids = &this.test_ids; + req + .url_mut() + .query_pairs_mut() + .append_pair("testIds", test_ids); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_test_case { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestCaseList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestCaseList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_id: i32, + pub(crate) test_case_id: String, + pub(crate) wit_fields: Option<String>, + pub(crate) return_identity_ref: Option<bool>, + } + impl RequestBuilder { + #[doc = "Get the list of witFields."] + pub fn wit_fields(mut self, wit_fields: impl Into<String>) -> Self { + self.wit_fields = Some(wit_fields.into()); self + } + #[doc = "If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default."] + pub fn return_identity_ref(mut self, return_identity_ref: bool) -> Self { + self.return_identity_ref = Some(return_identity_ref); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id, + &this.test_case_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestCaseList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod test_point { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all the points inside a suite based on some filters"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan for which test points are requested."] + #[doc = "* `suite_id`: ID of the test suite for which test points are requested"] + pub fn get_points_list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan for which test points are requested."] + #[doc = "* `suite_id`: ID of the test suite for which test points are requested."] + #[doc = "* `point_id`: ID of test point to be fetched."] + pub fn get_points( + &self, + organization: impl Into<String>, + project: impl Into<String>, + plan_id: i32, + suite_id: i32, + point_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A TestPointUpdateParams Object."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan for which test points are requested."] + #[doc = "* `suite_id`: ID of the test suite for which test points are requested."] + pub fn update( + &self, + organization: impl Into<String>, + body: Vec<models::TestPointUpdateParams>, + project: impl Into<String>, + 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 get_points_list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestPointList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_id: i32, + pub(crate) test_point_ids: Option<String>, + pub(crate) test_case_id: Option<String>, + pub(crate) continuation_token: Option<String>, + pub(crate) return_identity_ref: Option<bool>, + pub(crate) include_point_details: Option<bool>, + pub(crate) is_recursive: Option<bool>, + } + impl RequestBuilder { + #[doc = "ID of test points to fetch."] + pub fn test_point_ids(mut self, test_point_ids: impl Into<String>) -> Self { + self.test_point_ids = Some(test_point_ids.into()); + self + } + #[doc = "Get Test Points for specific test case Ids."] + pub fn test_case_id(mut self, test_case_id: impl Into<String>) -> Self { + self.test_case_id = Some(test_case_id.into()); + self + } + #[doc = "If the list of test point returned is not complete, a continuation token to query next batch of test points is included in the response header as \"x-ms-continuationtoken\". Omit this parameter to get the first batch of test points."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[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); + self + } + #[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); + self + } + #[doc = "If set to true, will also fetch test points belonging to child suites recursively."] + pub fn is_recursive(mut self, is_recursive: bool) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint?", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestPointList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestPointList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_points { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestPointList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_id: i32, + pub(crate) point_id: String, + pub(crate) return_identity_ref: Option<bool>, + pub(crate) include_point_details: Option<bool>, } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); + 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); self + } + #[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); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestPointList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestPointList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestPointList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::TestPointUpdateParams>, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_id: i32, + pub(crate) include_point_details: Option<bool>, + pub(crate) return_identity_ref: Option<bool>, + } + 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); + self + } + #[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); 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestPointList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestPointList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) +pub mod test_suites { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `test_case_id`: ID of the test case for which suites need to be fetched."] + pub fn get_suites_by_test_case_id( + &self, + organization: impl Into<String>, + 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, + } } -} -pub mod suite_test_case { + #[doc = "Get test suites for plan."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan for which suites are requested."] + pub fn get_test_suites_for_plan( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Parameters for suite creation"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan that contains the suites."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::TestSuiteCreateParams>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan that contains the suites."] + #[doc = "* `suite_id`: ID of the suite to get."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Parameters for suite updation"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan that contains the suites."] + #[doc = "* `suite_id`: ID of the parent suite."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TestSuiteUpdateParams>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan that contains the suite."] + #[doc = "* `suite_id`: ID of the test suite to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 get_suites_by_test_case_id { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan from which test cases are to be removed."] - #[doc = "* `suite_id`: ID of the test suite from which test cases are to be removed."] - #[doc = "* `test_case_ids`: Test Case Ids to be removed."] - pub fn remove_test_cases_from_suite( - &self, - organization: impl Into<String>, - project: impl Into<String>, - plan_id: i32, - suite_id: i32, - test_case_ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan for which test cases are requested."] - #[doc = "* `suite_id`: ID of the test suite for which test cases are requested."] - pub fn get_test_case_list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: SuiteTestCaseCreateUpdateParameters object."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan to which test cases are to be added."] - #[doc = "* `suite_id`: ID of the test suite to which test cases are to be added."] - pub fn add( - &self, - organization: impl Into<String>, - body: Vec<models::SuiteTestCaseCreateUpdateParameters>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A SuiteTestCaseCreateUpdateParameters object."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan to which test cases are to be updated."] - #[doc = "* `suite_id`: ID of the test suite to which test cases are to be updated."] - pub fn update( - &self, - organization: impl Into<String>, - body: Vec<models::SuiteTestCaseCreateUpdateParameters>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan from which test cases are to be removed."] - #[doc = "* `suite_id`: ID of the test suite from which test cases are to be removed."] - #[doc = "* `test_ids`: Comma separated string of Test Case Ids to be removed."] - pub fn remove_test_cases_list_from_suite( - &self, - organization: impl Into<String>, - project: impl Into<String>, - plan_id: i32, - suite_id: i32, - test_ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan for which test cases are requested."] - #[doc = "* `suite_id`: ID of the test suite for which test cases are requested."] - #[doc = "* `test_case_id`: Test Case Id to be fetched."] - pub fn get_test_case( - &self, - organization: impl Into<String>, - project: impl Into<String>, - plan_id: i32, - suite_id: i32, - test_case_id: impl Into<String>, - ) -> 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 remove_test_cases_from_suite { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase?testCaseIds={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id, - &this.test_case_ids - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let test_case_ids = &this.test_case_ids; - req.url_mut() - .query_pairs_mut() - .append_pair("testCaseIds", test_case_ids); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_test_case_list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestCaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_id: i32, - pub(crate) test_ids: Option<String>, - pub(crate) configuration_ids: Option<String>, - pub(crate) wit_fields: Option<String>, - pub(crate) continuation_token: Option<String>, - pub(crate) return_identity_ref: Option<bool>, - pub(crate) expand: Option<bool>, - pub(crate) exclude_flags: Option<String>, - pub(crate) is_recursive: Option<bool>, - } - impl RequestBuilder { - #[doc = "Test Case Ids to be fetched."] - pub fn test_ids(mut self, test_ids: impl Into<String>) -> Self { - self.test_ids = Some(test_ids.into()); - self - } - #[doc = "Fetch Test Cases which contains all the configuration Ids specified."] - pub fn configuration_ids(mut self, configuration_ids: impl Into<String>) -> Self { - self.configuration_ids = Some(configuration_ids.into()); - self - } - #[doc = "Get the list of witFields."] - pub fn wit_fields(mut self, wit_fields: impl Into<String>) -> Self { - self.wit_fields = Some(wit_fields.into()); - self - } - #[doc = "If the list of test cases returned is not complete, a continuation token to query next batch of test cases is included in the response header as \"x-ms-continuationtoken\". Omit this parameter to get the first batch of test cases."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default."] - pub fn return_identity_ref(mut self, return_identity_ref: bool) -> Self { - self.return_identity_ref = Some(return_identity_ref); - self - } - #[doc = "If set to false, will get a smaller payload containing only basic details about the suite test case object"] - pub fn expand(mut self, expand: bool) -> Self { - self.expand = Some(expand); - self - } - #[doc = "Flag to exclude various values from payload. For example to remove point assignments pass exclude = 1. To remove extra information (links, test plan , test suite) pass exclude = 2. To remove both extra information and point assignments pass exclude = 3 (1 + 2)."] - pub fn exclude_flags(mut self, exclude_flags: impl Into<String>) -> Self { - self.exclude_flags = Some(exclude_flags.into()); - self - } - pub fn is_recursive(mut self, is_recursive: bool) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestCaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestCaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::SuiteTestCaseCreateUpdateParameters>, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestCaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestCaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::SuiteTestCaseCreateUpdateParameters>, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestCaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod remove_test_cases_list_from_suite { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let test_ids = &this.test_ids; - req.url_mut() - .query_pairs_mut() - .append_pair("testIds", test_ids); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_test_case { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestCaseList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestCaseList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_id: i32, - pub(crate) test_case_id: String, - pub(crate) wit_fields: Option<String>, - pub(crate) return_identity_ref: Option<bool>, - } - impl RequestBuilder { - #[doc = "Get the list of witFields."] - pub fn wit_fields(mut self, wit_fields: impl Into<String>) -> Self { - self.wit_fields = Some(wit_fields.into()); - self - } - #[doc = "If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default."] - pub fn return_identity_ref(mut self, return_identity_ref: bool) -> Self { - self.return_identity_ref = Some(return_identity_ref); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id, - &this.test_case_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestCaseList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestCaseList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestSuiteList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestSuiteList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod test_point { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) test_case_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/testplan/suites", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let test_case_id = &this.test_case_id; + req + .url_mut() + .query_pairs_mut() + .append_pair("testCaseId", &test_case_id.to_string()); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestSuiteList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestSuiteList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_test_suites_for_plan { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get all the points inside a suite based on some filters"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan for which test points are requested."] - #[doc = "* `suite_id`: ID of the test suite for which test points are requested"] - pub fn get_points_list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan for which test points are requested."] - #[doc = "* `suite_id`: ID of the test suite for which test points are requested."] - #[doc = "* `point_id`: ID of test point to be fetched."] - pub fn get_points( - &self, - organization: impl Into<String>, - project: impl Into<String>, - plan_id: i32, - suite_id: i32, - point_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A TestPointUpdateParams Object."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan for which test points are requested."] - #[doc = "* `suite_id`: ID of the test suite for which test points are requested."] - pub fn update( - &self, - organization: impl Into<String>, - body: Vec<models::TestPointUpdateParams>, - project: impl Into<String>, - 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 get_points_list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestPointList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_id: i32, - pub(crate) test_point_ids: Option<String>, - pub(crate) test_case_id: Option<String>, - pub(crate) continuation_token: Option<String>, - pub(crate) return_identity_ref: Option<bool>, - pub(crate) include_point_details: Option<bool>, - pub(crate) is_recursive: Option<bool>, - } - impl RequestBuilder { - #[doc = "ID of test points to fetch."] - pub fn test_point_ids(mut self, test_point_ids: impl Into<String>) -> Self { - self.test_point_ids = Some(test_point_ids.into()); - self - } - #[doc = "Get Test Points for specific test case Ids."] - pub fn test_case_id(mut self, test_case_id: impl Into<String>) -> Self { - self.test_case_id = Some(test_case_id.into()); - self - } - #[doc = "If the list of test point returned is not complete, a continuation token to query next batch of test points is included in the response header as \"x-ms-continuationtoken\". Omit this parameter to get the first batch of test points."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[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); - self - } - #[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); - self - } - #[doc = "If set to true, will also fetch test points belonging to child suites recursively."] - pub fn is_recursive(mut self, is_recursive: bool) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint?", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestPointList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestPointList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_points { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestPointList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_id: i32, - pub(crate) point_id: String, - pub(crate) return_identity_ref: Option<bool>, - pub(crate) include_point_details: Option<bool>, - } - 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); - self - } - #[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); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestPointList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestPointList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestPointList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPointList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::TestPointUpdateParams>, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_id: i32, - pub(crate) include_point_details: Option<bool>, - pub(crate) return_identity_ref: Option<bool>, - } - 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); - self - } - #[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); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestPointList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestPointList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestSuiteList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestSuiteList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod test_suites { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) expand: Option<String>, + pub(crate) continuation_token: Option<String>, + pub(crate) as_tree_view: Option<bool>, + } + impl RequestBuilder { + #[doc = "Include the children suites and testers details."] + pub fn expand(mut self, expand: impl Into<String>) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "If the list of suites returned is not complete, a continuation token to query next batch of suites is included in the response header as \"x-ms-continuationtoken\". Omit this parameter to get the first batch of test suites."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "If the suites returned should be in a tree structure."] + pub fn as_tree_view(mut self, as_tree_view: bool) -> Self { + self.as_tree_view = Some(as_tree_view); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/suites", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("expand", expand); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestSuiteList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestSuiteList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `test_case_id`: ID of the test case for which suites need to be fetched."] - pub fn get_suites_by_test_case_id( - &self, - organization: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan for which suites are requested."] - pub fn get_test_suites_for_plan( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Parameters for suite creation"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan that contains the suites."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::TestSuiteCreateParams>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan that contains the suites."] - #[doc = "* `suite_id`: ID of the suite to get."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Parameters for suite updation"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan that contains the suites."] - #[doc = "* `suite_id`: ID of the parent suite."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TestSuiteUpdateParams>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan that contains the suite."] - #[doc = "* `suite_id`: ID of the test suite to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 get_suites_by_test_case_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestSuiteList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSuiteList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) test_case_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/testplan/suites", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let test_case_id = &this.test_case_id; - req.url_mut() - .query_pairs_mut() - .append_pair("testCaseId", &test_case_id.to_string()); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestSuiteList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestSuiteList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_test_suites_for_plan { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestSuiteList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSuiteList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) expand: Option<String>, - pub(crate) continuation_token: Option<String>, - pub(crate) as_tree_view: Option<bool>, - } - impl RequestBuilder { - #[doc = "Include the children suites and testers details."] - pub fn expand(mut self, expand: impl Into<String>) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "If the list of suites returned is not complete, a continuation token to query next batch of suites is included in the response header as \"x-ms-continuationtoken\". Omit this parameter to get the first batch of test suites."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "If the suites returned should be in a tree structure."] - pub fn as_tree_view(mut self, as_tree_view: bool) -> Self { - self.as_tree_view = Some(as_tree_view); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/suites", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("expand", expand); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestSuiteList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestSuiteList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestSuite> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSuite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestSuiteCreateParams, - pub(crate) project: String, - pub(crate) plan_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/suites", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestSuite>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestSuite>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestSuite> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSuite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_id: i32, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "Include the children suites and testers details"] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestSuite>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestSuite>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestSuite> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestSuite = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestSuite>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestSuite>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) plan_id: i32, - pub(crate) suite_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestSuite> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestSuite = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestSuiteCreateParams, + pub(crate) project: String, + pub(crate) plan_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/suites", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestSuite>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TestSuite>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestSuite> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestSuite = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_id: i32, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "Include the children suites and testers details"] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestSuite>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TestSuite>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestSuite> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestSuite = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestSuite>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TestSuite>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) plan_id: i32, + pub(crate) suite_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod configurations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of test configurations."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + continuation_token: None, + } + } + #[doc = "Create a test configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: TestConfigurationCreateUpdateParameters"] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::TestConfigurationCreateUpdateParameters>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: TestConfigurationCreateUpdateParameters"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `test_configuartion_id`: ID of the test configuration to update."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TestConfigurationCreateUpdateParameters>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `test_configuartion_id`: ID of the test configuration to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `test_configuration_id`: ID of the test configuration to get."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + test_configuration_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_configuration_id, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of test configurations."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - continuation_token: None, - } - } - #[doc = "Create a test configuration."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: TestConfigurationCreateUpdateParameters"] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::TestConfigurationCreateUpdateParameters>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: TestConfigurationCreateUpdateParameters"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `test_configuartion_id`: ID of the test configuration to update."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TestConfigurationCreateUpdateParameters>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `test_configuartion_id`: ID of the test configuration to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `test_configuration_id`: ID of the test configuration to get."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - test_configuration_id: i32, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - test_configuration_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestConfigurationList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestConfigurationList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) continuation_token: Option<String>, - } - 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<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/configurations", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestConfigurationList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestConfigurationList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestConfigurationCreateUpdateParameters, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/configurations", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestConfiguration>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestConfiguration>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestConfigurationCreateUpdateParameters, - pub(crate) project: String, - pub(crate) test_configuartion_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/configurations", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestConfiguration>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestConfiguration>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) test_configuartion_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/configurations", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let test_configuartion_id = &this.test_configuartion_id; - req.url_mut() - .query_pairs_mut() - .append_pair("testConfiguartionId", &test_configuartion_id.to_string()); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) test_configuration_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/configurations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.test_configuration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestConfiguration>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestConfiguration>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestConfigurationList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestConfigurationList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) continuation_token: Option<String>, + } + 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<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/configurations", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(continuation_token) = &this.continuation_token { + req + .url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestConfigurationList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestConfigurationList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestConfiguration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestConfigurationCreateUpdateParameters, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/configurations", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestConfiguration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestConfigurationCreateUpdateParameters, + pub(crate) project: String, + pub(crate) test_configuartion_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/configurations", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) test_configuartion_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/configurations", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let test_configuartion_id = &this.test_configuartion_id; + req + .url_mut() + .query_pairs_mut() + .append_pair("testConfiguartionId", &test_configuartion_id.to_string()); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestConfiguration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) test_configuration_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/configurations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.test_configuration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod test_plans { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of test plans"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A testPlanCreateParams object.TestPlanCreateParams"] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::TestPlanCreateParams>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan to get."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A testPlanUpdateParams object.TestPlanUpdateParams"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan to be updated."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TestPlanUpdateParams>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `plan_id`: ID of the test plan to be deleted."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + plan_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestPlanList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestPlanList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) owner: Option<String>, + pub(crate) continuation_token: Option<String>, + pub(crate) include_plan_details: Option<bool>, + pub(crate) filter_active_plans: Option<bool>, + } + impl RequestBuilder { + #[doc = "Filter for test plan by owner ID or name"] + pub fn owner(mut self, owner: impl Into<String>) -> Self { + self.owner = Some(owner.into()); + self + } + #[doc = "If the list of plans returned is not complete, a continuation token to query next batch of plans is included in the response header as \"x-ms-continuationtoken\". Omit this parameter to get the first batch of test plans."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "Get all properties of the test plan"] + pub fn include_plan_details(mut self, include_plan_details: bool) -> Self { + self.include_plan_details = Some(include_plan_details); + self + } + #[doc = "Get just the active plans"] + pub fn filter_active_plans(mut self, filter_active_plans: bool) -> Self { + self.filter_active_plans = Some(filter_active_plans); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/plans", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestPlanList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestPlanList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestPlan> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestPlan = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestPlanCreateParams, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/plans", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestPlan>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TestPlan>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestPlan> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestPlan = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) plan_id: i32, } -} -pub mod test_plans { + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/plans/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestPlan>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TestPlan>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of test plans"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A testPlanCreateParams object.TestPlanCreateParams"] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::TestPlanCreateParams>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan to get."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A testPlanUpdateParams object.TestPlanUpdateParams"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan to be updated."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TestPlanUpdateParams>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `plan_id`: ID of the test plan to be deleted."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - plan_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - plan_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestPlanList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPlanList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) owner: Option<String>, - pub(crate) continuation_token: Option<String>, - pub(crate) include_plan_details: Option<bool>, - pub(crate) filter_active_plans: Option<bool>, - } - impl RequestBuilder { - #[doc = "Filter for test plan by owner ID or name"] - pub fn owner(mut self, owner: impl Into<String>) -> Self { - self.owner = Some(owner.into()); - self - } - #[doc = "If the list of plans returned is not complete, a continuation token to query next batch of plans is included in the response header as \"x-ms-continuationtoken\". Omit this parameter to get the first batch of test plans."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Get all properties of the test plan"] - pub fn include_plan_details(mut self, include_plan_details: bool) -> Self { - self.include_plan_details = Some(include_plan_details); - self - } - #[doc = "Get just the active plans"] - pub fn filter_active_plans(mut self, filter_active_plans: bool) -> Self { - self.filter_active_plans = Some(filter_active_plans); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/plans", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestPlanList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestPlanList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestPlan> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPlan = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestPlanCreateParams, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/plans", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestPlan>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestPlan>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestPlan> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPlan = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) plan_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/plans/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestPlan>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestPlan>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestPlan> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestPlan = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestPlanUpdateParams, - pub(crate) project: String, - pub(crate) plan_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/plans/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestPlan>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestPlan>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) plan_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/plans/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.plan_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestPlan> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestPlan = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestPlanUpdateParams, + pub(crate) project: String, + pub(crate) plan_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/plans/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestPlan>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TestPlan>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) plan_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/plans/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.plan_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod test_plan_clone { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Clone test plan"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Plan Clone Request Body detail TestPlanCloneRequest"] + #[doc = "* `project`: Project ID or project name"] + pub fn clone_test_plan( + &self, + organization: impl Into<String>, + body: impl Into<models::CloneTestPlanParams>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `clone_operation_id`: Operation ID returned when we queue a clone operation"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + clone_operation_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + clone_operation_id, + } + } + } + pub mod clone_test_plan { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Clone test plan"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Plan Clone Request Body detail TestPlanCloneRequest"] - #[doc = "* `project`: Project ID or project name"] - pub fn clone_test_plan( - &self, - organization: impl Into<String>, - body: impl Into<models::CloneTestPlanParams>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `clone_operation_id`: Operation ID returned when we queue a clone operation"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - clone_operation_id: i32, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - clone_operation_id, - } - } - } - pub mod clone_test_plan { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::CloneTestPlanOperationInformation> { - let bytes = self.0.into_body().collect().await?; - let body: models::CloneTestPlanOperationInformation = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CloneTestPlanParams, - pub(crate) project: String, - pub(crate) deep_clone: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/CloneOperation", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CloneTestPlanOperationInformation>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::CloneTestPlanOperationInformation>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::CloneTestPlanOperationInformation> { - let bytes = self.0.into_body().collect().await?; - let body: models::CloneTestPlanOperationInformation = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) clone_operation_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/CloneOperation/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.clone_operation_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CloneTestPlanOperationInformation>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::CloneTestPlanOperationInformation>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::CloneTestPlanOperationInformation> { + let bytes = self.0.into_body().collect().await?; + let body: models::CloneTestPlanOperationInformation = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CloneTestPlanParams, + pub(crate) project: String, + pub(crate) deep_clone: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/CloneOperation", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CloneTestPlanOperationInformation>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::CloneTestPlanOperationInformation>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::CloneTestPlanOperationInformation> { + let bytes = self.0.into_body().collect().await?; + let body: models::CloneTestPlanOperationInformation = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) clone_operation_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/CloneOperation/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.clone_operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CloneTestPlanOperationInformation>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::CloneTestPlanOperationInformation>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod test_suite_entry { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of test suite entries in the test suite."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `suite_id`: Id of the parent suite."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: List of SuiteEntry to reorder."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `suite_id`: Id of the parent test suite."] + pub fn reorder_suite_entries( + &self, + organization: impl Into<String>, + body: Vec<models::SuiteEntryUpdateParams>, + project: impl Into<String>, + 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of test suite entries in the test suite."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `suite_id`: Id of the parent suite."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: List of SuiteEntry to reorder."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `suite_id`: Id of the parent test suite."] - pub fn reorder_suite_entries( - &self, - organization: impl Into<String>, - body: Vec<models::SuiteEntryUpdateParams>, - project: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SuiteEntryList> { - let bytes = self.0.into_body().collect().await?; - let body: models::SuiteEntryList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) suite_id: i32, - pub(crate) suite_entry_type: Option<String>, - } - impl RequestBuilder { - pub fn suite_entry_type(mut self, suite_entry_type: impl Into<String>) -> Self { - self.suite_entry_type = Some(suite_entry_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/suiteentry/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(suite_entry_type) = &this.suite_entry_type { - req.url_mut() - .query_pairs_mut() - .append_pair("suiteEntryType", suite_entry_type); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SuiteEntryList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::SuiteEntryList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod reorder_suite_entries { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::SuiteEntryList> { - let bytes = self.0.into_body().collect().await?; - let body: models::SuiteEntryList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::SuiteEntryUpdateParams>, - pub(crate) project: String, - pub(crate) suite_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/suiteentry/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.suite_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::SuiteEntryList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::SuiteEntryList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SuiteEntryList> { + let bytes = self.0.into_body().collect().await?; + let body: models::SuiteEntryList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) suite_id: i32, + pub(crate) suite_entry_type: Option<String>, + } + impl RequestBuilder { + pub fn suite_entry_type(mut self, suite_entry_type: impl Into<String>) -> Self { + self.suite_entry_type = Some(suite_entry_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/suiteentry/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(suite_entry_type) = &this.suite_entry_type { + req + .url_mut() + .query_pairs_mut() + .append_pair("suiteEntryType", suite_entry_type); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SuiteEntryList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SuiteEntryList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod reorder_suite_entries { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::SuiteEntryList> { + let bytes = self.0.into_body().collect().await?; + let body: models::SuiteEntryList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::SuiteEntryUpdateParams>, + pub(crate) project: String, + pub(crate) suite_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/suiteentry/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.suite_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::SuiteEntryList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::SuiteEntryList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod test_suite_clone { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Clone test suite"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Suite Clone Request Body detail TestSuiteCloneRequest"] + #[doc = "* `project`: Project ID or project name"] + pub fn clone_test_suite( + &self, + organization: impl Into<String>, + body: impl Into<models::CloneTestSuiteParams>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `clone_operation_id`: Operation ID returned when we queue a clone operation"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + clone_operation_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + clone_operation_id, + } + } + } + pub mod clone_test_suite { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Clone test suite"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Suite Clone Request Body detail TestSuiteCloneRequest"] - #[doc = "* `project`: Project ID or project name"] - pub fn clone_test_suite( - &self, - organization: impl Into<String>, - body: impl Into<models::CloneTestSuiteParams>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `clone_operation_id`: Operation ID returned when we queue a clone operation"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - clone_operation_id: i32, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - clone_operation_id, - } - } - } - pub mod clone_test_suite { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::CloneTestSuiteOperationInformation> { - let bytes = self.0.into_body().collect().await?; - let body: models::CloneTestSuiteOperationInformation = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CloneTestSuiteParams, - pub(crate) project: String, - pub(crate) deep_clone: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Suites/CloneOperation", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CloneTestSuiteOperationInformation>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::CloneTestSuiteOperationInformation>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::CloneTestSuiteOperationInformation> { - let bytes = self.0.into_body().collect().await?; - let body: models::CloneTestSuiteOperationInformation = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) clone_operation_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Suites/CloneOperation/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.clone_operation_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CloneTestSuiteOperationInformation>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::CloneTestSuiteOperationInformation>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::CloneTestSuiteOperationInformation> { + let bytes = self.0.into_body().collect().await?; + let body: models::CloneTestSuiteOperationInformation = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CloneTestSuiteParams, + pub(crate) project: String, + pub(crate) deep_clone: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Suites/CloneOperation", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CloneTestSuiteOperationInformation>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::CloneTestSuiteOperationInformation>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::CloneTestSuiteOperationInformation> { + let bytes = self.0.into_body().collect().await?; + let body: models::CloneTestSuiteOperationInformation = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) clone_operation_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Suites/CloneOperation/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.clone_operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CloneTestSuiteOperationInformation>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::CloneTestSuiteOperationInformation>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod test_cases { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Delete a test case."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `test_case_id`: Id of test case to be deleted."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + test_case_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_case_id, + } + } + } + pub mod delete { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Delete a test case."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `test_case_id`: Id of test case to be deleted."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - test_case_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - test_case_id, - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) test_case_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/testcases/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.test_case_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) test_case_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/testcases/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.test_case_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod test_case_clone { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn clone_test_case( + &self, + organization: impl Into<String>, + body: impl Into<models::CloneTestCaseParams>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `clone_operation_id`: Operation ID returned when we queue a clone operation"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + clone_operation_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + clone_operation_id, + } + } + } + pub mod clone_test_case { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn clone_test_case( - &self, - organization: impl Into<String>, - body: impl Into<models::CloneTestCaseParams>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `clone_operation_id`: Operation ID returned when we queue a clone operation"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - clone_operation_id: i32, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - clone_operation_id, - } - } - } - pub mod clone_test_case { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::CloneTestCaseOperationInformation> { - let bytes = self.0.into_body().collect().await?; - let body: models::CloneTestCaseOperationInformation = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CloneTestCaseParams, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/TestCases/CloneTestCaseOperation", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CloneTestCaseOperationInformation>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::CloneTestCaseOperationInformation>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::CloneTestCaseOperationInformation> { - let bytes = self.0.into_body().collect().await?; - let body: models::CloneTestCaseOperationInformation = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) clone_operation_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/TestCases/CloneTestCaseOperation/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.clone_operation_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CloneTestCaseOperationInformation>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::CloneTestCaseOperationInformation>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::CloneTestCaseOperationInformation> { + let bytes = self.0.into_body().collect().await?; + let body: models::CloneTestCaseOperationInformation = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CloneTestCaseParams, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/TestCases/CloneTestCaseOperation", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CloneTestCaseOperationInformation>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::CloneTestCaseOperationInformation>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::CloneTestCaseOperationInformation> { + let bytes = self.0.into_body().collect().await?; + let body: models::CloneTestCaseOperationInformation = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) clone_operation_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/TestCases/CloneTestCaseOperation/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.clone_operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CloneTestCaseOperationInformation>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::CloneTestCaseOperationInformation>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod variables { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of test variables."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + continuation_token: None, + } + } + #[doc = "Create a test variable."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: TestVariableCreateUpdateParameters"] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::TestVariableCreateUpdateParameters>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `test_variable_id`: ID of the test variable to get."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: TestVariableCreateUpdateParameters"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `test_variable_id`: ID of the test variable to update."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TestVariableCreateUpdateParameters>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `test_variable_id`: ID of the test variable to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + test_variable_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_variable_id, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of test variables."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - continuation_token: None, - } - } - #[doc = "Create a test variable."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: TestVariableCreateUpdateParameters"] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::TestVariableCreateUpdateParameters>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `test_variable_id`: ID of the test variable to get."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: TestVariableCreateUpdateParameters"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `test_variable_id`: ID of the test variable to update."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TestVariableCreateUpdateParameters>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `test_variable_id`: ID of the test variable to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - test_variable_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - test_variable_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestVariableList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestVariableList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) continuation_token: Option<String>, - } - 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<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/variables", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestVariableList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestVariableList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestVariable> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestVariable = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestVariableCreateUpdateParameters, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/variables", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestVariable>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestVariable>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestVariable> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestVariable = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) test_variable_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/variables/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.test_variable_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestVariable>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestVariable>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestVariable> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestVariable = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestVariableCreateUpdateParameters, - pub(crate) project: String, - pub(crate) test_variable_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/variables/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.test_variable_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestVariable>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestVariable>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) test_variable_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/variables/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.test_variable_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestVariableList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestVariableList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) continuation_token: Option<String>, + } + 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<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/variables", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(continuation_token) = &this.continuation_token { + req + .url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestVariableList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestVariableList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestVariable> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestVariable = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestVariableCreateUpdateParameters, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/variables", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestVariable>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestVariable>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestVariable> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestVariable = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) test_variable_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/variables/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.test_variable_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestVariable>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestVariable>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestVariable> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestVariable = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestVariableCreateUpdateParameters, + pub(crate) project: String, + pub(crate) test_variable_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/variables/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.test_variable_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestVariable>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestVariable>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) test_variable_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/variables/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.test_variable_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } diff --git a/azure_devops_rust_api/src/test_plan/models.rs b/azure_devops_rust_api/src/test_plan/models.rs index 95848cdf..08115c46 100644 --- a/azure_devops_rust_api/src/test_plan/models.rs +++ b/azure_devops_rust_api/src/test_plan/models.rs @@ -8,2495 +8,2493 @@ use std::str::FromStr; #[doc = "The build definition reference resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildDefinitionReference { - #[doc = "ID of the build definition"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the build definition"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "ID of the build definition"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the build definition"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl BuildDefinitionReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Common Response for clone operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneOperationCommonResponse { - #[doc = "Clone Statistics Details."] - #[serde( - rename = "cloneStatistics", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_statistics: Option<CloneStatistics>, - #[doc = "Completion data of the operation"] - #[serde( - rename = "completionDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completion_date: Option<time::OffsetDateTime>, - #[doc = "Creation data of the operation"] - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[doc = "The class to represent a collection of REST reference links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "Message related to the job"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "Clone operation Id"] - #[serde(rename = "opId", default, skip_serializing_if = "Option::is_none")] - pub op_id: Option<i32>, - #[doc = "Clone operation state"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<clone_operation_common_response::State>, + #[doc = "Clone Statistics Details."] + #[serde( + rename = "cloneStatistics", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_statistics: Option<CloneStatistics>, + #[doc = "Completion data of the operation"] + #[serde( + rename = "completionDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completion_date: Option<time::OffsetDateTime>, + #[doc = "Creation data of the operation"] + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "Message related to the job"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "Clone operation Id"] + #[serde(rename = "opId", default, skip_serializing_if = "Option::is_none")] + pub op_id: Option<i32>, + #[doc = "Clone operation state"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<clone_operation_common_response::State>, } impl CloneOperationCommonResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod clone_operation_common_response { - use super::*; - #[doc = "Clone operation state"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "failed")] - Failed, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "succeeded")] - Succeeded, - } + use super::*; + #[doc = "Clone operation state"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "failed")] + Failed, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "succeeded")] + Succeeded, + } } #[doc = "Clone options for cloning the test suite."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneOptions { - #[doc = "If set to true requirements will be cloned"] - #[serde( - rename = "cloneRequirements", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_requirements: Option<bool>, - #[doc = "copy all suites from a source plan"] - #[serde( - rename = "copyAllSuites", - default, - skip_serializing_if = "Option::is_none" - )] - pub copy_all_suites: Option<bool>, - #[doc = "copy ancestor hierarchy"] - #[serde( - rename = "copyAncestorHierarchy", - default, - skip_serializing_if = "Option::is_none" - )] - pub copy_ancestor_hierarchy: Option<bool>, - #[doc = "Name of the workitem type of the clone"] - #[serde( - rename = "destinationWorkItemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_work_item_type: Option<String>, - #[doc = "Key value pairs where the key value is overridden by the value."] - #[serde( - rename = "overrideParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub override_parameters: Option<serde_json::Value>, - #[doc = "Comment on the link that will link the new clone test case to the original Set null for no comment"] - #[serde( - rename = "relatedLinkComment", - default, - skip_serializing_if = "Option::is_none" - )] - pub related_link_comment: Option<String>, + #[doc = "If set to true requirements will be cloned"] + #[serde( + rename = "cloneRequirements", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_requirements: Option<bool>, + #[doc = "copy all suites from a source plan"] + #[serde( + rename = "copyAllSuites", + default, + skip_serializing_if = "Option::is_none" + )] + pub copy_all_suites: Option<bool>, + #[doc = "copy ancestor hierarchy"] + #[serde( + rename = "copyAncestorHierarchy", + default, + skip_serializing_if = "Option::is_none" + )] + pub copy_ancestor_hierarchy: Option<bool>, + #[doc = "Name of the workitem type of the clone"] + #[serde( + rename = "destinationWorkItemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_work_item_type: Option<String>, + #[doc = "Key value pairs where the key value is overridden by the value."] + #[serde( + rename = "overrideParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub override_parameters: Option<serde_json::Value>, + #[doc = "Comment on the link that will link the new clone test case to the original Set null for no comment"] + #[serde( + rename = "relatedLinkComment", + default, + skip_serializing_if = "Option::is_none" + )] + pub related_link_comment: Option<String>, } impl CloneOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Clone Statistics Details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneStatistics { - #[doc = "Number of requirements cloned so far."] - #[serde( - rename = "clonedRequirementsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub cloned_requirements_count: Option<i32>, - #[doc = "Number of shared steps cloned so far."] - #[serde( - rename = "clonedSharedStepsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub cloned_shared_steps_count: Option<i32>, - #[doc = "Number of test cases cloned so far"] - #[serde( - rename = "clonedTestCasesCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub cloned_test_cases_count: Option<i32>, - #[doc = "Total number of requirements to be cloned"] - #[serde( - rename = "totalRequirementsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_requirements_count: Option<i32>, - #[doc = "Total number of test cases to be cloned"] - #[serde( - rename = "totalTestCasesCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_test_cases_count: Option<i32>, + #[doc = "Number of requirements cloned so far."] + #[serde( + rename = "clonedRequirementsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub cloned_requirements_count: Option<i32>, + #[doc = "Number of shared steps cloned so far."] + #[serde( + rename = "clonedSharedStepsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub cloned_shared_steps_count: Option<i32>, + #[doc = "Number of test cases cloned so far"] + #[serde( + rename = "clonedTestCasesCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub cloned_test_cases_count: Option<i32>, + #[doc = "Total number of requirements to be cloned"] + #[serde( + rename = "totalRequirementsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_requirements_count: Option<i32>, + #[doc = "Total number of test cases to be cloned"] + #[serde( + rename = "totalTestCasesCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_test_cases_count: Option<i32>, } impl CloneStatistics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneTestCaseOperationInformation { - #[doc = "Common Response for clone operation"] - #[serde( - rename = "cloneOperationResponse", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_operation_response: Option<CloneOperationCommonResponse>, - #[doc = ""] - #[serde( - rename = "cloneOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_options: Option<CloneTestCaseOptions>, - #[doc = "Test Suite Reference with Project"] - #[serde( - rename = "destinationTestSuite", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_test_suite: Option<TestSuiteReferenceWithProject>, - #[doc = "Source Test Suite Response for Test Case clone operation"] - #[serde( - rename = "sourceTestSuite", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_test_suite: Option<SourceTestSuiteResponse>, + #[doc = "Common Response for clone operation"] + #[serde( + rename = "cloneOperationResponse", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_operation_response: Option<CloneOperationCommonResponse>, + #[doc = ""] + #[serde( + rename = "cloneOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_options: Option<CloneTestCaseOptions>, + #[doc = "Test Suite Reference with Project"] + #[serde( + rename = "destinationTestSuite", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_test_suite: Option<TestSuiteReferenceWithProject>, + #[doc = "Source Test Suite Response for Test Case clone operation"] + #[serde( + rename = "sourceTestSuite", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_test_suite: Option<SourceTestSuiteResponse>, } impl CloneTestCaseOperationInformation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneTestCaseOptions { - #[doc = "If set to true, include the attachments"] - #[serde( - rename = "includeAttachments", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_attachments: Option<bool>, - #[doc = "If set to true, include the links"] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[doc = "Comment on the link that will link the new clone test case to the original Set null for no comment"] - #[serde( - rename = "relatedLinkComment", - default, - skip_serializing_if = "Option::is_none" - )] - pub related_link_comment: Option<String>, + #[doc = "If set to true, include the attachments"] + #[serde( + rename = "includeAttachments", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_attachments: Option<bool>, + #[doc = "If set to true, include the links"] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[doc = "Comment on the link that will link the new clone test case to the original Set null for no comment"] + #[serde( + rename = "relatedLinkComment", + default, + skip_serializing_if = "Option::is_none" + )] + pub related_link_comment: Option<String>, } impl CloneTestCaseOptions { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Parameters for Test Suite clone operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneTestCaseParams { - #[doc = ""] - #[serde( - rename = "cloneOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_options: Option<CloneTestCaseOptions>, - #[doc = "The test plan reference resource."] - #[serde( - rename = "destinationTestPlan", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_test_plan: Option<TestPlanReference>, - #[doc = "Destination Test Suite information for Test Suite clone operation"] - #[serde( - rename = "destinationTestSuite", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_test_suite: Option<DestinationTestSuiteInfo>, - #[doc = "The test plan reference resource."] - #[serde( - rename = "sourceTestPlan", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_test_plan: Option<TestPlanReference>, - #[doc = "Source Test Suite information for Test Suite clone operation"] - #[serde( - rename = "sourceTestSuite", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_test_suite: Option<SourceTestSuiteInfo>, - #[doc = "Test Case IDs"] - #[serde( - rename = "testCaseIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_case_ids: Vec<i32>, + #[doc = ""] + #[serde( + rename = "cloneOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_options: Option<CloneTestCaseOptions>, + #[doc = "The test plan reference resource."] + #[serde( + rename = "destinationTestPlan", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_test_plan: Option<TestPlanReference>, + #[doc = "Destination Test Suite information for Test Suite clone operation"] + #[serde( + rename = "destinationTestSuite", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_test_suite: Option<DestinationTestSuiteInfo>, + #[doc = "The test plan reference resource."] + #[serde( + rename = "sourceTestPlan", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_test_plan: Option<TestPlanReference>, + #[doc = "Source Test Suite information for Test Suite clone operation"] + #[serde( + rename = "sourceTestSuite", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_test_suite: Option<SourceTestSuiteInfo>, + #[doc = "Test Case IDs"] + #[serde( + rename = "testCaseIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_case_ids: Vec<i32>, } impl CloneTestCaseParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Response for Test Plan clone operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneTestPlanOperationInformation { - #[doc = "Common Response for clone operation"] - #[serde( - rename = "cloneOperationResponse", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_operation_response: Option<CloneOperationCommonResponse>, - #[doc = "Clone options for cloning the test suite."] - #[serde( - rename = "cloneOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_options: Option<CloneOptions>, - #[doc = "The test plan resource."] - #[serde( - rename = "destinationTestPlan", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_test_plan: Option<TestPlan>, - #[doc = "Source Test Plan Response for Test Plan clone operation"] - #[serde( - rename = "sourceTestPlan", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_test_plan: Option<SourceTestplanResponse>, + #[doc = "Common Response for clone operation"] + #[serde( + rename = "cloneOperationResponse", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_operation_response: Option<CloneOperationCommonResponse>, + #[doc = "Clone options for cloning the test suite."] + #[serde( + rename = "cloneOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_options: Option<CloneOptions>, + #[doc = "The test plan resource."] + #[serde( + rename = "destinationTestPlan", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_test_plan: Option<TestPlan>, + #[doc = "Source Test Plan Response for Test Plan clone operation"] + #[serde( + rename = "sourceTestPlan", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_test_plan: Option<SourceTestplanResponse>, } impl CloneTestPlanOperationInformation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Parameters for Test Plan clone operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneTestPlanParams { - #[doc = "Clone options for cloning the test suite."] - #[serde( - rename = "cloneOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_options: Option<CloneOptions>, - #[doc = "Destination Test Plan create parameters"] - #[serde( - rename = "destinationTestPlan", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_test_plan: Option<DestinationTestPlanCloneParams>, - #[doc = "Source Test Plan information for Test Plan clone operation"] - #[serde( - rename = "sourceTestPlan", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_test_plan: Option<SourceTestPlanInfo>, + #[doc = "Clone options for cloning the test suite."] + #[serde( + rename = "cloneOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_options: Option<CloneOptions>, + #[doc = "Destination Test Plan create parameters"] + #[serde( + rename = "destinationTestPlan", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_test_plan: Option<DestinationTestPlanCloneParams>, + #[doc = "Source Test Plan information for Test Plan clone operation"] + #[serde( + rename = "sourceTestPlan", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_test_plan: Option<SourceTestPlanInfo>, } impl CloneTestPlanParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Response for Test Suite clone operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneTestSuiteOperationInformation { - #[doc = "Test Suite Reference with Project"] - #[serde( - rename = "clonedTestSuite", - default, - skip_serializing_if = "Option::is_none" - )] - pub cloned_test_suite: Option<TestSuiteReferenceWithProject>, - #[doc = "Common Response for clone operation"] - #[serde( - rename = "cloneOperationResponse", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_operation_response: Option<CloneOperationCommonResponse>, - #[doc = "Clone options for cloning the test suite."] - #[serde( - rename = "cloneOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_options: Option<CloneOptions>, - #[doc = "Test Suite Reference with Project"] - #[serde( - rename = "destinationTestSuite", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_test_suite: Option<TestSuiteReferenceWithProject>, - #[doc = "Test Suite Reference with Project"] - #[serde( - rename = "sourceTestSuite", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_test_suite: Option<TestSuiteReferenceWithProject>, + #[doc = "Test Suite Reference with Project"] + #[serde( + rename = "clonedTestSuite", + default, + skip_serializing_if = "Option::is_none" + )] + pub cloned_test_suite: Option<TestSuiteReferenceWithProject>, + #[doc = "Common Response for clone operation"] + #[serde( + rename = "cloneOperationResponse", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_operation_response: Option<CloneOperationCommonResponse>, + #[doc = "Clone options for cloning the test suite."] + #[serde( + rename = "cloneOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_options: Option<CloneOptions>, + #[doc = "Test Suite Reference with Project"] + #[serde( + rename = "destinationTestSuite", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_test_suite: Option<TestSuiteReferenceWithProject>, + #[doc = "Test Suite Reference with Project"] + #[serde( + rename = "sourceTestSuite", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_test_suite: Option<TestSuiteReferenceWithProject>, } impl CloneTestSuiteOperationInformation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Parameters for Test Suite clone operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CloneTestSuiteParams { - #[doc = "Clone options for cloning the test suite."] - #[serde( - rename = "cloneOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub clone_options: Option<CloneOptions>, - #[doc = "Destination Test Suite information for Test Suite clone operation"] - #[serde( - rename = "destinationTestSuite", - default, - skip_serializing_if = "Option::is_none" - )] - pub destination_test_suite: Option<DestinationTestSuiteInfo>, - #[doc = "Source Test Suite information for Test Suite clone operation"] - #[serde( - rename = "sourceTestSuite", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_test_suite: Option<SourceTestSuiteInfo>, + #[doc = "Clone options for cloning the test suite."] + #[serde( + rename = "cloneOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub clone_options: Option<CloneOptions>, + #[doc = "Destination Test Suite information for Test Suite clone operation"] + #[serde( + rename = "destinationTestSuite", + default, + skip_serializing_if = "Option::is_none" + )] + pub destination_test_suite: Option<DestinationTestSuiteInfo>, + #[doc = "Source Test Suite information for Test Suite clone operation"] + #[serde( + rename = "sourceTestSuite", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_test_suite: Option<SourceTestSuiteInfo>, } impl CloneTestSuiteParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Configuration of the Test Point"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Configuration { - #[doc = "Id of the Configuration Assigned to the Test Point"] - #[serde( - rename = "configurationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub configuration_id: Option<i32>, + #[doc = "Id of the Configuration Assigned to the Test Point"] + #[serde( + rename = "configurationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub configuration_id: Option<i32>, } impl Configuration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Destination Test Plan create parameters"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DestinationTestPlanCloneParams { - #[serde(flatten)] - pub test_plan_create_params: TestPlanCreateParams, - #[doc = "Destination Project Name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<String>, + #[serde(flatten)] + pub test_plan_create_params: TestPlanCreateParams, + #[doc = "Destination Project Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<String>, } impl DestinationTestPlanCloneParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Destination Test Suite information for Test Suite clone operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DestinationTestSuiteInfo { - #[doc = "Destination Suite Id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Destination Project Name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<String>, + #[doc = "Destination Suite Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Destination Project Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<String>, } impl DestinationTestSuiteInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, + } + } } #[doc = "Last result details of test point."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LastResultDetails { - #[doc = "Completed date of last result."] - #[serde( - rename = "dateCompleted", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_completed: Option<time::OffsetDateTime>, - #[doc = "Duration of the last result in milliseconds."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<i64>, - #[doc = ""] - #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] - pub run_by: Option<IdentityRef>, + #[doc = "Completed date of last result."] + #[serde( + rename = "dateCompleted", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_completed: Option<time::OffsetDateTime>, + #[doc = "Duration of the last result in milliseconds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<i64>, + #[doc = ""] + #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] + pub run_by: Option<IdentityRef>, } impl LastResultDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This data model is used in Work item-based tabs of Test Plans Library."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LibraryWorkItemsData { - #[doc = "Specifies the column option field names"] - #[serde( - rename = "columnOptions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub column_options: Vec<String>, - #[doc = "Continuation token to fetch next set of elements. Present only when HasMoreElements is true."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[doc = "Boolean indicating if the WIQL query has exceeded the limit of items returned."] - #[serde( - rename = "exceededWorkItemQueryLimit", - default, - skip_serializing_if = "Option::is_none" - )] - pub exceeded_work_item_query_limit: Option<bool>, - #[doc = "Boolean indicating if there are more elements present than what are being sent."] - #[serde( - rename = "hasMoreElements", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_more_elements: Option<bool>, - #[doc = "Specifies if there was an error while execution of data provider."] - #[serde( - rename = "returnCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub return_code: Option<library_work_items_data::ReturnCode>, - #[doc = "List of work items returned when OrderByField is sent something other than Id."] - #[serde( - rename = "workItemIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_ids: Vec<i32>, - #[doc = "List of work items to be returned."] - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<WorkItemDetails>, + #[doc = "Specifies the column option field names"] + #[serde( + rename = "columnOptions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub column_options: Vec<String>, + #[doc = "Continuation token to fetch next set of elements. Present only when HasMoreElements is true."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[doc = "Boolean indicating if the WIQL query has exceeded the limit of items returned."] + #[serde( + rename = "exceededWorkItemQueryLimit", + default, + skip_serializing_if = "Option::is_none" + )] + pub exceeded_work_item_query_limit: Option<bool>, + #[doc = "Boolean indicating if there are more elements present than what are being sent."] + #[serde( + rename = "hasMoreElements", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_more_elements: Option<bool>, + #[doc = "Specifies if there was an error while execution of data provider."] + #[serde( + rename = "returnCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub return_code: Option<library_work_items_data::ReturnCode>, + #[doc = "List of work items returned when OrderByField is sent something other than Id."] + #[serde( + rename = "workItemIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_ids: Vec<i32>, + #[doc = "List of work items to be returned."] + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<WorkItemDetails>, } impl LibraryWorkItemsData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod library_work_items_data { - use super::*; - #[doc = "Specifies if there was an error while execution of data provider."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ReturnCode { - #[serde(rename = "success")] - Success, - #[serde(rename = "error")] - Error, - } + use super::*; + #[doc = "Specifies if there was an error while execution of data provider."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ReturnCode { + #[serde(rename = "success")] + Success, + #[serde(rename = "error")] + Error, + } } #[doc = "This is the request data contract for LibraryTestCaseDataProvider."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LibraryWorkItemsDataProviderRequest { - #[doc = "Specifies the list of column options to show in test cases table."] - #[serde( - rename = "columnOptions", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub column_options: Vec<String>, - #[doc = "The continuation token required for paging of work items. This is required when getting subsequent sets of work items when OrderByField is Id."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[doc = "List of filter values to be supplied. Currently supported filters are Title, State, AssignedTo, Priority, AreaPath."] - #[serde( - rename = "filterValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub filter_values: Vec<TestPlansLibraryWorkItemFilter>, - #[doc = "Whether the data is to be sorted in ascending or descending order. When not supplied, defaults to descending."] - #[serde( - rename = "isAscending", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_ascending: Option<bool>, - #[doc = "The type of query to run."] - #[serde( - rename = "libraryQueryType", - default, - skip_serializing_if = "Option::is_none" - )] - pub library_query_type: Option<library_work_items_data_provider_request::LibraryQueryType>, - #[doc = "Work item field on which to order the results. When not supplied, defaults to work item IDs."] - #[serde( - rename = "orderByField", - default, - skip_serializing_if = "Option::is_none" - )] - pub order_by_field: Option<String>, - #[doc = "List of work items to query for field details. This is required when getting subsequent sets of work item fields when OrderByField is other than Id."] - #[serde( - rename = "workItemIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_ids: Vec<i32>, + #[doc = "Specifies the list of column options to show in test cases table."] + #[serde( + rename = "columnOptions", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub column_options: Vec<String>, + #[doc = "The continuation token required for paging of work items. This is required when getting subsequent sets of work items when OrderByField is Id."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[doc = "List of filter values to be supplied. Currently supported filters are Title, State, AssignedTo, Priority, AreaPath."] + #[serde( + rename = "filterValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub filter_values: Vec<TestPlansLibraryWorkItemFilter>, + #[doc = "Whether the data is to be sorted in ascending or descending order. When not supplied, defaults to descending."] + #[serde( + rename = "isAscending", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_ascending: Option<bool>, + #[doc = "The type of query to run."] + #[serde( + rename = "libraryQueryType", + default, + skip_serializing_if = "Option::is_none" + )] + pub library_query_type: Option<library_work_items_data_provider_request::LibraryQueryType>, + #[doc = "Work item field on which to order the results. When not supplied, defaults to work item IDs."] + #[serde( + rename = "orderByField", + default, + skip_serializing_if = "Option::is_none" + )] + pub order_by_field: Option<String>, + #[doc = "List of work items to query for field details. This is required when getting subsequent sets of work item fields when OrderByField is other than Id."] + #[serde( + rename = "workItemIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_ids: Vec<i32>, } impl LibraryWorkItemsDataProviderRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod library_work_items_data_provider_request { - use super::*; - #[doc = "The type of query to run."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum LibraryQueryType { - #[serde(rename = "none")] - None, - #[serde(rename = "allTestCases")] - AllTestCases, - #[serde(rename = "testCasesWithActiveBugs")] - TestCasesWithActiveBugs, - #[serde(rename = "testCasesNotLinkedToRequirements")] - TestCasesNotLinkedToRequirements, - #[serde(rename = "testCasesLinkedToRequirements")] - TestCasesLinkedToRequirements, - #[serde(rename = "allSharedSteps")] - AllSharedSteps, - #[serde(rename = "sharedStepsNotLinkedToRequirement")] - SharedStepsNotLinkedToRequirement, - } + use super::*; + #[doc = "The type of query to run."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum LibraryQueryType { + #[serde(rename = "none")] + None, + #[serde(rename = "allTestCases")] + AllTestCases, + #[serde(rename = "testCasesWithActiveBugs")] + TestCasesWithActiveBugs, + #[serde(rename = "testCasesNotLinkedToRequirements")] + TestCasesNotLinkedToRequirements, + #[serde(rename = "testCasesLinkedToRequirements")] + TestCasesLinkedToRequirements, + #[serde(rename = "allSharedSteps")] + AllSharedSteps, + #[serde(rename = "sharedStepsNotLinkedToRequirement")] + SharedStepsNotLinkedToRequirement, + } } #[doc = "Name value pair"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NameValuePair { - #[doc = "Name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Value"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Value"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl NameValuePair { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Assignments for the Test Point"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PointAssignment { - #[serde(flatten)] - pub configuration: Configuration, - #[doc = "Name of the Configuration Assigned to the Test Point"] - #[serde( - rename = "configurationName", - default, - skip_serializing_if = "Option::is_none" - )] - pub configuration_name: Option<String>, - #[doc = "Id of the Test Point"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tester: Option<IdentityRef>, + #[serde(flatten)] + pub configuration: Configuration, + #[doc = "Name of the Configuration Assigned to the Test Point"] + #[serde( + rename = "configurationName", + default, + skip_serializing_if = "Option::is_none" + )] + pub configuration_name: Option<String>, + #[doc = "Id of the Test Point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tester: Option<IdentityRef>, } impl PointAssignment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to release environment resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseEnvironmentDefinitionReference { - #[doc = "ID of the release definition that contains the release environment definition."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "ID of the release environment definition."] - #[serde( - rename = "environmentDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_definition_id: Option<i32>, + #[doc = "ID of the release definition that contains the release environment definition."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "ID of the release environment definition."] + #[serde( + rename = "environmentDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_definition_id: Option<i32>, } impl ReleaseEnvironmentDefinitionReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Results class for Test Point"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Results { - #[doc = "Outcome of the Test Point"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<results::Outcome>, + #[doc = "Outcome of the Test Point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<results::Outcome>, } impl Results { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod results { - use super::*; - #[doc = "Outcome of the Test Point"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Outcome { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "none")] - None, - #[serde(rename = "passed")] - Passed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "inconclusive")] - Inconclusive, - #[serde(rename = "timeout")] - Timeout, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "blocked")] - Blocked, - #[serde(rename = "notExecuted")] - NotExecuted, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - #[serde(rename = "notApplicable")] - NotApplicable, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "notImpacted")] - NotImpacted, - #[serde(rename = "maxValue")] - MaxValue, - } + use super::*; + #[doc = "Outcome of the Test Point"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Outcome { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "none")] + None, + #[serde(rename = "passed")] + Passed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "inconclusive")] + Inconclusive, + #[serde(rename = "timeout")] + Timeout, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "blocked")] + Blocked, + #[serde(rename = "notExecuted")] + NotExecuted, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + #[serde(rename = "notApplicable")] + NotApplicable, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "notImpacted")] + NotImpacted, + #[serde(rename = "maxValue")] + MaxValue, + } } #[doc = "Source Test Plan information for Test Plan clone operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceTestPlanInfo { - #[doc = "ID of the source Test Plan"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Id of suites to be cloned inside source Test Plan"] - #[serde( - rename = "suiteIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub suite_ids: Vec<i32>, + #[doc = "ID of the source Test Plan"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Id of suites to be cloned inside source Test Plan"] + #[serde( + rename = "suiteIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub suite_ids: Vec<i32>, } impl SourceTestPlanInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Source Test Suite information for Test Suite clone operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceTestSuiteInfo { - #[doc = "Id of the Source Test Suite"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, + #[doc = "Id of the Source Test Suite"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, } impl SourceTestSuiteInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Source Test Suite Response for Test Case clone operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceTestSuiteResponse { - #[serde(flatten)] - pub test_suite_reference: TestSuiteReference, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[doc = "Id of suites to be cloned inside source Test Plan"] - #[serde( - rename = "testCaseIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_case_ids: Vec<i32>, + #[serde(flatten)] + pub test_suite_reference: TestSuiteReference, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[doc = "Id of suites to be cloned inside source Test Plan"] + #[serde( + rename = "testCaseIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_case_ids: Vec<i32>, } impl SourceTestSuiteResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Source Test Plan Response for Test Plan clone operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SourceTestplanResponse { - #[serde(flatten)] - pub test_plan_reference: TestPlanReference, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[doc = "Id of suites to be cloned inside source Test Plan"] - #[serde( - rename = "suiteIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub suite_ids: Vec<i32>, + #[serde(flatten)] + pub test_plan_reference: TestPlanReference, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[doc = "Id of suites to be cloned inside source Test Plan"] + #[serde( + rename = "suiteIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub suite_ids: Vec<i32>, } impl SourceTestplanResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A suite entry defines properties for a test suite."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SuiteEntry { - #[serde(flatten)] - pub suite_entry_update_params: SuiteEntryUpdateParams, - #[doc = "Id for the test suite."] - #[serde(rename = "suiteId", default, skip_serializing_if = "Option::is_none")] - pub suite_id: Option<i32>, + #[serde(flatten)] + pub suite_entry_update_params: SuiteEntryUpdateParams, + #[doc = "Id for the test suite."] + #[serde(rename = "suiteId", default, skip_serializing_if = "Option::is_none")] + pub suite_id: Option<i32>, } impl SuiteEntry { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SuiteEntryList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<SuiteEntry>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<SuiteEntry>, } impl SuiteEntryList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A suite entry defines properties for a test suite."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SuiteEntryUpdateParams { - #[doc = "Id of the suite entry in the test suite: either a test case id or child suite id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Sequence number for the suite entry object in the test suite."] - #[serde( - rename = "sequenceNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub sequence_number: Option<i32>, - #[doc = "Defines whether the entry is of type test case or suite."] - #[serde( - rename = "suiteEntryType", - default, - skip_serializing_if = "Option::is_none" - )] - pub suite_entry_type: Option<suite_entry_update_params::SuiteEntryType>, + #[doc = "Id of the suite entry in the test suite: either a test case id or child suite id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Sequence number for the suite entry object in the test suite."] + #[serde( + rename = "sequenceNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub sequence_number: Option<i32>, + #[doc = "Defines whether the entry is of type test case or suite."] + #[serde( + rename = "suiteEntryType", + default, + skip_serializing_if = "Option::is_none" + )] + pub suite_entry_type: Option<suite_entry_update_params::SuiteEntryType>, } impl SuiteEntryUpdateParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod suite_entry_update_params { - use super::*; - #[doc = "Defines whether the entry is of type test case or suite."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SuiteEntryType { - #[serde(rename = "testCase")] - TestCase, - #[serde(rename = "suite")] - Suite, - } + use super::*; + #[doc = "Defines whether the entry is of type test case or suite."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SuiteEntryType { + #[serde(rename = "testCase")] + TestCase, + #[serde(rename = "suite")] + Suite, + } } #[doc = "Create and Update Suite Test Case Parameters"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SuiteTestCaseCreateUpdateParameters { - #[doc = "Configurations Ids"] - #[serde( - rename = "pointAssignments", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub point_assignments: Vec<Configuration>, - #[doc = "Work Item"] - #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] - pub work_item: Option<WorkItem>, + #[doc = "Configurations Ids"] + #[serde( + rename = "pointAssignments", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub point_assignments: Vec<Configuration>, + #[doc = "Work Item"] + #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] + pub work_item: Option<WorkItem>, } impl SuiteTestCaseCreateUpdateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a shallow reference to a TeamProject."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TeamProjectReference { - #[doc = "Project abbreviation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub abbreviation: Option<String>, - #[doc = "Url to default team identity image."] - #[serde( - rename = "defaultTeamImageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_team_image_url: Option<String>, - #[doc = "The project's description (if any)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Project identifier."] - pub id: String, - #[doc = "Project last update time."] - #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] - pub last_update_time: time::OffsetDateTime, - #[doc = "Project name."] - pub name: String, - #[doc = "Project revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, - #[doc = "Project state."] - pub state: team_project_reference::State, - #[doc = "Url to the full version of the object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Project visibility."] - pub visibility: team_project_reference::Visibility, + #[doc = "Project abbreviation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub abbreviation: Option<String>, + #[doc = "Url to default team identity image."] + #[serde( + rename = "defaultTeamImageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_team_image_url: Option<String>, + #[doc = "The project's description (if any)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Project identifier."] + pub id: String, + #[doc = "Project last update time."] + #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] + pub last_update_time: time::OffsetDateTime, + #[doc = "Project name."] + pub name: String, + #[doc = "Project revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i64>, + #[doc = "Project state."] + pub state: team_project_reference::State, + #[doc = "Url to the full version of the object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Project visibility."] + pub visibility: team_project_reference::Visibility, } impl TeamProjectReference { - pub fn new( - id: String, - last_update_time: time::OffsetDateTime, - name: String, - state: team_project_reference::State, - visibility: team_project_reference::Visibility, - ) -> Self { - Self { - abbreviation: None, - default_team_image_url: None, - description: None, - id, - last_update_time, - name, - revision: None, - state, - url: None, - visibility, - } - } + pub fn new( + id: String, + last_update_time: time::OffsetDateTime, + name: String, + state: team_project_reference::State, + visibility: team_project_reference::Visibility, + ) -> Self { + Self { + abbreviation: None, + default_team_image_url: None, + description: None, + id, + last_update_time, + name, + revision: None, + state, + url: None, + visibility, + } + } } pub mod team_project_reference { - use super::*; - #[doc = "Project state."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "deleting")] - Deleting, - #[serde(rename = "new")] - New, - #[serde(rename = "wellFormed")] - WellFormed, - #[serde(rename = "createPending")] - CreatePending, - #[serde(rename = "all")] - All, - #[serde(rename = "unchanged")] - Unchanged, - #[serde(rename = "deleted")] - Deleted, - } - #[doc = "Project visibility."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Visibility { - #[serde(rename = "private")] - Private, - #[serde(rename = "public")] - Public, - #[serde(rename = "organization")] - Organization, - #[serde(rename = "unchanged")] - Unchanged, - } + use super::*; + #[doc = "Project state."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "deleting")] + Deleting, + #[serde(rename = "new")] + New, + #[serde(rename = "wellFormed")] + WellFormed, + #[serde(rename = "createPending")] + CreatePending, + #[serde(rename = "all")] + All, + #[serde(rename = "unchanged")] + Unchanged, + #[serde(rename = "deleted")] + Deleted, + } + #[doc = "Project visibility."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Visibility { + #[serde(rename = "private")] + Private, + #[serde(rename = "public")] + Public, + #[serde(rename = "organization")] + Organization, + #[serde(rename = "unchanged")] + Unchanged, + } } #[doc = "Test Case Class"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCase { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "Order of the TestCase in the Suite"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, - #[doc = "List of Points associated with the Test Case"] - #[serde( - rename = "pointAssignments", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub point_assignments: Vec<PointAssignment>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[doc = "The test plan reference resource."] - #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] - pub test_plan: Option<TestPlanReference>, - #[doc = "The test suite reference resource."] - #[serde(rename = "testSuite", default, skip_serializing_if = "Option::is_none")] - pub test_suite: Option<TestSuiteReference>, - #[doc = "Work Item Class"] - #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] - pub work_item: Option<WorkItemDetails>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "Order of the TestCase in the Suite"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, + #[doc = "List of Points associated with the Test Case"] + #[serde( + rename = "pointAssignments", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub point_assignments: Vec<PointAssignment>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[doc = "The test plan reference resource."] + #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] + pub test_plan: Option<TestPlanReference>, + #[doc = "The test suite reference resource."] + #[serde(rename = "testSuite", default, skip_serializing_if = "Option::is_none")] + pub test_suite: Option<TestSuiteReference>, + #[doc = "Work Item Class"] + #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] + pub work_item: Option<WorkItemDetails>, } impl TestCase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseAssociatedResult { - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Test Configuration Reference"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<TestConfigurationReference>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<test_case_associated_result::Outcome>, - #[doc = "The test plan reference resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub plan: Option<TestPlanReference>, - #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] - pub point_id: Option<i32>, - #[serde(rename = "resultId", default, skip_serializing_if = "Option::is_none")] - pub result_id: Option<i32>, - #[doc = ""] - #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] - pub run_by: Option<IdentityRef>, - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option<i32>, - #[doc = "The test suite reference resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub suite: Option<TestSuiteReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tester: Option<IdentityRef>, + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Test Configuration Reference"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<TestConfigurationReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<test_case_associated_result::Outcome>, + #[doc = "The test plan reference resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plan: Option<TestPlanReference>, + #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] + pub point_id: Option<i32>, + #[serde(rename = "resultId", default, skip_serializing_if = "Option::is_none")] + pub result_id: Option<i32>, + #[doc = ""] + #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] + pub run_by: Option<IdentityRef>, + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option<i32>, + #[doc = "The test suite reference resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub suite: Option<TestSuiteReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tester: Option<IdentityRef>, } impl TestCaseAssociatedResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_case_associated_result { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Outcome { - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "blocked")] - Blocked, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "passed")] - Passed, - #[serde(rename = "ready")] - Ready, - #[serde(rename = "notApplicable")] - NotApplicable, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "timeout")] - Timeout, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - #[serde(rename = "notExecuted")] - NotExecuted, - #[serde(rename = "inconclusive")] - Inconclusive, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "none")] - None, - #[serde(rename = "notImpacted")] - NotImpacted, - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "maxValue")] - MaxValue, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Outcome { + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "blocked")] + Blocked, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "passed")] + Passed, + #[serde(rename = "ready")] + Ready, + #[serde(rename = "notApplicable")] + NotApplicable, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "timeout")] + Timeout, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + #[serde(rename = "notExecuted")] + NotExecuted, + #[serde(rename = "inconclusive")] + Inconclusive, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "none")] + None, + #[serde(rename = "notImpacted")] + NotImpacted, + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "maxValue")] + MaxValue, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestCase>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestCase>, } impl TestCaseList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Case Reference"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseReference { - #[doc = ""] - #[serde( - rename = "assignedTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_to: Option<IdentityRef>, - #[doc = "Test Case Id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Test Case Name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "State of the test case work item"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, + #[doc = ""] + #[serde( + rename = "assignedTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_to: Option<IdentityRef>, + #[doc = "Test Case Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Test Case Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "State of the test case work item"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, } impl TestCaseReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This data model is used in TestCaseResultsDataProvider and populates the data required for initial page load"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseResultsData { - #[doc = ""] - #[serde( - rename = "contextPoint", - default, - skip_serializing_if = "Option::is_none" - )] - pub context_point: Option<TestPointDetailedReference>, - #[doc = "Use to store the results displayed in the table"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<TestCaseAssociatedResult>, - #[doc = "Test Case Name to be displayed in the table header"] - #[serde( - rename = "testCaseName", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_name: Option<String>, + #[doc = ""] + #[serde( + rename = "contextPoint", + default, + skip_serializing_if = "Option::is_none" + )] + pub context_point: Option<TestPointDetailedReference>, + #[doc = "Use to store the results displayed in the table"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<TestCaseAssociatedResult>, + #[doc = "Test Case Name to be displayed in the table header"] + #[serde( + rename = "testCaseName", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_name: Option<String>, } impl TestCaseResultsData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test configuration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestConfiguration { - #[serde(flatten)] - pub test_configuration_create_update_parameters: TestConfigurationCreateUpdateParameters, - #[doc = "Id of the configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, + #[serde(flatten)] + pub test_configuration_create_update_parameters: TestConfigurationCreateUpdateParameters, + #[doc = "Id of the configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, } impl TestConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Configuration Create or Update Parameters"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestConfigurationCreateUpdateParameters { - #[doc = "Description of the configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Is the configuration a default for the test plans"] - #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] - pub is_default: Option<bool>, - #[doc = "Name of the configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "State of the configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<test_configuration_create_update_parameters::State>, - #[doc = "Dictionary of Test Variable, Selected Value"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<NameValuePair>, + #[doc = "Description of the configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Is the configuration a default for the test plans"] + #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] + pub is_default: Option<bool>, + #[doc = "Name of the configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "State of the configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<test_configuration_create_update_parameters::State>, + #[doc = "Dictionary of Test Variable, Selected Value"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<NameValuePair>, } impl TestConfigurationCreateUpdateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_configuration_create_update_parameters { - use super::*; - #[doc = "State of the configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "active")] - Active, - #[serde(rename = "inactive")] - Inactive, - } + use super::*; + #[doc = "State of the configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "active")] + Active, + #[serde(rename = "inactive")] + Inactive, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestConfigurationList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestConfiguration>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestConfiguration>, } impl TestConfigurationList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Configuration Reference"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestConfigurationReference { - #[doc = "Id of the configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Id of the configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TestConfigurationReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Entity Count Used to store test cases count (define tab) and test point count (execute tab) Used to store test cases count (define tab) and test point count (execute tab)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestEntityCount { - #[doc = "Test Entity Count"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Test Plan under which the Test Entities are"] - #[serde( - rename = "testPlanId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_plan_id: Option<i32>, - #[doc = "Test Suite under which the Test Entities are"] - #[serde( - rename = "testSuiteId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_suite_id: Option<i32>, - #[doc = "Total test entities in the suite without the applied filters"] - #[serde( - rename = "totalCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_count: Option<i32>, + #[doc = "Test Entity Count"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Test Plan under which the Test Entities are"] + #[serde( + rename = "testPlanId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_plan_id: Option<i32>, + #[doc = "Test Suite under which the Test Entities are"] + #[serde( + rename = "testSuiteId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_suite_id: Option<i32>, + #[doc = "Total test entities in the suite without the applied filters"] + #[serde( + rename = "totalCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_count: Option<i32>, } impl TestEntityCount { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test environment Detail."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestEnvironment { - #[doc = "Test Environment Id."] - #[serde( - rename = "environmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_id: Option<String>, - #[doc = "Test Environment Name."] - #[serde( - rename = "environmentName", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_name: Option<String>, + #[doc = "Test Environment Id."] + #[serde( + rename = "environmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_id: Option<String>, + #[doc = "Test Environment Name."] + #[serde( + rename = "environmentName", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_name: Option<String>, } impl TestEnvironment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test outcome settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestOutcomeSettings { - #[doc = "Value to configure how test outcomes for the same tests across suites are shown"] - #[serde( - rename = "syncOutcomeAcrossSuites", - default, - skip_serializing_if = "Option::is_none" - )] - pub sync_outcome_across_suites: Option<bool>, + #[doc = "Value to configure how test outcomes for the same tests across suites are shown"] + #[serde( + rename = "syncOutcomeAcrossSuites", + default, + skip_serializing_if = "Option::is_none" + )] + pub sync_outcome_across_suites: Option<bool>, } impl TestOutcomeSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The test plan resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPlan { - #[serde(flatten)] - pub test_plan_update_params: TestPlanUpdateParams, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "ID of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Previous build Id associated with the test plan"] - #[serde( - rename = "previousBuildId", - default, - skip_serializing_if = "Option::is_none" - )] - pub previous_build_id: Option<i32>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[doc = "The test suite reference resource."] - #[serde(rename = "rootSuite", default, skip_serializing_if = "Option::is_none")] - pub root_suite: Option<TestSuiteReference>, - #[doc = ""] - #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")] - pub updated_by: Option<IdentityRef>, - #[doc = "Updated date of the test plan"] - #[serde( - rename = "updatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub updated_date: Option<time::OffsetDateTime>, + #[serde(flatten)] + pub test_plan_update_params: TestPlanUpdateParams, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "ID of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Previous build Id associated with the test plan"] + #[serde( + rename = "previousBuildId", + default, + skip_serializing_if = "Option::is_none" + )] + pub previous_build_id: Option<i32>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[doc = "The test suite reference resource."] + #[serde(rename = "rootSuite", default, skip_serializing_if = "Option::is_none")] + pub root_suite: Option<TestSuiteReference>, + #[doc = ""] + #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")] + pub updated_by: Option<IdentityRef>, + #[doc = "Updated date of the test plan"] + #[serde( + rename = "updatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub updated_date: Option<time::OffsetDateTime>, } impl TestPlan { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The test plan create parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPlanCreateParams { - #[doc = "Area of the test plan."] - #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] - pub area_path: Option<String>, - #[doc = "The build definition reference resource"] - #[serde( - rename = "buildDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_definition: Option<BuildDefinitionReference>, - #[doc = "Build to be tested."] - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option<i32>, - #[doc = "Description of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "End date for the test plan."] - #[serde( - rename = "endDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub end_date: Option<time::OffsetDateTime>, - #[doc = "Iteration path of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub iteration: Option<String>, - #[doc = "Name of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Reference to release environment resource."] - #[serde( - rename = "releaseEnvironmentDefinition", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment_definition: Option<ReleaseEnvironmentDefinitionReference>, - #[doc = "Start date for the test plan."] - #[serde( - rename = "startDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_date: Option<time::OffsetDateTime>, - #[doc = "State of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "Test outcome settings"] - #[serde( - rename = "testOutcomeSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_outcome_settings: Option<TestOutcomeSettings>, + #[doc = "Area of the test plan."] + #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] + pub area_path: Option<String>, + #[doc = "The build definition reference resource"] + #[serde( + rename = "buildDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_definition: Option<BuildDefinitionReference>, + #[doc = "Build to be tested."] + #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] + pub build_id: Option<i32>, + #[doc = "Description of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "End date for the test plan."] + #[serde( + rename = "endDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub end_date: Option<time::OffsetDateTime>, + #[doc = "Iteration path of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iteration: Option<String>, + #[doc = "Name of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Reference to release environment resource."] + #[serde( + rename = "releaseEnvironmentDefinition", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment_definition: Option<ReleaseEnvironmentDefinitionReference>, + #[doc = "Start date for the test plan."] + #[serde( + rename = "startDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_date: Option<time::OffsetDateTime>, + #[doc = "State of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "Test outcome settings"] + #[serde( + rename = "testOutcomeSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_outcome_settings: Option<TestOutcomeSettings>, } impl TestPlanCreateParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The test plan detailed reference resource. Contains additional workitem realted information"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPlanDetailedReference { - #[serde(flatten)] - pub test_plan_reference: TestPlanReference, - #[doc = "Area of the test plan."] - #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] - pub area_path: Option<String>, - #[doc = "End date for the test plan."] - #[serde( - rename = "endDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub end_date: Option<time::OffsetDateTime>, - #[doc = "Iteration path of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub iteration: Option<String>, - #[doc = "Root Suite Id"] - #[serde( - rename = "rootSuiteId", - default, - skip_serializing_if = "Option::is_none" - )] - pub root_suite_id: Option<i32>, - #[doc = "Start date for the test plan."] - #[serde( - rename = "startDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_date: Option<time::OffsetDateTime>, + #[serde(flatten)] + pub test_plan_reference: TestPlanReference, + #[doc = "Area of the test plan."] + #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] + pub area_path: Option<String>, + #[doc = "End date for the test plan."] + #[serde( + rename = "endDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub end_date: Option<time::OffsetDateTime>, + #[doc = "Iteration path of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iteration: Option<String>, + #[doc = "Root Suite Id"] + #[serde( + rename = "rootSuiteId", + default, + skip_serializing_if = "Option::is_none" + )] + pub root_suite_id: Option<i32>, + #[doc = "Start date for the test plan."] + #[serde( + rename = "startDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_date: Option<time::OffsetDateTime>, } impl TestPlanDetailedReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPlanList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestPlan>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestPlan>, } impl TestPlanList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The test plan reference resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPlanReference { - #[doc = "ID of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "ID of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TestPlanReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The test plan update parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPlanUpdateParams { - #[serde(flatten)] - pub test_plan_create_params: TestPlanCreateParams, - #[doc = "Revision of the test plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[serde(flatten)] + pub test_plan_create_params: TestPlanCreateParams, + #[doc = "Revision of the test plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl TestPlanUpdateParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This data model is used in TestPlansHubRefreshDataProvider and populates the data required for initial page load"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPlansHubRefreshData { - #[serde( - rename = "defineColumnOptionFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub define_column_option_fields: Vec<String>, - #[serde( - rename = "defineTabCustomColumnFieldMap", - default, - skip_serializing_if = "Option::is_none" - )] - pub define_tab_custom_column_field_map: Option<serde_json::Value>, - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[serde( - rename = "executeColumnOptionFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub execute_column_option_fields: Vec<String>, - #[serde( - rename = "executeTabCustomColumnFieldMap", - default, - skip_serializing_if = "Option::is_none" - )] - pub execute_tab_custom_column_field_map: Option<serde_json::Value>, - #[serde( - rename = "isAdvancedExtensionEnabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_advanced_extension_enabled: Option<bool>, - #[serde( - rename = "selectedPivotId", - default, - skip_serializing_if = "Option::is_none" - )] - pub selected_pivot_id: Option<String>, - #[serde( - rename = "selectedSuiteId", - default, - skip_serializing_if = "Option::is_none" - )] - pub selected_suite_id: Option<i32>, - #[serde( - rename = "testCasePageSize", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_page_size: Option<i32>, - #[serde( - rename = "testCases", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_cases: Vec<TestCase>, - #[serde( - rename = "testCasesContinuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_cases_continuation_token: Option<String>, - #[doc = "The test plan detailed reference resource. Contains additional workitem realted information"] - #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] - pub test_plan: Option<TestPlanDetailedReference>, - #[serde( - rename = "testPointPageSize", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_point_page_size: Option<i32>, - #[serde( - rename = "testPoints", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_points: Vec<TestPoint>, - #[serde( - rename = "testPointsContinuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_points_continuation_token: Option<String>, - #[serde( - rename = "testSuites", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_suites: Vec<TestSuite>, - #[serde( - rename = "testSuitesContinuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_suites_continuation_token: Option<String>, + #[serde( + rename = "defineColumnOptionFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub define_column_option_fields: Vec<String>, + #[serde( + rename = "defineTabCustomColumnFieldMap", + default, + skip_serializing_if = "Option::is_none" + )] + pub define_tab_custom_column_field_map: Option<serde_json::Value>, + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[serde( + rename = "executeColumnOptionFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub execute_column_option_fields: Vec<String>, + #[serde( + rename = "executeTabCustomColumnFieldMap", + default, + skip_serializing_if = "Option::is_none" + )] + pub execute_tab_custom_column_field_map: Option<serde_json::Value>, + #[serde( + rename = "isAdvancedExtensionEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_advanced_extension_enabled: Option<bool>, + #[serde( + rename = "selectedPivotId", + default, + skip_serializing_if = "Option::is_none" + )] + pub selected_pivot_id: Option<String>, + #[serde( + rename = "selectedSuiteId", + default, + skip_serializing_if = "Option::is_none" + )] + pub selected_suite_id: Option<i32>, + #[serde( + rename = "testCasePageSize", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_page_size: Option<i32>, + #[serde( + rename = "testCases", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_cases: Vec<TestCase>, + #[serde( + rename = "testCasesContinuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_cases_continuation_token: Option<String>, + #[doc = "The test plan detailed reference resource. Contains additional workitem realted information"] + #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] + pub test_plan: Option<TestPlanDetailedReference>, + #[serde( + rename = "testPointPageSize", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_point_page_size: Option<i32>, + #[serde( + rename = "testPoints", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_points: Vec<TestPoint>, + #[serde( + rename = "testPointsContinuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_points_continuation_token: Option<String>, + #[serde( + rename = "testSuites", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_suites: Vec<TestSuite>, + #[serde( + rename = "testSuitesContinuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_suites_continuation_token: Option<String>, } impl TestPlansHubRefreshData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Container to hold information about a filter being applied in Test Plans Library."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPlansLibraryWorkItemFilter { - #[doc = "Work item field name on which the items are to be filtered."] - #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] - pub field_name: Option<String>, - #[doc = "Work item field values corresponding to the field name."] - #[serde( - rename = "fieldValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub field_values: Vec<String>, - #[doc = "Mode of the filter."] - #[serde( - rename = "filterMode", - default, - skip_serializing_if = "Option::is_none" - )] - pub filter_mode: Option<test_plans_library_work_item_filter::FilterMode>, + #[doc = "Work item field name on which the items are to be filtered."] + #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] + pub field_name: Option<String>, + #[doc = "Work item field values corresponding to the field name."] + #[serde( + rename = "fieldValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub field_values: Vec<String>, + #[doc = "Mode of the filter."] + #[serde( + rename = "filterMode", + default, + skip_serializing_if = "Option::is_none" + )] + pub filter_mode: Option<test_plans_library_work_item_filter::FilterMode>, } impl TestPlansLibraryWorkItemFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_plans_library_work_item_filter { - use super::*; - #[doc = "Mode of the filter."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum FilterMode { - #[serde(rename = "or")] - Or, - #[serde(rename = "and")] - And, - } + use super::*; + #[doc = "Mode of the filter."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum FilterMode { + #[serde(rename = "or")] + Or, + #[serde(rename = "and")] + And, + } } #[doc = "Test Point Class"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPoint { - #[doc = "Comment associated to the Test Point"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Test Configuration Reference"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<TestConfigurationReference>, - #[doc = "Id of the Test Point"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Variable to decide whether the test case is Active or not"] - #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")] - pub is_active: Option<bool>, - #[doc = "Is the Test Point for Automated Test Case or Manual"] - #[serde( - rename = "isAutomated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_automated: Option<bool>, - #[doc = "Last Reset to Active Time Stamp for the Test Point"] - #[serde( - rename = "lastResetToActive", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_reset_to_active: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<IdentityRef>, - #[doc = "Last Update Time Stamp for the Test Point"] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "The class to represent a collection of REST reference links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[doc = "Test Point Results"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option<TestPointResults>, - #[doc = "Test Case Reference"] - #[serde( - rename = "testCaseReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_reference: Option<TestCaseReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tester: Option<IdentityRef>, - #[doc = "The test plan reference resource."] - #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] - pub test_plan: Option<TestPlanReference>, - #[doc = "The test suite reference resource."] - #[serde(rename = "testSuite", default, skip_serializing_if = "Option::is_none")] - pub test_suite: Option<TestSuiteReference>, + #[doc = "Comment associated to the Test Point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Test Configuration Reference"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<TestConfigurationReference>, + #[doc = "Id of the Test Point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Variable to decide whether the test case is Active or not"] + #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")] + pub is_active: Option<bool>, + #[doc = "Is the Test Point for Automated Test Case or Manual"] + #[serde( + rename = "isAutomated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_automated: Option<bool>, + #[doc = "Last Reset to Active Time Stamp for the Test Point"] + #[serde( + rename = "lastResetToActive", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_reset_to_active: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<IdentityRef>, + #[doc = "Last Update Time Stamp for the Test Point"] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[doc = "Test Point Results"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub results: Option<TestPointResults>, + #[doc = "Test Case Reference"] + #[serde( + rename = "testCaseReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_reference: Option<TestCaseReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tester: Option<IdentityRef>, + #[doc = "The test plan reference resource."] + #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] + pub test_plan: Option<TestPlanReference>, + #[doc = "The test suite reference resource."] + #[serde(rename = "testSuite", default, skip_serializing_if = "Option::is_none")] + pub test_suite: Option<TestSuiteReference>, } impl TestPoint { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPointDetailedReference { - #[doc = "Test Configuration Reference"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<TestConfigurationReference>, - #[doc = "The test plan reference resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub plan: Option<TestPlanReference>, - #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] - pub point_id: Option<i32>, - #[doc = "The test suite reference resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub suite: Option<TestSuiteReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tester: Option<IdentityRef>, + #[doc = "Test Configuration Reference"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<TestConfigurationReference>, + #[doc = "The test plan reference resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plan: Option<TestPlanReference>, + #[serde(rename = "pointId", default, skip_serializing_if = "Option::is_none")] + pub point_id: Option<i32>, + #[doc = "The test suite reference resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub suite: Option<TestSuiteReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tester: Option<IdentityRef>, } impl TestPointDetailedReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPointList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestPoint>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestPoint>, } impl TestPointList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Point Results"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPointResults { - #[doc = "Failure Type for the Test Point"] - #[serde( - rename = "failureType", - default, - skip_serializing_if = "Option::is_none" - )] - pub failure_type: Option<test_point_results::FailureType>, - #[doc = "Last Resolution State Id for the Test Point"] - #[serde( - rename = "lastResolutionState", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_resolution_state: Option<test_point_results::LastResolutionState>, - #[doc = "Last result details of test point."] - #[serde( - rename = "lastResultDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_result_details: Option<LastResultDetails>, - #[doc = "Last Result Id"] - #[serde( - rename = "lastResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_result_id: Option<i32>, - #[doc = "Last Result State of the Test Point"] - #[serde( - rename = "lastResultState", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_result_state: Option<test_point_results::LastResultState>, - #[doc = "Last RUn Build Number for the Test Point"] - #[serde( - rename = "lastRunBuildNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_run_build_number: Option<String>, - #[doc = "Last Test Run Id for the Test Point"] - #[serde( - rename = "lastTestRunId", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_test_run_id: Option<i32>, - #[doc = "Outcome of the Test Point"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<test_point_results::Outcome>, - #[doc = "State of the Test Point"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<test_point_results::State>, + #[doc = "Failure Type for the Test Point"] + #[serde( + rename = "failureType", + default, + skip_serializing_if = "Option::is_none" + )] + pub failure_type: Option<test_point_results::FailureType>, + #[doc = "Last Resolution State Id for the Test Point"] + #[serde( + rename = "lastResolutionState", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_resolution_state: Option<test_point_results::LastResolutionState>, + #[doc = "Last result details of test point."] + #[serde( + rename = "lastResultDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_result_details: Option<LastResultDetails>, + #[doc = "Last Result Id"] + #[serde( + rename = "lastResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_result_id: Option<i32>, + #[doc = "Last Result State of the Test Point"] + #[serde( + rename = "lastResultState", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_result_state: Option<test_point_results::LastResultState>, + #[doc = "Last RUn Build Number for the Test Point"] + #[serde( + rename = "lastRunBuildNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_run_build_number: Option<String>, + #[doc = "Last Test Run Id for the Test Point"] + #[serde( + rename = "lastTestRunId", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_test_run_id: Option<i32>, + #[doc = "Outcome of the Test Point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<test_point_results::Outcome>, + #[doc = "State of the Test Point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<test_point_results::State>, } impl TestPointResults { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_point_results { - use super::*; - #[doc = "Failure Type for the Test Point"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum FailureType { - #[serde(rename = "none")] - None, - #[serde(rename = "regression")] - Regression, - #[serde(rename = "new_Issue")] - NewIssue, - #[serde(rename = "known_Issue")] - KnownIssue, - #[serde(rename = "unknown")] - Unknown, - #[serde(rename = "null_Value")] - NullValue, - #[serde(rename = "maxValue")] - MaxValue, - } - #[doc = "Last Resolution State Id for the Test Point"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum LastResolutionState { - #[serde(rename = "none")] - None, - #[serde(rename = "needsInvestigation")] - NeedsInvestigation, - #[serde(rename = "testIssue")] - TestIssue, - #[serde(rename = "productIssue")] - ProductIssue, - #[serde(rename = "configurationIssue")] - ConfigurationIssue, - #[serde(rename = "nullValue")] - NullValue, - #[serde(rename = "maxValue")] - MaxValue, - } - #[doc = "Last Result State of the Test Point"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum LastResultState { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "queued")] - Queued, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "maxValue")] - MaxValue, - } - #[doc = "Outcome of the Test Point"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Outcome { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "none")] - None, - #[serde(rename = "passed")] - Passed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "inconclusive")] - Inconclusive, - #[serde(rename = "timeout")] - Timeout, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "blocked")] - Blocked, - #[serde(rename = "notExecuted")] - NotExecuted, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - #[serde(rename = "notApplicable")] - NotApplicable, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "notImpacted")] - NotImpacted, - #[serde(rename = "maxValue")] - MaxValue, - } - #[doc = "State of the Test Point"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "none")] - None, - #[serde(rename = "ready")] - Ready, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "notReady")] - NotReady, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "maxValue")] - MaxValue, - } + use super::*; + #[doc = "Failure Type for the Test Point"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum FailureType { + #[serde(rename = "none")] + None, + #[serde(rename = "regression")] + Regression, + #[serde(rename = "new_Issue")] + NewIssue, + #[serde(rename = "known_Issue")] + KnownIssue, + #[serde(rename = "unknown")] + Unknown, + #[serde(rename = "null_Value")] + NullValue, + #[serde(rename = "maxValue")] + MaxValue, + } + #[doc = "Last Resolution State Id for the Test Point"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum LastResolutionState { + #[serde(rename = "none")] + None, + #[serde(rename = "needsInvestigation")] + NeedsInvestigation, + #[serde(rename = "testIssue")] + TestIssue, + #[serde(rename = "productIssue")] + ProductIssue, + #[serde(rename = "configurationIssue")] + ConfigurationIssue, + #[serde(rename = "nullValue")] + NullValue, + #[serde(rename = "maxValue")] + MaxValue, + } + #[doc = "Last Result State of the Test Point"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum LastResultState { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "queued")] + Queued, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "maxValue")] + MaxValue, + } + #[doc = "Outcome of the Test Point"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Outcome { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "none")] + None, + #[serde(rename = "passed")] + Passed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "inconclusive")] + Inconclusive, + #[serde(rename = "timeout")] + Timeout, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "blocked")] + Blocked, + #[serde(rename = "notExecuted")] + NotExecuted, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + #[serde(rename = "notApplicable")] + NotApplicable, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "notImpacted")] + NotImpacted, + #[serde(rename = "maxValue")] + MaxValue, + } + #[doc = "State of the Test Point"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "none")] + None, + #[serde(rename = "ready")] + Ready, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "notReady")] + NotReady, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "maxValue")] + MaxValue, + } } #[doc = "Test Point Update Parameters"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestPointUpdateParams { - #[doc = "Id of Test Point to be updated"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Reset the Test Point to Active"] - #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")] - pub is_active: Option<bool>, - #[doc = "Results class for Test Point"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option<Results>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tester: Option<IdentityRef>, + #[doc = "Id of Test Point to be updated"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Reset the Test Point to Active"] + #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")] + pub is_active: Option<bool>, + #[doc = "Results class for Test Point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub results: Option<Results>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tester: Option<IdentityRef>, } impl TestPointUpdateParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the test settings of the run. Used to create test settings and fetch test settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSettings { - #[doc = "Area path required to create test settings"] - #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] - pub area_path: Option<String>, - #[doc = "Description of the test settings. Used in create test settings."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Indicates if the tests settings is public or private.Used in create test settings."] - #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] - pub is_public: Option<bool>, - #[doc = "Xml string of machine roles. Used in create test settings."] - #[serde( - rename = "machineRoles", - default, - skip_serializing_if = "Option::is_none" - )] - pub machine_roles: Option<String>, - #[doc = "Test settings content."] - #[serde( - rename = "testSettingsContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_content: Option<String>, - #[doc = "Test settings id."] - #[serde( - rename = "testSettingsId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_id: Option<i32>, - #[doc = "Test settings name."] - #[serde( - rename = "testSettingsName", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_name: Option<String>, + #[doc = "Area path required to create test settings"] + #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] + pub area_path: Option<String>, + #[doc = "Description of the test settings. Used in create test settings."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Indicates if the tests settings is public or private.Used in create test settings."] + #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] + pub is_public: Option<bool>, + #[doc = "Xml string of machine roles. Used in create test settings."] + #[serde( + rename = "machineRoles", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_roles: Option<String>, + #[doc = "Test settings content."] + #[serde( + rename = "testSettingsContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_content: Option<String>, + #[doc = "Test settings id."] + #[serde( + rename = "testSettingsId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_id: Option<i32>, + #[doc = "Test settings name."] + #[serde( + rename = "testSettingsName", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_name: Option<String>, } impl TestSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test suite"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSuite { - #[serde(flatten)] - pub test_suite_create_params: TestSuiteCreateParams, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Child test suites of current test suite."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub children: Vec<TestSuite>, - #[doc = "Boolean value dictating if Child test suites are present"] - #[serde( - rename = "hasChildren", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_children: Option<bool>, - #[doc = "Id of test suite."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Last error for test suite."] - #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] - pub last_error: Option<String>, - #[doc = "Last populated date."] - #[serde( - rename = "lastPopulatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_populated_date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<IdentityRef>, - #[doc = "Last update date."] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "The test plan reference resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub plan: Option<TestPlanReference>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[doc = "Test suite revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[serde(flatten)] + pub test_suite_create_params: TestSuiteCreateParams, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Child test suites of current test suite."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub children: Vec<TestSuite>, + #[doc = "Boolean value dictating if Child test suites are present"] + #[serde( + rename = "hasChildren", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_children: Option<bool>, + #[doc = "Id of test suite."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Last error for test suite."] + #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] + pub last_error: Option<String>, + #[doc = "Last populated date."] + #[serde( + rename = "lastPopulatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_populated_date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<IdentityRef>, + #[doc = "Last update date."] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "The test plan reference resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plan: Option<TestPlanReference>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[doc = "Test suite revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl TestSuite { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test suite Create Parameters"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSuiteCreateParams { - #[serde(flatten)] - pub test_suite_create_update_common_params: TestSuiteCreateUpdateCommonParams, - #[doc = "Test suite requirement id."] - #[serde( - rename = "requirementId", - default, - skip_serializing_if = "Option::is_none" - )] - pub requirement_id: Option<i32>, - #[doc = "Test suite type."] - #[serde(rename = "suiteType", default, skip_serializing_if = "Option::is_none")] - pub suite_type: Option<test_suite_create_params::SuiteType>, + #[serde(flatten)] + pub test_suite_create_update_common_params: TestSuiteCreateUpdateCommonParams, + #[doc = "Test suite requirement id."] + #[serde( + rename = "requirementId", + default, + skip_serializing_if = "Option::is_none" + )] + pub requirement_id: Option<i32>, + #[doc = "Test suite type."] + #[serde(rename = "suiteType", default, skip_serializing_if = "Option::is_none")] + pub suite_type: Option<test_suite_create_params::SuiteType>, } impl TestSuiteCreateParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_suite_create_params { - use super::*; - #[doc = "Test suite type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SuiteType { - #[serde(rename = "none")] - None, - #[serde(rename = "dynamicTestSuite")] - DynamicTestSuite, - #[serde(rename = "staticTestSuite")] - StaticTestSuite, - #[serde(rename = "requirementTestSuite")] - RequirementTestSuite, - } + use super::*; + #[doc = "Test suite type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SuiteType { + #[serde(rename = "none")] + None, + #[serde(rename = "dynamicTestSuite")] + DynamicTestSuite, + #[serde(rename = "staticTestSuite")] + StaticTestSuite, + #[serde(rename = "requirementTestSuite")] + RequirementTestSuite, + } } #[doc = "Test Suite Create/Update Common Parameters"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSuiteCreateUpdateCommonParams { - #[doc = "Test suite default configurations."] - #[serde( - rename = "defaultConfigurations", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub default_configurations: Vec<TestConfigurationReference>, - #[doc = "Test suite default testers."] - #[serde( - rename = "defaultTesters", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub default_testers: Vec<IdentityRef>, - #[doc = "Default configuration was inherited or not."] - #[serde( - rename = "inheritDefaultConfigurations", - default, - skip_serializing_if = "Option::is_none" - )] - pub inherit_default_configurations: Option<bool>, - #[doc = "Name of test suite."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The test suite reference resource."] - #[serde( - rename = "parentSuite", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_suite: Option<TestSuiteReference>, - #[doc = "Test suite query string, for dynamic suites."] - #[serde( - rename = "queryString", - default, - skip_serializing_if = "Option::is_none" - )] - pub query_string: Option<String>, + #[doc = "Test suite default configurations."] + #[serde( + rename = "defaultConfigurations", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub default_configurations: Vec<TestConfigurationReference>, + #[doc = "Test suite default testers."] + #[serde( + rename = "defaultTesters", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub default_testers: Vec<IdentityRef>, + #[doc = "Default configuration was inherited or not."] + #[serde( + rename = "inheritDefaultConfigurations", + default, + skip_serializing_if = "Option::is_none" + )] + pub inherit_default_configurations: Option<bool>, + #[doc = "Name of test suite."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The test suite reference resource."] + #[serde( + rename = "parentSuite", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_suite: Option<TestSuiteReference>, + #[doc = "Test suite query string, for dynamic suites."] + #[serde( + rename = "queryString", + default, + skip_serializing_if = "Option::is_none" + )] + pub query_string: Option<String>, } impl TestSuiteCreateUpdateCommonParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSuiteList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestSuite>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestSuite>, } impl TestSuiteList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The test suite reference resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSuiteReference { - #[doc = "ID of the test suite."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the test suite."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "ID of the test suite."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Name of the test suite."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TestSuiteReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Suite Reference with Project"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSuiteReferenceWithProject { - #[serde(flatten)] - pub test_suite_reference: TestSuiteReference, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, + #[serde(flatten)] + pub test_suite_reference: TestSuiteReference, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, } impl TestSuiteReferenceWithProject { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Suite Update Parameters"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSuiteUpdateParams { - #[serde(flatten)] - pub test_suite_create_update_common_params: TestSuiteCreateUpdateCommonParams, - #[doc = "Test suite revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[serde(flatten)] + pub test_suite_create_update_common_params: TestSuiteCreateUpdateCommonParams, + #[doc = "Test suite revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl TestSuiteUpdateParams { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Variable"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestVariable { - #[serde(flatten)] - pub test_variable_create_update_parameters: TestVariableCreateUpdateParameters, - #[doc = "Id of the test variable"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, + #[serde(flatten)] + pub test_variable_create_update_parameters: TestVariableCreateUpdateParameters, + #[doc = "Id of the test variable"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, } impl TestVariable { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Variable Create or Update Parameters"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestVariableCreateUpdateParameters { - #[doc = "Description of the test variable"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Name of the test variable"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "List of allowed values"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<String>, + #[doc = "Description of the test variable"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Name of the test variable"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "List of allowed values"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<String>, } impl TestVariableCreateUpdateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestVariableList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestVariable>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestVariable>, } impl TestVariableList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Work Item"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItem { - #[doc = "Id of the Work Item"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, + #[doc = "Id of the Work Item"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, } impl WorkItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Work Item Class"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemDetails { - #[doc = "Work Item Id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Work Item Name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Work Item Fields"] - #[serde( - rename = "workItemFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_fields: Vec<serde_json::Value>, + #[doc = "Work Item Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Work Item Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Work Item Fields"] + #[serde( + rename = "workItemFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_fields: Vec<serde_json::Value>, } impl WorkItemDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/test_results/mod.rs b/azure_devops_rust_api/src/test_results/mod.rs index dad8b721..3499806b 100644 --- a/azure_devops_rust_api/src/test_results/mod.rs +++ b/azure_devops_rust_api/src/test_results/mod.rs @@ -9,2699 +9,1772 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://vstmr.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn result_meta_data_client(&self) -> result_meta_data::Client { + result_meta_data::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 mod testlog { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get list of test subresult attachments reference"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: Id of the test run that contains the results"] + #[doc = "* `result_id`: Id of the test result that contains subresult"] + #[doc = "* `sub_result_id`: Id of the test subresult"] + #[doc = "* `type_`: type of the attachments to get"] + pub fn get_test_sub_result_logs( + &self, + organization: impl Into<String>, + project: impl Into<String>, + run_id: i32, + result_id: i32, + sub_result_id: i32, + type_: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: Id of the test run that contains the result"] + #[doc = "* `result_id`: Id of the test result"] + #[doc = "* `type_`: type of attachments to get"] + pub fn get_test_result_logs( + &self, + organization: impl Into<String>, + project: impl Into<String>, + run_id: i32, + result_id: i32, + type_: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: Id of the test run"] + #[doc = "* `type_`: type of the attachments to get"] + pub fn get_test_run_logs( + &self, + organization: impl Into<String>, + project: impl Into<String>, + run_id: i32, + type_: impl Into<String>, + ) -> 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 = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); + } + pub mod get_test_sub_result_logs { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestLogList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestLogList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) result_id: i32, + pub(crate) sub_result_id: i32, + pub(crate) type_: String, + pub(crate) directory_path: Option<String>, + pub(crate) file_name_prefix: Option<String>, + pub(crate) fetch_meta_data: Option<bool>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + } + impl RequestBuilder { + #[doc = "directory path of the attachment to get"] + pub fn directory_path(mut self, directory_path: impl Into<String>) -> Self { + self.directory_path = Some(directory_path.into()); + self + } + #[doc = "Filename prefix to filter the list of attachmentss"] + pub fn file_name_prefix(mut self, file_name_prefix: impl Into<String>) -> Self { + self.file_name_prefix = Some(file_name_prefix.into()); + self + } + #[doc = "Default is false, set if metadata is needed"] + pub fn fetch_meta_data(mut self, fetch_meta_data: bool) -> Self { + self.fetch_meta_data = Some(fetch_meta_data); + self + } + #[doc = "Number of attachment references to return"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); self + } + #[doc = "Header to pass the continuation token"] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlog?subResultId={}&type={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.result_id, + &this.sub_result_id, + &this.type_ + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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_); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestLogList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestLogList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_test_result_logs { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestLogList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestLogList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) result_id: i32, + pub(crate) type_: String, + pub(crate) directory_path: Option<String>, + pub(crate) file_name_prefix: Option<String>, + pub(crate) fetch_meta_data: Option<bool>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); + impl RequestBuilder { + #[doc = "Directory path of attachments to get"] + pub fn directory_path(mut self, directory_path: impl Into<String>) -> Self { + self.directory_path = Some(directory_path.into()); self + } + #[doc = "Filename prefix to filter the list of attachments"] + pub fn file_name_prefix(mut self, file_name_prefix: impl Into<String>) -> Self { + self.file_name_prefix = Some(file_name_prefix.into()); + self + } + #[doc = "Default is false, set if metadata is needed"] + pub fn fetch_meta_data(mut self, fetch_meta_data: bool) -> Self { + self.fetch_meta_data = Some(fetch_meta_data); + self + } + #[doc = "Number of attachment references to return"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Header to pass the continuation token"] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlog", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let type_ = &this.type_; + req.url_mut().query_pairs_mut().append_pair("type", type_); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestLogList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestLogList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_test_run_logs { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestLogList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestLogList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) type_: String, + pub(crate) directory_path: Option<String>, + pub(crate) file_name_prefix: Option<String>, + pub(crate) fetch_meta_data: Option<bool>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + } + impl RequestBuilder { + #[doc = "directory path for which attachments are needed"] + pub fn directory_path(mut self, directory_path: impl Into<String>) -> Self { + self.directory_path = Some(directory_path.into()); + self + } + #[doc = "Filename prefix to filter the list of attachments"] + pub fn file_name_prefix(mut self, file_name_prefix: impl Into<String>) -> Self { + self.file_name_prefix = Some(file_name_prefix.into()); + self + } + #[doc = "Default is false, set if metadata is needed"] + pub fn fetch_meta_data(mut self, fetch_meta_data: bool) -> Self { + self.fetch_meta_data = Some(fetch_meta_data); self + } + #[doc = "Number of attachment references to return"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Header to pass the continuation token"] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/testlog", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let type_ = &this.type_; + req.url_mut().query_pairs_mut().append_pair("type", type_); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestLogList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestLogList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - pub fn result_meta_data_client(&self) -> result_meta_data::Client { - result_meta_data::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 mod testlogstoreendpoint { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get SAS Uri of a test subresults attachment"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: Id of the test run that contains result"] + #[doc = "* `result_id`: Id of the test result that contains subresult"] + #[doc = "* `sub_result_id`: Id of the test subresult whose file sas uri is needed"] + #[doc = "* `type_`: type of the file"] + #[doc = "* `file_path`: filePath for which sas uri is needed"] + pub fn get_test_log_store_endpoint_details_for_sub_result_log( + &self, + organization: impl Into<String>, + project: impl Into<String>, + run_id: i32, + result_id: i32, + sub_result_id: i32, + type_: impl Into<String>, + file_path: impl Into<String>, + ) -> 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(), + } } -} -pub mod testlog { + #[doc = "Get SAS Uri of a test results attachment"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: Id of the test run that contains result"] + #[doc = "* `result_id`: Id of the test result whose files need to be downloaded"] + #[doc = "* `type_`: type of the file"] + #[doc = "* `file_path`: filePath for which sas uri is needed"] + pub fn get_test_log_store_endpoint_details_for_result_log( + &self, + organization: impl Into<String>, + project: impl Into<String>, + run_id: i32, + result_id: i32, + type_: impl Into<String>, + file_path: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: Id of the test run that contains the result"] + #[doc = "* `result_id`: Id of the test results that contains sub result"] + #[doc = "* `sub_result_id`: Id of the test sub result whose file sas uri is needed"] + #[doc = "* `file_path`: file path inside the sub result for which sas uri is needed"] + #[doc = "* `type_`: Type of the file for download"] + pub fn test_log_store_endpoint_details_for_result( + &self, + organization: impl Into<String>, + project: impl Into<String>, + run_id: i32, + result_id: i32, + sub_result_id: i32, + file_path: impl Into<String>, + type_: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: Id of the test run whose file has to be downloaded"] + #[doc = "* `type_`: type of the file"] + #[doc = "* `file_path`: filePath for which sas uri is needed"] + pub fn get_test_log_store_endpoint_details_for_run_log( + &self, + organization: impl Into<String>, + project: impl Into<String>, + run_id: i32, + type_: impl Into<String>, + file_path: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `run_id`: Id of the run to get endpoint details"] + #[doc = "* `test_log_store_operation_type`: Type of operation to perform using sas uri"] + pub fn test_log_store_endpoint_details_for_run( + &self, + organization: impl Into<String>, + project: impl Into<String>, + run_id: i32, + test_log_store_operation_type: impl Into<String>, + ) -> 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, + } + } + } + pub mod get_test_log_store_endpoint_details_for_sub_result_log { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get list of test subresult attachments reference"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Id of the test run that contains the results"] - #[doc = "* `result_id`: Id of the test result that contains subresult"] - #[doc = "* `sub_result_id`: Id of the test subresult"] - #[doc = "* `type_`: type of the attachments to get"] - pub fn get_test_sub_result_logs( - &self, - organization: impl Into<String>, - project: impl Into<String>, - run_id: i32, - result_id: i32, - sub_result_id: i32, - type_: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Id of the test run that contains the result"] - #[doc = "* `result_id`: Id of the test result"] - #[doc = "* `type_`: type of attachments to get"] - pub fn get_test_result_logs( - &self, - organization: impl Into<String>, - project: impl Into<String>, - run_id: i32, - result_id: i32, - type_: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Id of the test run"] - #[doc = "* `type_`: type of the attachments to get"] - pub fn get_test_run_logs( - &self, - organization: impl Into<String>, - project: impl Into<String>, - run_id: i32, - type_: impl Into<String>, - ) -> 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, - } - } - } - pub mod get_test_sub_result_logs { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestLogList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) result_id: i32, - pub(crate) sub_result_id: i32, - pub(crate) type_: String, - pub(crate) directory_path: Option<String>, - pub(crate) file_name_prefix: Option<String>, - pub(crate) fetch_meta_data: Option<bool>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - } - impl RequestBuilder { - #[doc = "directory path of the attachment to get"] - pub fn directory_path(mut self, directory_path: impl Into<String>) -> Self { - self.directory_path = Some(directory_path.into()); - self - } - #[doc = "Filename prefix to filter the list of attachmentss"] - pub fn file_name_prefix(mut self, file_name_prefix: impl Into<String>) -> Self { - self.file_name_prefix = Some(file_name_prefix.into()); - self - } - #[doc = "Default is false, set if metadata is needed"] - pub fn fetch_meta_data(mut self, fetch_meta_data: bool) -> Self { - self.fetch_meta_data = Some(fetch_meta_data); - self - } - #[doc = "Number of attachment references to return"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Header to pass the continuation token"] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlog?subResultId={}&type={}" , this . client . endpoint () , & this . organization , & this . project , & this . run_id , & this . result_id , & this . sub_result_id , & this . type_)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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_); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestLogList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestLogList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_test_result_logs { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestLogList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) result_id: i32, - pub(crate) type_: String, - pub(crate) directory_path: Option<String>, - pub(crate) file_name_prefix: Option<String>, - pub(crate) fetch_meta_data: Option<bool>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - } - impl RequestBuilder { - #[doc = "Directory path of attachments to get"] - pub fn directory_path(mut self, directory_path: impl Into<String>) -> Self { - self.directory_path = Some(directory_path.into()); - self - } - #[doc = "Filename prefix to filter the list of attachments"] - pub fn file_name_prefix(mut self, file_name_prefix: impl Into<String>) -> Self { - self.file_name_prefix = Some(file_name_prefix.into()); - self - } - #[doc = "Default is false, set if metadata is needed"] - pub fn fetch_meta_data(mut self, fetch_meta_data: bool) -> Self { - self.fetch_meta_data = Some(fetch_meta_data); - self - } - #[doc = "Number of attachment references to return"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Header to pass the continuation token"] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlog", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.result_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let type_ = &this.type_; - req.url_mut().query_pairs_mut().append_pair("type", type_); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestLogList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestLogList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_test_run_logs { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestLogList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) type_: String, - pub(crate) directory_path: Option<String>, - pub(crate) file_name_prefix: Option<String>, - pub(crate) fetch_meta_data: Option<bool>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - } - impl RequestBuilder { - #[doc = "directory path for which attachments are needed"] - pub fn directory_path(mut self, directory_path: impl Into<String>) -> Self { - self.directory_path = Some(directory_path.into()); - self - } - #[doc = "Filename prefix to filter the list of attachments"] - pub fn file_name_prefix(mut self, file_name_prefix: impl Into<String>) -> Self { - self.file_name_prefix = Some(file_name_prefix.into()); - self - } - #[doc = "Default is false, set if metadata is needed"] - pub fn fetch_meta_data(mut self, fetch_meta_data: bool) -> Self { - self.fetch_meta_data = Some(fetch_meta_data); - self - } - #[doc = "Number of attachment references to return"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Header to pass the continuation token"] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testlog", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let type_ = &this.type_; - req.url_mut().query_pairs_mut().append_pair("type", type_); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestLogList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestLogList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestLogStoreEndpointDetails> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestLogStoreEndpointDetails = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod testlogstoreendpoint { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) result_id: i32, + pub(crate) sub_result_id: i32, + pub(crate) type_: String, + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint?subResultId={}&type={}&filePath={}" , this . client . endpoint () , & this . organization , & this . project , & this . run_id , & this . result_id , & this . sub_result_id , & this . type_ , & this . file_path)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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_); + let file_path = &this.file_path; + req + .url_mut() + .query_pairs_mut() + .append_pair("filePath", file_path); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestLogStoreEndpointDetails>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::TestLogStoreEndpointDetails>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_test_log_store_endpoint_details_for_result_log { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get SAS Uri of a test subresults attachment"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Id of the test run that contains result"] - #[doc = "* `result_id`: Id of the test result that contains subresult"] - #[doc = "* `sub_result_id`: Id of the test subresult whose file sas uri is needed"] - #[doc = "* `type_`: type of the file"] - #[doc = "* `file_path`: filePath for which sas uri is needed"] - pub fn get_test_log_store_endpoint_details_for_sub_result_log( - &self, - organization: impl Into<String>, - project: impl Into<String>, - run_id: i32, - result_id: i32, - sub_result_id: i32, - type_: impl Into<String>, - file_path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Id of the test run that contains result"] - #[doc = "* `result_id`: Id of the test result whose files need to be downloaded"] - #[doc = "* `type_`: type of the file"] - #[doc = "* `file_path`: filePath for which sas uri is needed"] - pub fn get_test_log_store_endpoint_details_for_result_log( - &self, - organization: impl Into<String>, - project: impl Into<String>, - run_id: i32, - result_id: i32, - type_: impl Into<String>, - file_path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Id of the test run that contains the result"] - #[doc = "* `result_id`: Id of the test results that contains sub result"] - #[doc = "* `sub_result_id`: Id of the test sub result whose file sas uri is needed"] - #[doc = "* `file_path`: file path inside the sub result for which sas uri is needed"] - #[doc = "* `type_`: Type of the file for download"] - pub fn test_log_store_endpoint_details_for_result( - &self, - organization: impl Into<String>, - project: impl Into<String>, - run_id: i32, - result_id: i32, - sub_result_id: i32, - file_path: impl Into<String>, - type_: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Id of the test run whose file has to be downloaded"] - #[doc = "* `type_`: type of the file"] - #[doc = "* `file_path`: filePath for which sas uri is needed"] - pub fn get_test_log_store_endpoint_details_for_run_log( - &self, - organization: impl Into<String>, - project: impl Into<String>, - run_id: i32, - type_: impl Into<String>, - file_path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Id of the run to get endpoint details"] - #[doc = "* `test_log_store_operation_type`: Type of operation to perform using sas uri"] - pub fn test_log_store_endpoint_details_for_run( - &self, - organization: impl Into<String>, - project: impl Into<String>, - run_id: i32, - test_log_store_operation_type: impl Into<String>, - ) -> 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, - } - } - } - pub mod get_test_log_store_endpoint_details_for_sub_result_log { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TestLogStoreEndpointDetails> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreEndpointDetails = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) result_id: i32, - pub(crate) sub_result_id: i32, - pub(crate) type_: String, - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint?subResultId={}&type={}&filePath={}" , this . client . endpoint () , & this . organization , & this . project , & this . run_id , & this . result_id , & this . sub_result_id , & this . type_ , & this . file_path)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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_); - let file_path = &this.file_path; - req.url_mut() - .query_pairs_mut() - .append_pair("filePath", file_path); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestLogStoreEndpointDetails>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestLogStoreEndpointDetails>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_test_log_store_endpoint_details_for_result_log { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TestLogStoreEndpointDetails> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreEndpointDetails = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) result_id: i32, - pub(crate) type_: String, - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.result_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let type_ = &this.type_; - req.url_mut().query_pairs_mut().append_pair("type", type_); - let file_path = &this.file_path; - req.url_mut() - .query_pairs_mut() - .append_pair("filePath", file_path); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestLogStoreEndpointDetails>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestLogStoreEndpointDetails>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod test_log_store_endpoint_details_for_result { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TestLogStoreEndpointDetails> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreEndpointDetails = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) result_id: i32, - pub(crate) sub_result_id: i32, - pub(crate) file_path: String, - pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.result_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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_); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestLogStoreEndpointDetails>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestLogStoreEndpointDetails>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_test_log_store_endpoint_details_for_run_log { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TestLogStoreEndpointDetails> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreEndpointDetails = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) type_: String, - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testlogstoreendpoint", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let type_ = &this.type_; - req.url_mut().query_pairs_mut().append_pair("type", type_); - let file_path = &this.file_path; - req.url_mut() - .query_pairs_mut() - .append_pair("filePath", file_path); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestLogStoreEndpointDetails>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestLogStoreEndpointDetails>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod test_log_store_endpoint_details_for_run { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TestLogStoreEndpointDetails> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreEndpointDetails = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) test_log_store_operation_type: String, - pub(crate) file_path: Option<String>, - pub(crate) type_: Option<String>, - } - impl RequestBuilder { - #[doc = "file path to create an empty file"] - pub fn file_path(mut self, file_path: impl Into<String>) -> Self { - self.file_path = Some(file_path.into()); - self - } - #[doc = "Default is GeneralAttachment, type of empty file to be created"] - pub fn type_(mut self, type_: impl Into<String>) -> Self { - self.type_ = Some(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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testlogstoreendpoint", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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, - ); - 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_); - } - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestLogStoreEndpointDetails>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestLogStoreEndpointDetails>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestLogStoreEndpointDetails> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestLogStoreEndpointDetails = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod testattachments { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) result_id: i32, + pub(crate) type_: String, + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let type_ = &this.type_; + req.url_mut().query_pairs_mut().append_pair("type", type_); + let file_path = &this.file_path; + req + .url_mut() + .query_pairs_mut() + .append_pair("filePath", file_path); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestLogStoreEndpointDetails>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::TestLogStoreEndpointDetails>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod test_log_store_endpoint_details_for_result { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Test RunId"] - #[doc = "* `filename`: Attachment FileName"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - run_id: i32, - filename: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Test RunId"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Contains attachment info like stream, filename, comment, attachmentType"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Test RunId"] - pub fn create_test_run_log_store_attachment( - &self, - organization: impl Into<String>, - body: impl Into<models::TestAttachmentRequestModel>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `run_id`: Test RunId"] - #[doc = "* `filename`: Attachment FileName"] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - run_id: i32, - filename: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Contains attachment info like stream, filename, comment, attachmentType"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `build_id`: BuildId"] - pub fn create_build_attachment_in_log_store( - &self, - organization: impl Into<String>, - body: impl Into<models::TestAttachmentRequestModel>, - project: impl Into<String>, - 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) filename: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testattachments?filename={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id, - &this.filename - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let filename = &this.filename; - req.url_mut() - .query_pairs_mut() - .append_pair("filename", filename); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestLogStoreAttachmentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreAttachmentList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testattachments", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestLogStoreAttachmentList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestLogStoreAttachmentList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_test_run_log_store_attachment { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TestLogStoreAttachmentReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestLogStoreAttachmentReference = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestAttachmentRequestModel, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testattachments", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestLogStoreAttachmentReference>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestLogStoreAttachmentReference>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) run_id: i32, - pub(crate) filename: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testattachments", - this.client.endpoint(), - &this.organization, - &this.project, - &this.run_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let filename = &this.filename; - req.url_mut() - .query_pairs_mut() - .append_pair("filename", filename); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod create_build_attachment_in_log_store { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestAttachmentRequestModel, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/uploadbuildattachments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.build_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestLogStoreEndpointDetails> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestLogStoreEndpointDetails = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) result_id: i32, + pub(crate) sub_result_id: i32, + pub(crate) file_path: String, + pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id, + &this.result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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_); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestLogStoreEndpointDetails>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::TestLogStoreEndpointDetails>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_test_log_store_endpoint_details_for_run_log { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestLogStoreEndpointDetails> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestLogStoreEndpointDetails = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) type_: String, + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/testlogstoreendpoint", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let type_ = &this.type_; + req.url_mut().query_pairs_mut().append_pair("type", type_); + let file_path = &this.file_path; + req + .url_mut() + .query_pairs_mut() + .append_pair("filePath", file_path); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestLogStoreEndpointDetails>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::TestLogStoreEndpointDetails>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod test_log_store_endpoint_details_for_run { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestLogStoreEndpointDetails> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestLogStoreEndpointDetails = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) run_id: i32, + pub(crate) test_log_store_operation_type: String, + pub(crate) file_path: Option<String>, + pub(crate) type_: Option<String>, + } + impl RequestBuilder { + #[doc = "file path to create an empty file"] + pub fn file_path(mut self, file_path: impl Into<String>) -> Self { + self.file_path = Some(file_path.into()); + self + } + #[doc = "Default is GeneralAttachment, type of empty file to be created"] + pub fn type_(mut self, type_: impl Into<String>) -> Self { + self.type_ = Some(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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/testlogstoreendpoint", + this.client.endpoint(), + &this.organization, + &this.project, + &this.run_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + 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_); + } + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestLogStoreEndpointDetails>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::TestLogStoreEndpointDetails>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod result_meta_data { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get list of test Result meta data details for corresponding testcasereferenceId"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: TestCaseReference Ids of the test Result to be queried, comma separated list of valid ids (limit no. of ids 200)."] + #[doc = "* `project`: Project ID or project name"] + pub fn query( + &self, + organization: impl Into<String>, + body: Vec<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: TestResultMetaData update input TestResultMetaDataUpdateInput"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `test_case_reference_id`: TestCaseReference Id of Test Result to be updated."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TestResultMetaDataUpdateInput>, + project: impl Into<String>, + 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 query { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get list of test Result meta data details for corresponding testcasereferenceId"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: TestCaseReference Ids of the test Result to be queried, comma separated list of valid ids (limit no. of ids 200)."] - #[doc = "* `project`: Project ID or project name"] - pub fn query( - &self, - organization: impl Into<String>, - body: Vec<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: TestResultMetaData update input TestResultMetaDataUpdateInput"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `test_case_reference_id`: TestCaseReference Id of Test Result to be updated."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TestResultMetaDataUpdateInput>, - project: impl Into<String>, - 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 query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestResultMetaDataList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultMetaDataList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<String>, - pub(crate) project: String, - pub(crate) details_to_include: Option<String>, - } - impl RequestBuilder { - #[doc = "Details to include with test results metadata. Default is None. Other values are FlakyIdentifiers."] - pub fn details_to_include(mut self, details_to_include: impl Into<String>) -> Self { - self.details_to_include = Some(details_to_include.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/results/resultmetadata", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - if let Some(details_to_include) = &this.details_to_include { - req.url_mut() - .query_pairs_mut() - .append_pair("detailsToInclude", details_to_include); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestResultMetaDataList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestResultMetaDataList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestResultMetaData> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultMetaData = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestResultMetaDataUpdateInput, - pub(crate) project: String, - pub(crate) test_case_reference_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/results/resultmetadata/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.test_case_reference_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestResultMetaData>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TestResultMetaData>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestResultMetaDataList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestResultMetaDataList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod testfailuretype { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<String>, + pub(crate) project: String, + pub(crate) details_to_include: Option<String>, + } + impl RequestBuilder { + #[doc = "Details to include with test results metadata. Default is None. Other values are FlakyIdentifiers."] + pub fn details_to_include(mut self, details_to_include: impl Into<String>) -> Self { + self.details_to_include = Some(details_to_include.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/results/resultmetadata", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + if let Some(details_to_include) = &this.details_to_include { + req + .url_mut() + .query_pairs_mut() + .append_pair("detailsToInclude", details_to_include); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestResultMetaDataList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestResultMetaDataList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns the list of test failure types."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - #[doc = "Creates a new test failure type"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::TestResultFailureTypeRequestModel>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - failure_type_id: i32, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - failure_type_id, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestResultFailureTypeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultFailureTypeList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testfailuretype", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestResultFailureTypeList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestResultFailureTypeList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TestResultFailureType> { - let bytes = self.0.into_body().collect().await?; - let body: models::TestResultFailureType = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TestResultFailureTypeRequestModel, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testfailuretype", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TestResultFailureType>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TestResultFailureType>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) failure_type_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testfailuretype/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.failure_type_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TestResultMetaData> { + let bytes = self.0.into_body().collect().await?; + let body: models::TestResultMetaData = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TestResultMetaDataUpdateInput, + pub(crate) project: String, + pub(crate) test_case_reference_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/results/resultmetadata/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.test_case_reference_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TestResultMetaData>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TestResultMetaData>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/test_results/models.rs b/azure_devops_rust_api/src/test_results/models.rs index 69842631..2aa0907f 100644 --- a/azure_devops_rust_api/src/test_results/models.rs +++ b/azure_devops_rust_api/src/test_results/models.rs @@ -8,4534 +8,4410 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedDataForResultTrend { - #[doc = "This is tests execution duration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[serde( - rename = "resultsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_by_outcome: Option<serde_json::Value>, - #[serde( - rename = "runSummaryByState", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary_by_state: Option<serde_json::Value>, - #[doc = ""] - #[serde( - rename = "testResultsContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_results_context: Option<TestResultsContext>, - #[serde( - rename = "totalTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_tests: Option<i32>, + #[doc = "This is tests execution duration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[serde( + rename = "resultsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_by_outcome: Option<serde_json::Value>, + #[serde( + rename = "runSummaryByState", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary_by_state: Option<serde_json::Value>, + #[doc = ""] + #[serde( + rename = "testResultsContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_results_context: Option<TestResultsContext>, + #[serde( + rename = "totalTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_tests: Option<i32>, } impl AggregatedDataForResultTrend { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Result deatils for a particular test result outcome."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedResultDetailsByOutcome { - #[doc = "Number of results for current outcome."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Time taken by results."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[doc = "Test result outcome"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<aggregated_result_details_by_outcome::Outcome>, - #[doc = "Number of results on rerun"] - #[serde( - rename = "rerunResultCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub rerun_result_count: Option<i32>, + #[doc = "Number of results for current outcome."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Time taken by results."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[doc = "Test result outcome"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<aggregated_result_details_by_outcome::Outcome>, + #[doc = "Number of results on rerun"] + #[serde( + rename = "rerunResultCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub rerun_result_count: Option<i32>, } impl AggregatedResultDetailsByOutcome { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod aggregated_result_details_by_outcome { - use super::*; - #[doc = "Test result outcome"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Outcome { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "none")] - None, - #[serde(rename = "passed")] - Passed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "inconclusive")] - Inconclusive, - #[serde(rename = "timeout")] - Timeout, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "blocked")] - Blocked, - #[serde(rename = "notExecuted")] - NotExecuted, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - #[serde(rename = "notApplicable")] - NotApplicable, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "notImpacted")] - NotImpacted, - } + use super::*; + #[doc = "Test result outcome"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Outcome { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "none")] + None, + #[serde(rename = "passed")] + Passed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "inconclusive")] + Inconclusive, + #[serde(rename = "timeout")] + Timeout, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "blocked")] + Blocked, + #[serde(rename = "notExecuted")] + NotExecuted, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + #[serde(rename = "notApplicable")] + NotApplicable, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "notImpacted")] + NotImpacted, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedResultsAnalysis { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[serde( - rename = "notReportedResultsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub not_reported_results_by_outcome: Option<serde_json::Value>, - #[doc = ""] - #[serde( - rename = "previousContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub previous_context: Option<TestResultsContext>, - #[serde( - rename = "resultsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_by_outcome: Option<serde_json::Value>, - #[doc = ""] - #[serde( - rename = "resultsDifference", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_difference: Option<AggregatedResultsDifference>, - #[serde( - rename = "runSummaryByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary_by_outcome: Option<serde_json::Value>, - #[serde( - rename = "runSummaryByState", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary_by_state: Option<serde_json::Value>, - #[serde( - rename = "totalTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_tests: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[serde( + rename = "notReportedResultsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub not_reported_results_by_outcome: Option<serde_json::Value>, + #[doc = ""] + #[serde( + rename = "previousContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub previous_context: Option<TestResultsContext>, + #[serde( + rename = "resultsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_by_outcome: Option<serde_json::Value>, + #[doc = ""] + #[serde( + rename = "resultsDifference", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_difference: Option<AggregatedResultsDifference>, + #[serde( + rename = "runSummaryByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary_by_outcome: Option<serde_json::Value>, + #[serde( + rename = "runSummaryByState", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary_by_state: Option<serde_json::Value>, + #[serde( + rename = "totalTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_tests: Option<i32>, } impl AggregatedResultsAnalysis { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedResultsByOutcome { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[serde( - rename = "groupByField", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_field: Option<String>, - #[serde( - rename = "groupByValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_value: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<aggregated_results_by_outcome::Outcome>, - #[serde( - rename = "rerunResultCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub rerun_result_count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[serde( + rename = "groupByField", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_field: Option<String>, + #[serde( + rename = "groupByValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_value: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<aggregated_results_by_outcome::Outcome>, + #[serde( + rename = "rerunResultCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub rerun_result_count: Option<i32>, } impl AggregatedResultsByOutcome { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod aggregated_results_by_outcome { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Outcome { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "none")] - None, - #[serde(rename = "passed")] - Passed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "inconclusive")] - Inconclusive, - #[serde(rename = "timeout")] - Timeout, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "blocked")] - Blocked, - #[serde(rename = "notExecuted")] - NotExecuted, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - #[serde(rename = "notApplicable")] - NotApplicable, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "notImpacted")] - NotImpacted, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Outcome { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "none")] + None, + #[serde(rename = "passed")] + Passed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "inconclusive")] + Inconclusive, + #[serde(rename = "timeout")] + Timeout, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "blocked")] + Blocked, + #[serde(rename = "notExecuted")] + NotExecuted, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + #[serde(rename = "notApplicable")] + NotApplicable, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "notImpacted")] + NotImpacted, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedResultsDifference { - #[serde( - rename = "increaseInDuration", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_duration: Option<String>, - #[serde( - rename = "increaseInFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_failures: Option<i32>, - #[serde( - rename = "increaseInNonImpactedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_non_impacted_tests: Option<i32>, - #[serde( - rename = "increaseInOtherTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_other_tests: Option<i32>, - #[serde( - rename = "increaseInPassedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_passed_tests: Option<i32>, - #[serde( - rename = "increaseInTotalTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub increase_in_total_tests: Option<i32>, + #[serde( + rename = "increaseInDuration", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_duration: Option<String>, + #[serde( + rename = "increaseInFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_failures: Option<i32>, + #[serde( + rename = "increaseInNonImpactedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_non_impacted_tests: Option<i32>, + #[serde( + rename = "increaseInOtherTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_other_tests: Option<i32>, + #[serde( + rename = "increaseInPassedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_passed_tests: Option<i32>, + #[serde( + rename = "increaseInTotalTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub increase_in_total_tests: Option<i32>, } impl AggregatedResultsDifference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedRunsByOutcome { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<aggregated_runs_by_outcome::Outcome>, - #[serde(rename = "runsCount", default, skip_serializing_if = "Option::is_none")] - pub runs_count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<aggregated_runs_by_outcome::Outcome>, + #[serde(rename = "runsCount", default, skip_serializing_if = "Option::is_none")] + pub runs_count: Option<i32>, } impl AggregatedRunsByOutcome { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod aggregated_runs_by_outcome { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Outcome { - #[serde(rename = "passed")] - Passed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "notImpacted")] - NotImpacted, - #[serde(rename = "others")] - Others, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Outcome { + #[serde(rename = "passed")] + Passed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "notImpacted")] + NotImpacted, + #[serde(rename = "others")] + Others, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AggregatedRunsByState { - #[serde( - rename = "resultsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_by_outcome: Option<serde_json::Value>, - #[serde(rename = "runsCount", default, skip_serializing_if = "Option::is_none")] - pub runs_count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<aggregated_runs_by_state::State>, + #[serde( + rename = "resultsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_by_outcome: Option<serde_json::Value>, + #[serde(rename = "runsCount", default, skip_serializing_if = "Option::is_none")] + pub runs_count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<aggregated_runs_by_state::State>, } impl AggregatedRunsByState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod aggregated_runs_by_state { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "notStarted")] - NotStarted, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "waiting")] - Waiting, - #[serde(rename = "needsInvestigation")] - NeedsInvestigation, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "notStarted")] + NotStarted, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "waiting")] + Waiting, + #[serde(rename = "needsInvestigation")] + NeedsInvestigation, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Attachment { - #[serde( - rename = "compressionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub compression_type: Option<String>, - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stream: Option<String>, + #[serde( + rename = "compressionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub compression_type: Option<String>, + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stream: Option<String>, } impl Attachment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "BuildConfiguration Details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildConfiguration { - #[doc = "Branch name for which build is generated."] - #[serde( - rename = "branchName", - default, - skip_serializing_if = "Option::is_none" - )] - pub branch_name: Option<String>, - #[doc = "BuildDefinitionId for build."] - #[serde( - rename = "buildDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_definition_id: Option<i32>, - #[doc = "Build system."] - #[serde( - rename = "buildSystem", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_system: Option<String>, - #[doc = "Build Creation Date."] - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[doc = "Build flavor (eg Build/Release)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub flavor: Option<String>, - #[doc = "BuildConfiguration Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Build Number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub number: Option<String>, - #[doc = "BuildConfiguration Platform."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub platform: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, - #[doc = "Repository Guid for the Build."] - #[serde( - rename = "repositoryGuid", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_guid: Option<String>, - #[doc = "Repository Type (eg. TFSGit)."] - #[serde( - rename = "repositoryType", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_type: Option<String>, - #[doc = "Source Version(/first commit) for the build was triggered."] - #[serde( - rename = "sourceVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_version: Option<String>, - #[doc = "Target BranchName."] - #[serde( - rename = "targetBranchName", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_branch_name: Option<String>, - #[doc = "Build Uri."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, + #[doc = "Branch name for which build is generated."] + #[serde( + rename = "branchName", + default, + skip_serializing_if = "Option::is_none" + )] + pub branch_name: Option<String>, + #[doc = "BuildDefinitionId for build."] + #[serde( + rename = "buildDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_definition_id: Option<i32>, + #[doc = "Build system."] + #[serde( + rename = "buildSystem", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_system: Option<String>, + #[doc = "Build Creation Date."] + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[doc = "Build flavor (eg Build/Release)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub flavor: Option<String>, + #[doc = "BuildConfiguration Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Build Number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub number: Option<String>, + #[doc = "BuildConfiguration Platform."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub platform: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, + #[doc = "Repository Guid for the Build."] + #[serde( + rename = "repositoryGuid", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_guid: Option<String>, + #[doc = "Repository Type (eg. TFSGit)."] + #[serde( + rename = "repositoryType", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_type: Option<String>, + #[doc = "Source Version(/first commit) for the build was triggered."] + #[serde( + rename = "sourceVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_version: Option<String>, + #[doc = "Target BranchName."] + #[serde( + rename = "targetBranchName", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_branch_name: Option<String>, + #[doc = "Build Uri."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, } impl BuildConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Build Coverage Detail"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildCoverage { - #[doc = "Code Coverage File Url"] - #[serde( - rename = "codeCoverageFileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub code_coverage_file_url: Option<String>, - #[doc = "BuildConfiguration Details."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<BuildConfiguration>, - #[doc = "Last Error"] - #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] - pub last_error: Option<String>, - #[doc = "List of Modules"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub modules: Vec<ModuleCoverage>, - #[doc = "State"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, + #[doc = "Code Coverage File Url"] + #[serde( + rename = "codeCoverageFileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub code_coverage_file_url: Option<String>, + #[doc = "BuildConfiguration Details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<BuildConfiguration>, + #[doc = "Last Error"] + #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] + pub last_error: Option<String>, + #[doc = "List of Modules"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub modules: Vec<ModuleCoverage>, + #[doc = "State"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, } impl BuildCoverage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to a build."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BuildReference { - #[doc = "Branch name."] - #[serde( - rename = "branchName", - default, - skip_serializing_if = "Option::is_none" - )] - pub branch_name: Option<String>, - #[doc = "Build system."] - #[serde( - rename = "buildSystem", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_system: Option<String>, - #[doc = "Build Definition ID."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "Build ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Build Number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub number: Option<String>, - #[doc = "Repository ID."] - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, - #[doc = "Build URI."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uri: Option<String>, + #[doc = "Branch name."] + #[serde( + rename = "branchName", + default, + skip_serializing_if = "Option::is_none" + )] + pub branch_name: Option<String>, + #[doc = "Build system."] + #[serde( + rename = "buildSystem", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_system: Option<String>, + #[doc = "Build Definition ID."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "Build ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Build Number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub number: Option<String>, + #[doc = "Repository ID."] + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, + #[doc = "Build URI."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option<String>, } impl BuildReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the build configuration (platform, flavor) and coverage data for the build"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CodeCoverageData { - #[doc = "Flavor of build for which data is retrieved/published"] - #[serde( - rename = "buildFlavor", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_flavor: Option<String>, - #[doc = "Platform of build for which data is retrieved/published"] - #[serde( - rename = "buildPlatform", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_platform: Option<String>, - #[doc = "List of coverage data for the build"] - #[serde( - rename = "coverageStats", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub coverage_stats: Vec<CodeCoverageStatistics>, + #[doc = "Flavor of build for which data is retrieved/published"] + #[serde( + rename = "buildFlavor", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_flavor: Option<String>, + #[doc = "Platform of build for which data is retrieved/published"] + #[serde( + rename = "buildPlatform", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_platform: Option<String>, + #[doc = "List of coverage data for the build"] + #[serde( + rename = "coverageStats", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub coverage_stats: Vec<CodeCoverageStatistics>, } impl CodeCoverageData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the code coverage statistics for a particular coverage label (modules, statements, blocks, etc.)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CodeCoverageStatistics { - #[doc = "Covered units"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub covered: Option<i32>, - #[doc = "Delta of coverage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub delta: Option<f64>, - #[doc = "Is delta valid"] - #[serde( - rename = "isDeltaAvailable", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_delta_available: Option<bool>, - #[doc = "Label of coverage data (\"Blocks\", \"Statements\", \"Modules\", etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub label: Option<String>, - #[doc = "Position of label"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub position: Option<i32>, - #[doc = "Total units"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total: Option<i32>, + #[doc = "Covered units"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub covered: Option<i32>, + #[doc = "Delta of coverage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub delta: Option<f64>, + #[doc = "Is delta valid"] + #[serde( + rename = "isDeltaAvailable", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_delta_available: Option<bool>, + #[doc = "Label of coverage data (\"Blocks\", \"Statements\", \"Modules\", etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option<String>, + #[doc = "Position of label"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub position: Option<i32>, + #[doc = "Total units"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total: Option<i32>, } impl CodeCoverageStatistics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the code coverage summary results Used to publish or retrieve code coverage summary against a build"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CodeCoverageSummary { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<ShallowReference>, - #[doc = "List of coverage data and details for the build"] - #[serde( - rename = "coverageData", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub coverage_data: Vec<CodeCoverageData>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "deltaBuild", - default, - skip_serializing_if = "Option::is_none" - )] - pub delta_build: Option<ShallowReference>, - #[doc = "Uri of build against which difference in coverage is computed"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<code_coverage_summary::Status>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<ShallowReference>, + #[doc = "List of coverage data and details for the build"] + #[serde( + rename = "coverageData", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub coverage_data: Vec<CodeCoverageData>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "deltaBuild", + default, + skip_serializing_if = "Option::is_none" + )] + pub delta_build: Option<ShallowReference>, + #[doc = "Uri of build against which difference in coverage is computed"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<code_coverage_summary::Status>, } impl CodeCoverageSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod code_coverage_summary { - use super::*; - #[doc = "Uri of build against which difference in coverage is computed"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "none")] - None, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "completed")] - Completed, - #[serde(rename = "finalized")] - Finalized, - #[serde(rename = "pending")] - Pending, - #[serde(rename = "updateRequestQueued")] - UpdateRequestQueued, - } + use super::*; + #[doc = "Uri of build against which difference in coverage is computed"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "none")] + None, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "completed")] + Completed, + #[serde(rename = "finalized")] + Finalized, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "updateRequestQueued")] + UpdateRequestQueued, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CoverageStatistics { - #[serde( - rename = "blocksCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub blocks_covered: Option<i32>, - #[serde( - rename = "blocksNotCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub blocks_not_covered: Option<i32>, - #[serde( - rename = "linesCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub lines_covered: Option<i32>, - #[serde( - rename = "linesNotCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub lines_not_covered: Option<i32>, - #[serde( - rename = "linesPartiallyCovered", - default, - skip_serializing_if = "Option::is_none" - )] - pub lines_partially_covered: Option<i32>, + #[serde( + rename = "blocksCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub blocks_covered: Option<i32>, + #[serde( + rename = "blocksNotCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub blocks_not_covered: Option<i32>, + #[serde( + rename = "linesCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub lines_covered: Option<i32>, + #[serde( + rename = "linesNotCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub lines_not_covered: Option<i32>, + #[serde( + rename = "linesPartiallyCovered", + default, + skip_serializing_if = "Option::is_none" + )] + pub lines_partially_covered: Option<i32>, } impl CoverageStatistics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A custom field information. Allowed Key : Value pairs - ( AttemptId: int value, IsTestResultFlaky: bool)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CustomTestField { - #[doc = "Field Name."] - #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] - pub field_name: Option<String>, - #[doc = "Field value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = "Field Name."] + #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] + pub field_name: Option<String>, + #[doc = "Field value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl CustomTestField { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This is a temporary class to provide the details for the test run environment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DtlEnvironmentDetails { - #[serde( - rename = "csmContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub csm_content: Option<String>, - #[serde( - rename = "csmParameters", - default, - skip_serializing_if = "Option::is_none" - )] - pub csm_parameters: Option<String>, - #[serde( - rename = "subscriptionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub subscription_name: Option<String>, + #[serde( + rename = "csmContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub csm_content: Option<String>, + #[serde( + rename = "csmParameters", + default, + skip_serializing_if = "Option::is_none" + )] + pub csm_parameters: Option<String>, + #[serde( + rename = "subscriptionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub subscription_name: Option<String>, } impl DtlEnvironmentDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Failing since information of a test result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FailingSince { - #[doc = "Reference to a build."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<BuildReference>, - #[doc = "Time since failing(UTC)."] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date: Option<time::OffsetDateTime>, - #[doc = "Reference to a release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ReleaseReference>, + #[doc = "Reference to a build."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<BuildReference>, + #[doc = "Time since failing(UTC)."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date: Option<time::OffsetDateTime>, + #[doc = "Reference to a release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ReleaseReference>, } impl FailingSince { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FieldDetailsForTestResults { - #[doc = "Group by field name"] - #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] - pub field_name: Option<String>, - #[doc = "Group by field values"] - #[serde( - rename = "groupsForField", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub groups_for_field: Vec<serde_json::Value>, + #[doc = "Group by field name"] + #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] + pub field_name: Option<String>, + #[doc = "Group by field values"] + #[serde( + rename = "groupsForField", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub groups_for_field: Vec<serde_json::Value>, } impl FieldDetailsForTestResults { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FileCoverageRequest { - #[serde(rename = "filePath", default, skip_serializing_if = "Option::is_none")] - pub file_path: Option<String>, - #[serde( - rename = "pullRequestBaseIterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_base_iteration_id: Option<i32>, - #[serde( - rename = "pullRequestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_id: Option<i32>, - #[serde( - rename = "pullRequestIterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pull_request_iteration_id: Option<i32>, - #[serde(rename = "repoId", default, skip_serializing_if = "Option::is_none")] - pub repo_id: Option<String>, + #[serde(rename = "filePath", default, skip_serializing_if = "Option::is_none")] + pub file_path: Option<String>, + #[serde( + rename = "pullRequestBaseIterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_base_iteration_id: Option<i32>, + #[serde( + rename = "pullRequestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_id: Option<i32>, + #[serde( + rename = "pullRequestIterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pull_request_iteration_id: Option<i32>, + #[serde(rename = "repoId", default, skip_serializing_if = "Option::is_none")] + pub repo_id: Option<String>, } impl FileCoverageRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FlakyDetection { - #[doc = ""] - #[serde( - rename = "flakyDetectionPipelines", - default, - skip_serializing_if = "Option::is_none" - )] - pub flaky_detection_pipelines: Option<FlakyDetectionPipelines>, - #[doc = "FlakyDetectionType defines Detection type i.e. 1. System or 2. Manual."] - #[serde( - rename = "flakyDetectionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub flaky_detection_type: Option<flaky_detection::FlakyDetectionType>, + #[doc = ""] + #[serde( + rename = "flakyDetectionPipelines", + default, + skip_serializing_if = "Option::is_none" + )] + pub flaky_detection_pipelines: Option<FlakyDetectionPipelines>, + #[doc = "FlakyDetectionType defines Detection type i.e. 1. System or 2. Manual."] + #[serde( + rename = "flakyDetectionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub flaky_detection_type: Option<flaky_detection::FlakyDetectionType>, } impl FlakyDetection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod flaky_detection { - use super::*; - #[doc = "FlakyDetectionType defines Detection type i.e. 1. System or 2. Manual."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum FlakyDetectionType { - #[serde(rename = "custom")] - Custom, - #[serde(rename = "system")] - System, - } + use super::*; + #[doc = "FlakyDetectionType defines Detection type i.e. 1. System or 2. Manual."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum FlakyDetectionType { + #[serde(rename = "custom")] + Custom, + #[serde(rename = "system")] + System, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FlakyDetectionPipelines { - #[doc = "AllowedPipelines - List All Pipelines allowed for detection."] - #[serde( - rename = "allowedPipelines", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub allowed_pipelines: Vec<i32>, - #[doc = "IsAllPipelinesAllowed if users configure all system's pipelines."] - #[serde( - rename = "isAllPipelinesAllowed", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_all_pipelines_allowed: Option<bool>, + #[doc = "AllowedPipelines - List All Pipelines allowed for detection."] + #[serde( + rename = "allowedPipelines", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub allowed_pipelines: Vec<i32>, + #[doc = "IsAllPipelinesAllowed if users configure all system's pipelines."] + #[serde( + rename = "isAllPipelinesAllowed", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_all_pipelines_allowed: Option<bool>, } impl FlakyDetectionPipelines { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FlakySettings { - #[doc = ""] - #[serde( - rename = "flakyDetection", - default, - skip_serializing_if = "Option::is_none" - )] - pub flaky_detection: Option<FlakyDetection>, - #[doc = "FlakyInSummaryReport defines flaky data should show in summary report or not."] - #[serde( - rename = "flakyInSummaryReport", - default, - skip_serializing_if = "Option::is_none" - )] - pub flaky_in_summary_report: Option<bool>, - #[doc = "IsFlakyBugCreated defines if there is any bug that has been created with flaky testresult."] - #[serde( - rename = "isFlakyBugCreated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_flaky_bug_created: Option<bool>, - #[doc = "ManualMarkUnmarkFlaky defines manual marking unmarking of flaky testcase."] - #[serde( - rename = "manualMarkUnmarkFlaky", - default, - skip_serializing_if = "Option::is_none" - )] - pub manual_mark_unmark_flaky: Option<bool>, + #[doc = ""] + #[serde( + rename = "flakyDetection", + default, + skip_serializing_if = "Option::is_none" + )] + pub flaky_detection: Option<FlakyDetection>, + #[doc = "FlakyInSummaryReport defines flaky data should show in summary report or not."] + #[serde( + rename = "flakyInSummaryReport", + default, + skip_serializing_if = "Option::is_none" + )] + pub flaky_in_summary_report: Option<bool>, + #[doc = "IsFlakyBugCreated defines if there is any bug that has been created with flaky testresult."] + #[serde( + rename = "isFlakyBugCreated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_flaky_bug_created: Option<bool>, + #[doc = "ManualMarkUnmarkFlaky defines manual marking unmarking of flaky testcase."] + #[serde( + rename = "manualMarkUnmarkFlaky", + default, + skip_serializing_if = "Option::is_none" + )] + pub manual_mark_unmark_flaky: Option<bool>, } impl FlakySettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FunctionCoverage { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub class: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option<String>, - #[serde( - rename = "sourceFile", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_file: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub statistics: Option<CoverageStatistics>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub class: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub namespace: Option<String>, + #[serde( + rename = "sourceFile", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_file: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub statistics: Option<CoverageStatistics>, } impl FunctionCoverage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = ""] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = ""] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, + } + } } #[doc = "Job in pipeline. This is related to matrixing in YAML."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobReference { - #[doc = "Attempt number of the job"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character."] - #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] - pub job_name: Option<String>, + #[doc = "Attempt number of the job"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character."] + #[serde(rename = "jobName", default, skip_serializing_if = "Option::is_none")] + pub job_name: Option<String>, } impl JobReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ModuleCoverage { - #[serde( - rename = "blockCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub block_count: Option<i32>, - #[serde( - rename = "blockData", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub block_data: Vec<String>, - #[doc = "Code Coverage File Url"] - #[serde(rename = "fileUrl", default, skip_serializing_if = "Option::is_none")] - pub file_url: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub functions: Vec<FunctionCoverage>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub signature: Option<String>, - #[serde( - rename = "signatureAge", - default, - skip_serializing_if = "Option::is_none" - )] - pub signature_age: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub statistics: Option<CoverageStatistics>, + #[serde( + rename = "blockCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub block_count: Option<i32>, + #[serde( + rename = "blockData", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub block_data: Vec<String>, + #[doc = "Code Coverage File Url"] + #[serde(rename = "fileUrl", default, skip_serializing_if = "Option::is_none")] + pub file_url: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub functions: Vec<FunctionCoverage>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub signature: Option<String>, + #[serde( + rename = "signatureAge", + default, + skip_serializing_if = "Option::is_none" + )] + pub signature_age: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub statistics: Option<CoverageStatistics>, } impl ModuleCoverage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NewTestResultLoggingSettings { - #[doc = "LogNewTests defines whether or not we will record new test cases coming into the system"] - #[serde( - rename = "logNewTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub log_new_tests: Option<bool>, + #[doc = "LogNewTests defines whether or not we will record new test cases coming into the system"] + #[serde( + rename = "logNewTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub log_new_tests: Option<bool>, } impl NewTestResultLoggingSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Phase in pipeline"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PhaseReference { - #[doc = "Attempt number of the phase"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Name of the phase. Maximum supported length for name is 256 character."] - #[serde(rename = "phaseName", default, skip_serializing_if = "Option::is_none")] - pub phase_name: Option<String>, + #[doc = "Attempt number of the phase"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Name of the phase. Maximum supported length for name is 256 character."] + #[serde(rename = "phaseName", default, skip_serializing_if = "Option::is_none")] + pub phase_name: Option<String>, } impl PhaseReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Pipeline reference"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelineReference { - #[doc = "Job in pipeline. This is related to matrixing in YAML."] - #[serde( - rename = "jobReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub job_reference: Option<JobReference>, - #[doc = "Phase in pipeline"] - #[serde( - rename = "phaseReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub phase_reference: Option<PhaseReference>, - #[doc = "Reference of the pipeline with which this pipeline instance is related."] - #[serde( - rename = "pipelineId", - default, - skip_serializing_if = "Option::is_none" - )] - pub pipeline_id: Option<i32>, - #[doc = "Stage in pipeline"] - #[serde( - rename = "stageReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub stage_reference: Option<StageReference>, + #[doc = "Job in pipeline. This is related to matrixing in YAML."] + #[serde( + rename = "jobReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub job_reference: Option<JobReference>, + #[doc = "Phase in pipeline"] + #[serde( + rename = "phaseReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub phase_reference: Option<PhaseReference>, + #[doc = "Reference of the pipeline with which this pipeline instance is related."] + #[serde( + rename = "pipelineId", + default, + skip_serializing_if = "Option::is_none" + )] + pub pipeline_id: Option<i32>, + #[doc = "Stage in pipeline"] + #[serde( + rename = "stageReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub stage_reference: Option<StageReference>, } impl PipelineReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test summary of a pipeline instance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelineTestMetrics { - #[doc = "Pipeline reference"] - #[serde( - rename = "currentContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub current_context: Option<PipelineReference>, - #[doc = "Results insights for runs with state completed and NeedInvestigation."] - #[serde( - rename = "resultsAnalysis", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_analysis: Option<ResultsAnalysis>, - #[doc = "Summary of results for a pipeline instance."] - #[serde( - rename = "resultSummary", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_summary: Option<ResultSummary>, - #[doc = "Summary of runs for a pipeline instance."] - #[serde( - rename = "runSummary", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary: Option<RunSummary>, - #[doc = "Summary at child node."] - #[serde( - rename = "summaryAtChild", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub summary_at_child: Vec<PipelineTestMetrics>, + #[doc = "Pipeline reference"] + #[serde( + rename = "currentContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub current_context: Option<PipelineReference>, + #[doc = "Results insights for runs with state completed and NeedInvestigation."] + #[serde( + rename = "resultsAnalysis", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_analysis: Option<ResultsAnalysis>, + #[doc = "Summary of results for a pipeline instance."] + #[serde( + rename = "resultSummary", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_summary: Option<ResultSummary>, + #[doc = "Summary of runs for a pipeline instance."] + #[serde( + rename = "runSummary", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary: Option<RunSummary>, + #[doc = "Summary at child node."] + #[serde( + rename = "summaryAtChild", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub summary_at_child: Vec<PipelineTestMetrics>, } impl PipelineTestMetrics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryModel { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option<String>, } impl QueryModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to a release."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReleaseReference { - #[doc = "Number of Release Attempt."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Release Creation Date(UTC)."] - #[serde( - rename = "creationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub creation_date: Option<time::OffsetDateTime>, - #[doc = "Release definition ID."] - #[serde( - rename = "definitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub definition_id: Option<i32>, - #[doc = "Environment creation Date(UTC)."] - #[serde( - rename = "environmentCreationDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub environment_creation_date: Option<time::OffsetDateTime>, - #[doc = "Release environment definition ID."] - #[serde( - rename = "environmentDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_definition_id: Option<i32>, - #[doc = "Release environment definition name."] - #[serde( - rename = "environmentDefinitionName", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_definition_name: Option<String>, - #[doc = "Release environment ID."] - #[serde( - rename = "environmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_id: Option<i32>, - #[doc = "Release environment name."] - #[serde( - rename = "environmentName", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_name: Option<String>, - #[doc = "Release ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Release name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Number of Release Attempt."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Release Creation Date(UTC)."] + #[serde( + rename = "creationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub creation_date: Option<time::OffsetDateTime>, + #[doc = "Release definition ID."] + #[serde( + rename = "definitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub definition_id: Option<i32>, + #[doc = "Environment creation Date(UTC)."] + #[serde( + rename = "environmentCreationDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub environment_creation_date: Option<time::OffsetDateTime>, + #[doc = "Release environment definition ID."] + #[serde( + rename = "environmentDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_definition_id: Option<i32>, + #[doc = "Release environment definition name."] + #[serde( + rename = "environmentDefinitionName", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_definition_name: Option<String>, + #[doc = "Release environment ID."] + #[serde( + rename = "environmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_id: Option<i32>, + #[doc = "Release environment name."] + #[serde( + rename = "environmentName", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_name: Option<String>, + #[doc = "Release ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Release name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl ReleaseReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Summary of results for a pipeline instance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultSummary { - #[doc = "Result summary of pipeline, group by TestRun state."] - #[serde( - rename = "resultSummaryByRunState", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_summary_by_run_state: Option<serde_json::Value>, + #[doc = "Result summary of pipeline, group by TestRun state."] + #[serde( + rename = "resultSummaryByRunState", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_summary_by_run_state: Option<serde_json::Value>, } impl ResultSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Results insights for runs with state completed and NeedInvestigation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultsAnalysis { - #[doc = "Pipeline reference"] - #[serde( - rename = "previousContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub previous_context: Option<PipelineReference>, - #[doc = ""] - #[serde( - rename = "resultsDifference", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_difference: Option<AggregatedResultsDifference>, - #[doc = ""] - #[serde( - rename = "testFailuresAnalysis", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_failures_analysis: Option<TestResultFailuresAnalysis>, + #[doc = "Pipeline reference"] + #[serde( + rename = "previousContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub previous_context: Option<PipelineReference>, + #[doc = ""] + #[serde( + rename = "resultsDifference", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_difference: Option<AggregatedResultsDifference>, + #[doc = ""] + #[serde( + rename = "testFailuresAnalysis", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_failures_analysis: Option<TestResultFailuresAnalysis>, } impl ResultsAnalysis { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultsFilter { - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub branch: Option<String>, - #[serde( - rename = "executedIn", - default, - skip_serializing_if = "Option::is_none" - )] - pub executed_in: Option<results_filter::ExecutedIn>, - #[serde(rename = "groupBy", default, skip_serializing_if = "Option::is_none")] - pub group_by: Option<String>, - #[serde( - rename = "maxCompleteDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub max_complete_date: Option<time::OffsetDateTime>, - #[serde( - rename = "resultsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_count: Option<i32>, - #[serde( - rename = "testCaseId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_id: Option<i32>, - #[serde( - rename = "testCaseReferenceIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_case_reference_ids: Vec<i32>, - #[serde( - rename = "testPlanId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_plan_id: Option<i32>, - #[serde( - rename = "testPointIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_point_ids: Vec<i32>, - #[doc = ""] - #[serde( - rename = "testResultsContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_results_context: Option<TestResultsContext>, - #[serde(rename = "trendDays", default, skip_serializing_if = "Option::is_none")] - pub trend_days: Option<i32>, + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub branch: Option<String>, + #[serde( + rename = "executedIn", + default, + skip_serializing_if = "Option::is_none" + )] + pub executed_in: Option<results_filter::ExecutedIn>, + #[serde(rename = "groupBy", default, skip_serializing_if = "Option::is_none")] + pub group_by: Option<String>, + #[serde( + rename = "maxCompleteDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub max_complete_date: Option<time::OffsetDateTime>, + #[serde( + rename = "resultsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_count: Option<i32>, + #[serde( + rename = "testCaseId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_id: Option<i32>, + #[serde( + rename = "testCaseReferenceIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_case_reference_ids: Vec<i32>, + #[serde( + rename = "testPlanId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_plan_id: Option<i32>, + #[serde( + rename = "testPointIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_point_ids: Vec<i32>, + #[doc = ""] + #[serde( + rename = "testResultsContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_results_context: Option<TestResultsContext>, + #[serde(rename = "trendDays", default, skip_serializing_if = "Option::is_none")] + pub trend_days: Option<i32>, } impl ResultsFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod results_filter { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ExecutedIn { - #[serde(rename = "any")] - Any, - #[serde(rename = "tcm")] - Tcm, - #[serde(rename = "tfs")] - Tfs, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ExecutedIn { + #[serde(rename = "any")] + Any, + #[serde(rename = "tcm")] + Tcm, + #[serde(rename = "tfs")] + Tfs, + } } #[doc = "Result summary by the outcome of test results."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResultsSummaryByOutcome { - #[doc = "Aggregated result details for each test result outcome."] - #[serde( - rename = "aggregatedResultDetailsByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub aggregated_result_details_by_outcome: Option<serde_json::Value>, - #[doc = "Time taken by results."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[doc = "Total number of not reported test results."] - #[serde( - rename = "notReportedTestCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub not_reported_test_count: Option<i32>, - #[doc = "Total number of test results. (It includes NotImpacted test results as well which need to exclude while calculating pass/fail test result percentage)."] - #[serde( - rename = "totalTestCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_test_count: Option<i32>, + #[doc = "Aggregated result details for each test result outcome."] + #[serde( + rename = "aggregatedResultDetailsByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub aggregated_result_details_by_outcome: Option<serde_json::Value>, + #[doc = "Time taken by results."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[doc = "Total number of not reported test results."] + #[serde( + rename = "notReportedTestCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub not_reported_test_count: Option<i32>, + #[doc = "Total number of test results. (It includes NotImpacted test results as well which need to exclude while calculating pass/fail test result percentage)."] + #[serde( + rename = "totalTestCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_test_count: Option<i32>, } impl ResultsSummaryByOutcome { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test run create details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunCreateModel { - #[doc = "true if test run is automated, false otherwise. By default it will be false."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub automated: Option<bool>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<ShallowReference>, - #[doc = "Drop location of the build used for test run."] - #[serde( - rename = "buildDropLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_drop_location: Option<String>, - #[doc = "Flavor of the build used for test run. (E.g: Release, Debug)"] - #[serde( - rename = "buildFlavor", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_flavor: Option<String>, - #[doc = "Platform of the build used for test run. (E.g.: x86, amd64)"] - #[serde( - rename = "buildPlatform", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_platform: Option<String>, - #[doc = "BuildConfiguration Details."] - #[serde( - rename = "buildReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_reference: Option<BuildConfiguration>, - #[doc = "Comments entered by those analyzing the run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Completed date time of the run."] - #[serde( - rename = "completeDate", - default, - skip_serializing_if = "Option::is_none" - )] - pub complete_date: Option<String>, - #[doc = "IDs of the test configurations associated with the run."] - #[serde( - rename = "configurationIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub configuration_ids: Vec<i32>, - #[doc = "Name of the test controller used for automated run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub controller: Option<String>, - #[doc = "Additional properties of test Run."] - #[serde( - rename = "customTestFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub custom_test_fields: Vec<CustomTestField>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlAutEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_aut_environment: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlTestEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_test_environment: Option<ShallowReference>, - #[doc = "Due date and time for test run."] - #[serde(rename = "dueDate", default, skip_serializing_if = "Option::is_none")] - pub due_date: Option<String>, - #[doc = "This is a temporary class to provide the details for the test run environment."] - #[serde( - rename = "environmentDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_details: Option<DtlEnvironmentDetails>, - #[doc = "Error message associated with the run."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "This class is used to provide the filters used for discovery"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option<RunFilter>, - #[doc = "The iteration in which to create the run. Root iteration of the team project will be default"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub iteration: Option<String>, - #[doc = "Name of the test run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Pipeline reference"] - #[serde( - rename = "pipelineReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub pipeline_reference: Option<PipelineReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub plan: Option<ShallowReference>, - #[doc = "IDs of the test points to use in the run."] - #[serde( - rename = "pointIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub point_ids: Vec<i32>, - #[doc = "URI of release environment associated with the run."] - #[serde( - rename = "releaseEnvironmentUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment_uri: Option<String>, - #[doc = "Reference to a release."] - #[serde( - rename = "releaseReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_reference: Option<ReleaseReference>, - #[doc = "URI of release associated with the run."] - #[serde( - rename = "releaseUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_uri: Option<String>, - #[doc = "Run summary for run Type = NoConfigRun."] - #[serde( - rename = "runSummary", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub run_summary: Vec<RunSummaryModel>, - #[doc = "Timespan till the run times out."] - #[serde( - rename = "runTimeout", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_timeout: Option<String>, - #[doc = "SourceWorkFlow(CI/CD) of the test run."] - #[serde( - rename = "sourceWorkflow", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_workflow: Option<String>, - #[doc = "Start date time of the run."] - #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")] - pub start_date: Option<String>, - #[doc = "The state of the run. Type TestRunState Valid states - NotStarted, InProgress, Waiting"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "Tags to attach with the test run, maximum of 5 tags can be added to run."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<TestTag>, - #[doc = "TestConfigurationMapping of the test run."] - #[serde( - rename = "testConfigurationsMapping", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_configurations_mapping: Option<String>, - #[doc = "ID of the test environment associated with the run."] - #[serde( - rename = "testEnvironmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_environment_id: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "testSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings: Option<ShallowReference>, - #[doc = "Type of the run(RunType) Valid Values : (Unspecified, Normal, Blocking, Web, MtrRunInitiatedFromWeb, RunWithDtlEnv, NoConfigRun)"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "true if test run is automated, false otherwise. By default it will be false."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub automated: Option<bool>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<ShallowReference>, + #[doc = "Drop location of the build used for test run."] + #[serde( + rename = "buildDropLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_drop_location: Option<String>, + #[doc = "Flavor of the build used for test run. (E.g: Release, Debug)"] + #[serde( + rename = "buildFlavor", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_flavor: Option<String>, + #[doc = "Platform of the build used for test run. (E.g.: x86, amd64)"] + #[serde( + rename = "buildPlatform", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_platform: Option<String>, + #[doc = "BuildConfiguration Details."] + #[serde( + rename = "buildReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_reference: Option<BuildConfiguration>, + #[doc = "Comments entered by those analyzing the run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Completed date time of the run."] + #[serde( + rename = "completeDate", + default, + skip_serializing_if = "Option::is_none" + )] + pub complete_date: Option<String>, + #[doc = "IDs of the test configurations associated with the run."] + #[serde( + rename = "configurationIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub configuration_ids: Vec<i32>, + #[doc = "Name of the test controller used for automated run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub controller: Option<String>, + #[doc = "Additional properties of test Run."] + #[serde( + rename = "customTestFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub custom_test_fields: Vec<CustomTestField>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlAutEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_aut_environment: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlTestEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_test_environment: Option<ShallowReference>, + #[doc = "Due date and time for test run."] + #[serde(rename = "dueDate", default, skip_serializing_if = "Option::is_none")] + pub due_date: Option<String>, + #[doc = "This is a temporary class to provide the details for the test run environment."] + #[serde( + rename = "environmentDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_details: Option<DtlEnvironmentDetails>, + #[doc = "Error message associated with the run."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "This class is used to provide the filters used for discovery"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option<RunFilter>, + #[doc = "The iteration in which to create the run. Root iteration of the team project will be default"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iteration: Option<String>, + #[doc = "Name of the test run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Pipeline reference"] + #[serde( + rename = "pipelineReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub pipeline_reference: Option<PipelineReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plan: Option<ShallowReference>, + #[doc = "IDs of the test points to use in the run."] + #[serde( + rename = "pointIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub point_ids: Vec<i32>, + #[doc = "URI of release environment associated with the run."] + #[serde( + rename = "releaseEnvironmentUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment_uri: Option<String>, + #[doc = "Reference to a release."] + #[serde( + rename = "releaseReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_reference: Option<ReleaseReference>, + #[doc = "URI of release associated with the run."] + #[serde( + rename = "releaseUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_uri: Option<String>, + #[doc = "Run summary for run Type = NoConfigRun."] + #[serde( + rename = "runSummary", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub run_summary: Vec<RunSummaryModel>, + #[doc = "Timespan till the run times out."] + #[serde( + rename = "runTimeout", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_timeout: Option<String>, + #[doc = "SourceWorkFlow(CI/CD) of the test run."] + #[serde( + rename = "sourceWorkflow", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_workflow: Option<String>, + #[doc = "Start date time of the run."] + #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")] + pub start_date: Option<String>, + #[doc = "The state of the run. Type TestRunState Valid states - NotStarted, InProgress, Waiting"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "Tags to attach with the test run, maximum of 5 tags can be added to run."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<TestTag>, + #[doc = "TestConfigurationMapping of the test run."] + #[serde( + rename = "testConfigurationsMapping", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_configurations_mapping: Option<String>, + #[doc = "ID of the test environment associated with the run."] + #[serde( + rename = "testEnvironmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_environment_id: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "testSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings: Option<ShallowReference>, + #[doc = "Type of the run(RunType) Valid Values : (Unspecified, Normal, Blocking, Web, MtrRunInitiatedFromWeb, RunWithDtlEnv, NoConfigRun)"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl RunCreateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This class is used to provide the filters used for discovery"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunFilter { - #[doc = "filter for the test case sources (test containers)"] - #[serde( - rename = "sourceFilter", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_filter: Option<String>, - #[doc = "filter for the test cases"] - #[serde( - rename = "testCaseFilter", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_filter: Option<String>, + #[doc = "filter for the test case sources (test containers)"] + #[serde( + rename = "sourceFilter", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_filter: Option<String>, + #[doc = "filter for the test cases"] + #[serde( + rename = "testCaseFilter", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_filter: Option<String>, } impl RunFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test run statistics per outcome."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunStatistic { - #[doc = "Test result count fo the given outcome."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Test result outcome"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = "Test Resolution State Details."] - #[serde( - rename = "resolutionState", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_state: Option<TestResolutionState>, - #[doc = "ResultMetadata for the given outcome/count."] - #[serde( - rename = "resultMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_metadata: Option<run_statistic::ResultMetadata>, - #[doc = "State of the test run"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, + #[doc = "Test result count fo the given outcome."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Test result outcome"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = "Test Resolution State Details."] + #[serde( + rename = "resolutionState", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_state: Option<TestResolutionState>, + #[doc = "ResultMetadata for the given outcome/count."] + #[serde( + rename = "resultMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_metadata: Option<run_statistic::ResultMetadata>, + #[doc = "State of the test run"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, } impl RunStatistic { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod run_statistic { - use super::*; - #[doc = "ResultMetadata for the given outcome/count."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ResultMetadata { - #[serde(rename = "rerun")] - Rerun, - #[serde(rename = "flaky")] - Flaky, - } + use super::*; + #[doc = "ResultMetadata for the given outcome/count."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ResultMetadata { + #[serde(rename = "rerun")] + Rerun, + #[serde(rename = "flaky")] + Flaky, + } } #[doc = "Summary of runs for a pipeline instance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunSummary { - #[doc = "Total time taken by runs with state completed and NeedInvestigation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<String>, - #[doc = "NoConfig runs count."] - #[serde( - rename = "noConfigRunsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub no_config_runs_count: Option<i32>, - #[doc = "Runs count by outcome for runs with state completed and NeedInvestigation runs."] - #[serde( - rename = "runSummaryByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary_by_outcome: Option<serde_json::Value>, - #[doc = "Runs count by state."] - #[serde( - rename = "runSummaryByState", - default, - skip_serializing_if = "Option::is_none" - )] - pub run_summary_by_state: Option<serde_json::Value>, - #[doc = "Total runs count."] - #[serde( - rename = "totalRunsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_runs_count: Option<i32>, + #[doc = "Total time taken by runs with state completed and NeedInvestigation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<String>, + #[doc = "NoConfig runs count."] + #[serde( + rename = "noConfigRunsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub no_config_runs_count: Option<i32>, + #[doc = "Runs count by outcome for runs with state completed and NeedInvestigation runs."] + #[serde( + rename = "runSummaryByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary_by_outcome: Option<serde_json::Value>, + #[doc = "Runs count by state."] + #[serde( + rename = "runSummaryByState", + default, + skip_serializing_if = "Option::is_none" + )] + pub run_summary_by_state: Option<serde_json::Value>, + #[doc = "Total runs count."] + #[serde( + rename = "totalRunsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_runs_count: Option<i32>, } impl RunSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Run summary for each output type of test."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunSummaryModel { - #[doc = "Total time taken in milliseconds."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option<i64>, - #[doc = "Number of results for Outcome TestOutcome"] - #[serde( - rename = "resultCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_count: Option<i32>, - #[doc = "Summary is based on outcome"] - #[serde( - rename = "testOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_outcome: Option<run_summary_model::TestOutcome>, + #[doc = "Total time taken in milliseconds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option<i64>, + #[doc = "Number of results for Outcome TestOutcome"] + #[serde( + rename = "resultCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_count: Option<i32>, + #[doc = "Summary is based on outcome"] + #[serde( + rename = "testOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_outcome: Option<run_summary_model::TestOutcome>, } impl RunSummaryModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod run_summary_model { - use super::*; - #[doc = "Summary is based on outcome"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TestOutcome { - #[serde(rename = "unspecified")] - Unspecified, - #[serde(rename = "none")] - None, - #[serde(rename = "passed")] - Passed, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "inconclusive")] - Inconclusive, - #[serde(rename = "timeout")] - Timeout, - #[serde(rename = "aborted")] - Aborted, - #[serde(rename = "blocked")] - Blocked, - #[serde(rename = "notExecuted")] - NotExecuted, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - #[serde(rename = "notApplicable")] - NotApplicable, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "notImpacted")] - NotImpacted, - } + use super::*; + #[doc = "Summary is based on outcome"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum TestOutcome { + #[serde(rename = "unspecified")] + Unspecified, + #[serde(rename = "none")] + None, + #[serde(rename = "passed")] + Passed, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "inconclusive")] + Inconclusive, + #[serde(rename = "timeout")] + Timeout, + #[serde(rename = "aborted")] + Aborted, + #[serde(rename = "blocked")] + Blocked, + #[serde(rename = "notExecuted")] + NotExecuted, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + #[serde(rename = "notApplicable")] + NotApplicable, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "notImpacted")] + NotImpacted, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RunUpdateModel { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<ShallowReference>, - #[doc = "Drop location of the build used for test run."] - #[serde( - rename = "buildDropLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_drop_location: Option<String>, - #[doc = "Flavor of the build used for test run. (E.g: Release, Debug)"] - #[serde( - rename = "buildFlavor", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_flavor: Option<String>, - #[doc = "Platform of the build used for test run. (E.g.: x86, amd64)"] - #[serde( - rename = "buildPlatform", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_platform: Option<String>, - #[doc = "Comments entered by those analyzing the run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Completed date time of the run."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none" - )] - pub completed_date: Option<String>, - #[doc = "Name of the test controller used for automated run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub controller: Option<String>, - #[doc = "true to delete inProgess Results , false otherwise."] - #[serde( - rename = "deleteInProgressResults", - default, - skip_serializing_if = "Option::is_none" - )] - pub delete_in_progress_results: Option<bool>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlAutEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_aut_environment: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_environment: Option<ShallowReference>, - #[doc = "This is a temporary class to provide the details for the test run environment."] - #[serde( - rename = "dtlEnvironmentDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_environment_details: Option<DtlEnvironmentDetails>, - #[doc = "Due date and time for test run."] - #[serde(rename = "dueDate", default, skip_serializing_if = "Option::is_none")] - pub due_date: Option<String>, - #[doc = "Error message associated with the run."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "The iteration in which to create the run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub iteration: Option<String>, - #[doc = "Log entries associated with the run. Use a comma-separated list of multiple log entry objects. { logEntry }, { logEntry }, ..."] - #[serde( - rename = "logEntries", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub log_entries: Vec<TestMessageLogDetails>, - #[doc = "Name of the test run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "URI of release environment associated with the run."] - #[serde( - rename = "releaseEnvironmentUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment_uri: Option<String>, - #[doc = "URI of release associated with the run."] - #[serde( - rename = "releaseUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_uri: Option<String>, - #[doc = "Run summary for run Type = NoConfigRun."] - #[serde( - rename = "runSummary", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub run_summary: Vec<RunSummaryModel>, - #[doc = "SourceWorkFlow(CI/CD) of the test run."] - #[serde( - rename = "sourceWorkflow", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_workflow: Option<String>, - #[doc = "Start date time of the run."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none" - )] - pub started_date: Option<String>, - #[doc = "The state of the test run Below are the valid values - NotStarted, InProgress, Completed, Aborted, Waiting"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "The types of sub states for test run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub substate: Option<run_update_model::Substate>, - #[doc = "Tags to attach with the test run."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<TestTag>, - #[doc = "ID of the test environment associated with the run."] - #[serde( - rename = "testEnvironmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_environment_id: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "testSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<ShallowReference>, + #[doc = "Drop location of the build used for test run."] + #[serde( + rename = "buildDropLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_drop_location: Option<String>, + #[doc = "Flavor of the build used for test run. (E.g: Release, Debug)"] + #[serde( + rename = "buildFlavor", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_flavor: Option<String>, + #[doc = "Platform of the build used for test run. (E.g.: x86, amd64)"] + #[serde( + rename = "buildPlatform", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_platform: Option<String>, + #[doc = "Comments entered by those analyzing the run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Completed date time of the run."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none" + )] + pub completed_date: Option<String>, + #[doc = "Name of the test controller used for automated run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub controller: Option<String>, + #[doc = "true to delete inProgess Results , false otherwise."] + #[serde( + rename = "deleteInProgressResults", + default, + skip_serializing_if = "Option::is_none" + )] + pub delete_in_progress_results: Option<bool>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlAutEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_aut_environment: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_environment: Option<ShallowReference>, + #[doc = "This is a temporary class to provide the details for the test run environment."] + #[serde( + rename = "dtlEnvironmentDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_environment_details: Option<DtlEnvironmentDetails>, + #[doc = "Due date and time for test run."] + #[serde(rename = "dueDate", default, skip_serializing_if = "Option::is_none")] + pub due_date: Option<String>, + #[doc = "Error message associated with the run."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "The iteration in which to create the run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iteration: Option<String>, + #[doc = "Log entries associated with the run. Use a comma-separated list of multiple log entry objects. { logEntry }, { logEntry }, ..."] + #[serde( + rename = "logEntries", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub log_entries: Vec<TestMessageLogDetails>, + #[doc = "Name of the test run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "URI of release environment associated with the run."] + #[serde( + rename = "releaseEnvironmentUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment_uri: Option<String>, + #[doc = "URI of release associated with the run."] + #[serde( + rename = "releaseUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_uri: Option<String>, + #[doc = "Run summary for run Type = NoConfigRun."] + #[serde( + rename = "runSummary", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub run_summary: Vec<RunSummaryModel>, + #[doc = "SourceWorkFlow(CI/CD) of the test run."] + #[serde( + rename = "sourceWorkflow", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_workflow: Option<String>, + #[doc = "Start date time of the run."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none" + )] + pub started_date: Option<String>, + #[doc = "The state of the test run Below are the valid values - NotStarted, InProgress, Completed, Aborted, Waiting"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "The types of sub states for test run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub substate: Option<run_update_model::Substate>, + #[doc = "Tags to attach with the test run."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<TestTag>, + #[doc = "ID of the test environment associated with the run."] + #[serde( + rename = "testEnvironmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_environment_id: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "testSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings: Option<ShallowReference>, } impl RunUpdateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod run_update_model { - use super::*; - #[doc = "The types of sub states for test run."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Substate { - #[serde(rename = "none")] - None, - #[serde(rename = "creatingEnvironment")] - CreatingEnvironment, - #[serde(rename = "runningTests")] - RunningTests, - #[serde(rename = "canceledByUser")] - CanceledByUser, - #[serde(rename = "abortedBySystem")] - AbortedBySystem, - #[serde(rename = "timedOut")] - TimedOut, - #[serde(rename = "pendingAnalysis")] - PendingAnalysis, - #[serde(rename = "analyzed")] - Analyzed, - #[serde(rename = "cancellationInProgress")] - CancellationInProgress, - } + use super::*; + #[doc = "The types of sub states for test run."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Substate { + #[serde(rename = "none")] + None, + #[serde(rename = "creatingEnvironment")] + CreatingEnvironment, + #[serde(rename = "runningTests")] + RunningTests, + #[serde(rename = "canceledByUser")] + CanceledByUser, + #[serde(rename = "abortedBySystem")] + AbortedBySystem, + #[serde(rename = "timedOut")] + TimedOut, + #[serde(rename = "pendingAnalysis")] + PendingAnalysis, + #[serde(rename = "analyzed")] + Analyzed, + #[serde(rename = "cancellationInProgress")] + CancellationInProgress, + } } #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ShallowReference { - #[doc = "ID of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the linked resource (definition name, controller name, etc.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Full http link to the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "ID of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the linked resource (definition name, controller name, etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Full http link to the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ShallowReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ShallowTestCaseResult { - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[serde( - rename = "automatedTestStorage", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_storage: Option<String>, - #[serde( - rename = "durationInMs", - default, - skip_serializing_if = "Option::is_none" - )] - pub duration_in_ms: Option<f64>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(rename = "isReRun", default, skip_serializing_if = "Option::is_none")] - pub is_re_run: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option<i32>, - #[serde(rename = "refId", default, skip_serializing_if = "Option::is_none")] - pub ref_id: Option<i32>, - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, - #[serde( - rename = "testCaseTitle", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_title: Option<String>, + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[serde( + rename = "automatedTestStorage", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_storage: Option<String>, + #[serde( + rename = "durationInMs", + default, + skip_serializing_if = "Option::is_none" + )] + pub duration_in_ms: Option<f64>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(rename = "isReRun", default, skip_serializing_if = "Option::is_none")] + pub is_re_run: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub priority: Option<i32>, + #[serde(rename = "refId", default, skip_serializing_if = "Option::is_none")] + pub ref_id: Option<i32>, + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, + #[serde( + rename = "testCaseTitle", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_title: Option<String>, } impl ShallowTestCaseResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to shared step workitem."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SharedStepModel { - #[doc = "WorkItem shared step ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Shared step workitem revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[doc = "WorkItem shared step ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Shared step workitem revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl SharedStepModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Stage in pipeline"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StageReference { - #[doc = "Attempt number of stage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attempt: Option<i32>, - #[doc = "Name of the stage. Maximum supported length for name is 256 character."] - #[serde(rename = "stageName", default, skip_serializing_if = "Option::is_none")] - pub stage_name: Option<String>, + #[doc = "Attempt number of stage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attempt: Option<i32>, + #[doc = "Name of the stage. Maximum supported length for name is 256 character."] + #[serde(rename = "stageName", default, skip_serializing_if = "Option::is_none")] + pub stage_name: Option<String>, } impl StageReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TeamProjectReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub abbreviation: Option<String>, - #[serde( - rename = "defaultTeamImageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_team_image_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - pub id: String, - #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] - pub last_update_time: time::OffsetDateTime, - pub name: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, - pub state: team_project_reference::State, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - pub visibility: team_project_reference::Visibility, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub abbreviation: Option<String>, + #[serde( + rename = "defaultTeamImageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_team_image_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + pub id: String, + #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] + pub last_update_time: time::OffsetDateTime, + pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i64>, + pub state: team_project_reference::State, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + pub visibility: team_project_reference::Visibility, } impl TeamProjectReference { - pub fn new( - id: String, - last_update_time: time::OffsetDateTime, - name: String, - state: team_project_reference::State, - visibility: team_project_reference::Visibility, - ) -> Self { - Self { - abbreviation: None, - default_team_image_url: None, - description: None, - id, - last_update_time, - name, - revision: None, - state, - url: None, - visibility, - } - } + pub fn new( + id: String, + last_update_time: time::OffsetDateTime, + name: String, + state: team_project_reference::State, + visibility: team_project_reference::Visibility, + ) -> Self { + Self { + abbreviation: None, + default_team_image_url: None, + description: None, + id, + last_update_time, + name, + revision: None, + state, + url: None, + visibility, + } + } } pub mod team_project_reference { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "deleting")] - Deleting, - #[serde(rename = "new")] - New, - #[serde(rename = "wellFormed")] - WellFormed, - #[serde(rename = "createPending")] - CreatePending, - #[serde(rename = "all")] - All, - #[serde(rename = "unchanged")] - Unchanged, - #[serde(rename = "deleted")] - Deleted, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Visibility { - #[serde(rename = "private")] - Private, - #[serde(rename = "public")] - Public, - #[serde(rename = "organization")] - Organization, - #[serde(rename = "unchanged")] - Unchanged, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "deleting")] + Deleting, + #[serde(rename = "new")] + New, + #[serde(rename = "wellFormed")] + WellFormed, + #[serde(rename = "createPending")] + CreatePending, + #[serde(rename = "all")] + All, + #[serde(rename = "unchanged")] + Unchanged, + #[serde(rename = "deleted")] + Deleted, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Visibility { + #[serde(rename = "private")] + Private, + #[serde(rename = "public")] + Public, + #[serde(rename = "organization")] + Organization, + #[serde(rename = "unchanged")] + Unchanged, + } } #[doc = "Represents a test step result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestActionResultModel { - #[serde(flatten)] - pub test_result_model_base: TestResultModelBase, - #[doc = "Path identifier for test step in test case workitem. Note: 1) It is represented in Hexadecimal format with 8 digits for a step. 2) Internally, the step ID value for first step starts with 2 so actionPath = 00000002 step 9, will have an ID = 10 and actionPath = 0000000a step 15, will have an ID =16 and actionPath = 00000010 3) actionPath of shared step is concatenated with the parent step of test case. Example, it would be something of type - 0000000300000001 where 00000003 denotes action path of test step and 00000001 denotes action path for shared step"] - #[serde( - rename = "actionPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_path: Option<String>, - #[doc = "Iteration ID of test action result."] - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[doc = "Reference to shared step workitem."] - #[serde( - rename = "sharedStepModel", - default, - skip_serializing_if = "Option::is_none" - )] - pub shared_step_model: Option<SharedStepModel>, - #[doc = "This is step Id of test case. For shared step, it is step Id of shared step in test case workitem; step Id in shared step. Example: TestCase workitem has two steps: 1) Normal step with Id = 1 2) Shared Step with Id = 2. Inside shared step: a) Normal Step with Id = 1 Value for StepIdentifier for First step: \"1\" Second step: \"2;1\""] - #[serde( - rename = "stepIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub step_identifier: Option<String>, - #[doc = "Url of test action result. Deprecated in hosted environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(flatten)] + pub test_result_model_base: TestResultModelBase, + #[doc = "Path identifier for test step in test case workitem. Note: 1) It is represented in Hexadecimal format with 8 digits for a step. 2) Internally, the step ID value for first step starts with 2 so actionPath = 00000002 step 9, will have an ID = 10 and actionPath = 0000000a step 15, will have an ID =16 and actionPath = 00000010 3) actionPath of shared step is concatenated with the parent step of test case. Example, it would be something of type - 0000000300000001 where 00000003 denotes action path of test step and 00000001 denotes action path for shared step"] + #[serde( + rename = "actionPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_path: Option<String>, + #[doc = "Iteration ID of test action result."] + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[doc = "Reference to shared step workitem."] + #[serde( + rename = "sharedStepModel", + default, + skip_serializing_if = "Option::is_none" + )] + pub shared_step_model: Option<SharedStepModel>, + #[doc = "This is step Id of test case. For shared step, it is step Id of shared step in test case workitem; step Id in shared step. Example: TestCase workitem has two steps: 1) Normal step with Id = 1 2) Shared Step with Id = 2. Inside shared step: a) Normal Step with Id = 1 Value for StepIdentifier for First step: \"1\" Second step: \"2;1\""] + #[serde( + rename = "stepIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub step_identifier: Option<String>, + #[doc = "Url of test action result. Deprecated in hosted environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestActionResultModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestAttachment { - #[doc = "Attachment type."] - #[serde( - rename = "attachmentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub attachment_type: Option<test_attachment::AttachmentType>, - #[doc = "Comment associated with attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Attachment created date."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Attachment file name"] - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[doc = "ID of the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Attachment size."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[doc = "Attachment Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Attachment type."] + #[serde( + rename = "attachmentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub attachment_type: Option<test_attachment::AttachmentType>, + #[doc = "Comment associated with attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Attachment created date."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Attachment file name"] + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[doc = "ID of the attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Attachment size."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[doc = "Attachment Url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestAttachment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_attachment { - use super::*; - #[doc = "Attachment type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AttachmentType { - #[serde(rename = "generalAttachment")] - GeneralAttachment, - #[serde(rename = "codeCoverage")] - CodeCoverage, - #[serde(rename = "consoleLog")] - ConsoleLog, - } + use super::*; + #[doc = "Attachment type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AttachmentType { + #[serde(rename = "generalAttachment")] + GeneralAttachment, + #[serde(rename = "codeCoverage")] + CodeCoverage, + #[serde(rename = "consoleLog")] + ConsoleLog, + } } #[doc = "Reference to test attachment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestAttachmentReference { - #[doc = "ID of the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Url to download the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "ID of the attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Url to download the attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestAttachmentReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test attachment request model"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestAttachmentRequestModel { - #[doc = "Attachment type By Default it will be GeneralAttachment. It can be one of the following type. { GeneralAttachment, AfnStrip, BugFilingData, CodeCoverage, IntermediateCollectorData, RunConfig, TestImpactDetails, TmiTestRunDeploymentFiles, TmiTestRunReverseDeploymentFiles, TmiTestResultDetail, TmiTestRunSummary }"] - #[serde( - rename = "attachmentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub attachment_type: Option<String>, - #[doc = "Comment associated with attachment"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Attachment filename"] - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[doc = "Base64 encoded file stream"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stream: Option<String>, + #[doc = "Attachment type By Default it will be GeneralAttachment. It can be one of the following type. { GeneralAttachment, AfnStrip, BugFilingData, CodeCoverage, IntermediateCollectorData, RunConfig, TestImpactDetails, TmiTestRunDeploymentFiles, TmiTestRunReverseDeploymentFiles, TmiTestResultDetail, TmiTestRunSummary }"] + #[serde( + rename = "attachmentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub attachment_type: Option<String>, + #[doc = "Comment associated with attachment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Attachment filename"] + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[doc = "Base64 encoded file stream"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stream: Option<String>, } impl TestAttachmentRequestModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a test result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseResult { - #[doc = "Test attachment ID of action recording."] - #[serde( - rename = "afnStripId", - default, - skip_serializing_if = "Option::is_none" - )] - pub afn_strip_id: Option<i32>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub area: Option<ShallowReference>, - #[doc = "Reference to bugs linked to test result."] - #[serde( - rename = "associatedBugs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub associated_bugs: Vec<ShallowReference>, - #[doc = "ID representing test method in a dll."] - #[serde( - rename = "automatedTestId", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_id: Option<String>, - #[doc = "Fully qualified name of test executed."] - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[doc = "Container to which test belongs."] - #[serde( - rename = "automatedTestStorage", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_storage: Option<String>, - #[doc = "Type of automated test."] - #[serde( - rename = "automatedTestType", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_type: Option<String>, - #[doc = "TypeId of automated test."] - #[serde( - rename = "automatedTestTypeId", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_type_id: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<ShallowReference>, - #[doc = "Reference to a build."] - #[serde( - rename = "buildReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_reference: Option<BuildReference>, - #[doc = "Comment in a test result with maxSize= 1000 chars."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Time when test execution completed(UTC). Completed date should be greater than StartedDate."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Machine name where test executed."] - #[serde( - rename = "computerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub computer_name: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<ShallowReference>, - #[doc = "Timestamp when test result created(UTC)."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Additional properties of test result."] - #[serde( - rename = "customFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub custom_fields: Vec<CustomTestField>, - #[doc = "Duration of test execution in milliseconds. If not provided value will be set as CompletedDate - StartedDate"] - #[serde( - rename = "durationInMs", - default, - skip_serializing_if = "Option::is_none" - )] - pub duration_in_ms: Option<f64>, - #[doc = "Error message in test execution."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "Failing since information of a test result."] - #[serde( - rename = "failingSince", - default, - skip_serializing_if = "Option::is_none" - )] - pub failing_since: Option<FailingSince>, - #[doc = "Failure type of test result. Valid Value= (Known Issue, New Issue, Regression, Unknown, None)"] - #[serde( - rename = "failureType", - default, - skip_serializing_if = "Option::is_none" - )] - pub failure_type: Option<String>, - #[doc = "ID of a test result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Test result details of test iterations used only for Manual Testing."] - #[serde( - rename = "iterationDetails", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub iteration_details: Vec<TestIterationDetailsModel>, - #[doc = ""] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<IdentityRef>, - #[doc = "Last updated datetime of test result(UTC)."] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "Test outcome of test result. Valid values = (Unspecified, None, Passed, Failed, Inconclusive, Timeout, Aborted, Blocked, NotExecuted, Warning, Error, NotApplicable, Paused, InProgress, NotImpacted)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Priority of test executed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option<i32>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ShallowReference>, - #[doc = "Reference to a release."] - #[serde( - rename = "releaseReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_reference: Option<ReleaseReference>, - #[doc = "ResetCount."] - #[serde( - rename = "resetCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub reset_count: Option<i32>, - #[doc = "Resolution state of test result."] - #[serde( - rename = "resolutionState", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_state: Option<String>, - #[doc = "ID of resolution state."] - #[serde( - rename = "resolutionStateId", - default, - skip_serializing_if = "Option::is_none" - )] - pub resolution_state_id: Option<i32>, - #[doc = "Hierarchy type of the result, default value of None means its leaf node."] - #[serde( - rename = "resultGroupType", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_group_type: Option<test_case_result::ResultGroupType>, - #[doc = "Revision number of test result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = ""] - #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] - pub run_by: Option<IdentityRef>, - #[doc = "Stacktrace with maxSize= 1000 chars."] - #[serde( - rename = "stackTrace", - default, - skip_serializing_if = "Option::is_none" - )] - pub stack_trace: Option<String>, - #[doc = "Time when test execution started(UTC)."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_date: Option<time::OffsetDateTime>, - #[doc = "State of test result. Type TestRunState."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "List of sub results inside a test result, if ResultGroupType is not None, it holds corresponding type sub results."] - #[serde( - rename = "subResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub sub_results: Vec<TestSubResult>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testCase", default, skip_serializing_if = "Option::is_none")] - pub test_case: Option<ShallowReference>, - #[doc = "Reference ID of test used by test result. Type TestResultMetaData"] - #[serde( - rename = "testCaseReferenceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_reference_id: Option<i32>, - #[doc = "TestCaseRevision Number."] - #[serde( - rename = "testCaseRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_revision: Option<i32>, - #[doc = "Name of test."] - #[serde( - rename = "testCaseTitle", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_title: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] - pub test_plan: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testPoint", default, skip_serializing_if = "Option::is_none")] - pub test_point: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] - pub test_run: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testSuite", default, skip_serializing_if = "Option::is_none")] - pub test_suite: Option<ShallowReference>, - #[doc = "Url of test result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Test attachment ID of action recording."] + #[serde( + rename = "afnStripId", + default, + skip_serializing_if = "Option::is_none" + )] + pub afn_strip_id: Option<i32>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub area: Option<ShallowReference>, + #[doc = "Reference to bugs linked to test result."] + #[serde( + rename = "associatedBugs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub associated_bugs: Vec<ShallowReference>, + #[doc = "ID representing test method in a dll."] + #[serde( + rename = "automatedTestId", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_id: Option<String>, + #[doc = "Fully qualified name of test executed."] + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[doc = "Container to which test belongs."] + #[serde( + rename = "automatedTestStorage", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_storage: Option<String>, + #[doc = "Type of automated test."] + #[serde( + rename = "automatedTestType", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_type: Option<String>, + #[doc = "TypeId of automated test."] + #[serde( + rename = "automatedTestTypeId", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_type_id: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<ShallowReference>, + #[doc = "Reference to a build."] + #[serde( + rename = "buildReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_reference: Option<BuildReference>, + #[doc = "Comment in a test result with maxSize= 1000 chars."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Time when test execution completed(UTC). Completed date should be greater than StartedDate."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Machine name where test executed."] + #[serde( + rename = "computerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub computer_name: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<ShallowReference>, + #[doc = "Timestamp when test result created(UTC)."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Additional properties of test result."] + #[serde( + rename = "customFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub custom_fields: Vec<CustomTestField>, + #[doc = "Duration of test execution in milliseconds. If not provided value will be set as CompletedDate - StartedDate"] + #[serde( + rename = "durationInMs", + default, + skip_serializing_if = "Option::is_none" + )] + pub duration_in_ms: Option<f64>, + #[doc = "Error message in test execution."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "Failing since information of a test result."] + #[serde( + rename = "failingSince", + default, + skip_serializing_if = "Option::is_none" + )] + pub failing_since: Option<FailingSince>, + #[doc = "Failure type of test result. Valid Value= (Known Issue, New Issue, Regression, Unknown, None)"] + #[serde( + rename = "failureType", + default, + skip_serializing_if = "Option::is_none" + )] + pub failure_type: Option<String>, + #[doc = "ID of a test result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Test result details of test iterations used only for Manual Testing."] + #[serde( + rename = "iterationDetails", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub iteration_details: Vec<TestIterationDetailsModel>, + #[doc = ""] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<IdentityRef>, + #[doc = "Last updated datetime of test result(UTC)."] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "Test outcome of test result. Valid values = (Unspecified, None, Passed, Failed, Inconclusive, Timeout, Aborted, Blocked, NotExecuted, Warning, Error, NotApplicable, Paused, InProgress, NotImpacted)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Priority of test executed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub priority: Option<i32>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ShallowReference>, + #[doc = "Reference to a release."] + #[serde( + rename = "releaseReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_reference: Option<ReleaseReference>, + #[doc = "ResetCount."] + #[serde( + rename = "resetCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub reset_count: Option<i32>, + #[doc = "Resolution state of test result."] + #[serde( + rename = "resolutionState", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_state: Option<String>, + #[doc = "ID of resolution state."] + #[serde( + rename = "resolutionStateId", + default, + skip_serializing_if = "Option::is_none" + )] + pub resolution_state_id: Option<i32>, + #[doc = "Hierarchy type of the result, default value of None means its leaf node."] + #[serde( + rename = "resultGroupType", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_group_type: Option<test_case_result::ResultGroupType>, + #[doc = "Revision number of test result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = ""] + #[serde(rename = "runBy", default, skip_serializing_if = "Option::is_none")] + pub run_by: Option<IdentityRef>, + #[doc = "Stacktrace with maxSize= 1000 chars."] + #[serde( + rename = "stackTrace", + default, + skip_serializing_if = "Option::is_none" + )] + pub stack_trace: Option<String>, + #[doc = "Time when test execution started(UTC)."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_date: Option<time::OffsetDateTime>, + #[doc = "State of test result. Type TestRunState."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "List of sub results inside a test result, if ResultGroupType is not None, it holds corresponding type sub results."] + #[serde( + rename = "subResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub sub_results: Vec<TestSubResult>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testCase", default, skip_serializing_if = "Option::is_none")] + pub test_case: Option<ShallowReference>, + #[doc = "Reference ID of test used by test result. Type TestResultMetaData"] + #[serde( + rename = "testCaseReferenceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_reference_id: Option<i32>, + #[doc = "TestCaseRevision Number."] + #[serde( + rename = "testCaseRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_revision: Option<i32>, + #[doc = "Name of test."] + #[serde( + rename = "testCaseTitle", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_title: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testPlan", default, skip_serializing_if = "Option::is_none")] + pub test_plan: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testPoint", default, skip_serializing_if = "Option::is_none")] + pub test_point: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] + pub test_run: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testSuite", default, skip_serializing_if = "Option::is_none")] + pub test_suite: Option<ShallowReference>, + #[doc = "Url of test result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestCaseResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_case_result { - use super::*; - #[doc = "Hierarchy type of the result, default value of None means its leaf node."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ResultGroupType { - #[serde(rename = "none")] - None, - #[serde(rename = "rerun")] - Rerun, - #[serde(rename = "dataDriven")] - DataDriven, - #[serde(rename = "orderedTest")] - OrderedTest, - #[serde(rename = "generic")] - Generic, - } + use super::*; + #[doc = "Hierarchy type of the result, default value of None means its leaf node."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ResultGroupType { + #[serde(rename = "none")] + None, + #[serde(rename = "rerun")] + Rerun, + #[serde(rename = "dataDriven")] + DataDriven, + #[serde(rename = "orderedTest")] + OrderedTest, + #[serde(rename = "generic")] + Generic, + } } #[doc = "Test attachment information in a test iteration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseResultAttachmentModel { - #[doc = "Path identifier test step in test case workitem."] - #[serde( - rename = "actionPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_path: Option<String>, - #[doc = "Attachment ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Iteration ID."] - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[doc = "Name of attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Attachment size."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[doc = "Url to attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Path identifier test step in test case workitem."] + #[serde( + rename = "actionPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_path: Option<String>, + #[doc = "Attachment ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Iteration ID."] + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[doc = "Name of attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Attachment size."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[doc = "Url to attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestCaseResultAttachmentModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to a test result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestCaseResultIdentifier { - #[doc = "Test result ID."] - #[serde( - rename = "testResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result_id: Option<i32>, - #[doc = "Test run ID."] - #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] - pub test_run_id: Option<i32>, + #[doc = "Test result ID."] + #[serde( + rename = "testResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result_id: Option<i32>, + #[doc = "Test run ID."] + #[serde(rename = "testRunId", default, skip_serializing_if = "Option::is_none")] + pub test_run_id: Option<i32>, } impl TestCaseResultIdentifier { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test environment Detail."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestEnvironment { - #[doc = "Test Environment Id."] - #[serde( - rename = "environmentId", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_id: Option<String>, - #[doc = "Test Environment Name."] - #[serde( - rename = "environmentName", - default, - skip_serializing_if = "Option::is_none" - )] - pub environment_name: Option<String>, + #[doc = "Test Environment Id."] + #[serde( + rename = "environmentId", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_id: Option<String>, + #[doc = "Test Environment Name."] + #[serde( + rename = "environmentName", + default, + skip_serializing_if = "Option::is_none" + )] + pub environment_name: Option<String>, } impl TestEnvironment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestFailureDetails { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - rename = "testResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_results: Vec<TestCaseResultIdentifier>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + rename = "testResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_results: Vec<TestCaseResultIdentifier>, } impl TestFailureDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestFailuresAnalysis { - #[doc = ""] - #[serde( - rename = "existingFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub existing_failures: Option<TestFailureDetails>, - #[doc = ""] - #[serde( - rename = "fixedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub fixed_tests: Option<TestFailureDetails>, - #[doc = ""] - #[serde( - rename = "newFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_failures: Option<TestFailureDetails>, - #[doc = ""] - #[serde( - rename = "previousContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub previous_context: Option<TestResultsContext>, + #[doc = ""] + #[serde( + rename = "existingFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub existing_failures: Option<TestFailureDetails>, + #[doc = ""] + #[serde( + rename = "fixedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub fixed_tests: Option<TestFailureDetails>, + #[doc = ""] + #[serde( + rename = "newFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_failures: Option<TestFailureDetails>, + #[doc = ""] + #[serde( + rename = "previousContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub previous_context: Option<TestResultsContext>, } impl TestFailuresAnalysis { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Flaky Identifier"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestFlakyIdentifier { - #[doc = "Branch Name where Flakiness has to be Marked/Unmarked"] - #[serde( - rename = "branchName", - default, - skip_serializing_if = "Option::is_none" - )] - pub branch_name: Option<String>, - #[doc = "State for Flakiness"] - #[serde(rename = "isFlaky", default, skip_serializing_if = "Option::is_none")] - pub is_flaky: Option<bool>, + #[doc = "Branch Name where Flakiness has to be Marked/Unmarked"] + #[serde( + rename = "branchName", + default, + skip_serializing_if = "Option::is_none" + )] + pub branch_name: Option<String>, + #[doc = "State for Flakiness"] + #[serde(rename = "isFlaky", default, skip_serializing_if = "Option::is_none")] + pub is_flaky: Option<bool>, } impl TestFlakyIdentifier { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Filter to get TestCase result history."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestHistoryQuery { - #[doc = "Automated test name of the TestCase."] - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[doc = "Results to be get for a particular branches."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub branch: Option<String>, - #[doc = "Get the results history only for this BuildDefinitionId. This to get used in query GroupBy should be Branch. If this is provided, Branch will have no use."] - #[serde( - rename = "buildDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_definition_id: Option<i32>, - #[doc = "It will be filled by server. If not null means there are some results still to be get, and we need to call this REST API with this ContinuousToken. It is not supposed to be created (or altered, if received from server in last batch) by user."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[doc = "Group the result on the basis of TestResultGroupBy. This can be Branch, Environment or null(if results are fetched by BuildDefinitionId)"] - #[serde(rename = "groupBy", default, skip_serializing_if = "Option::is_none")] - pub group_by: Option<test_history_query::GroupBy>, - #[doc = "History to get between time interval MaxCompleteDate and (MaxCompleteDate - TrendDays). Default is current date time."] - #[serde( - rename = "maxCompleteDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub max_complete_date: Option<time::OffsetDateTime>, - #[doc = "Get the results history only for this ReleaseEnvDefinitionId. This to get used in query GroupBy should be Environment."] - #[serde( - rename = "releaseEnvDefinitionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_definition_id: Option<i32>, - #[doc = "List of TestResultHistoryForGroup which are grouped by GroupBy"] - #[serde( - rename = "resultsForGroup", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results_for_group: Vec<TestResultHistoryForGroup>, - #[doc = "Get the results history only for this testCaseId. This to get used in query to filter the result along with automatedtestname"] - #[serde( - rename = "testCaseId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_id: Option<i32>, - #[doc = "Number of days for which history to collect. Maximum supported value is 7 days. Default is 7 days."] - #[serde(rename = "trendDays", default, skip_serializing_if = "Option::is_none")] - pub trend_days: Option<i32>, + #[doc = "Automated test name of the TestCase."] + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[doc = "Results to be get for a particular branches."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub branch: Option<String>, + #[doc = "Get the results history only for this BuildDefinitionId. This to get used in query GroupBy should be Branch. If this is provided, Branch will have no use."] + #[serde( + rename = "buildDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_definition_id: Option<i32>, + #[doc = "It will be filled by server. If not null means there are some results still to be get, and we need to call this REST API with this ContinuousToken. It is not supposed to be created (or altered, if received from server in last batch) by user."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[doc = "Group the result on the basis of TestResultGroupBy. This can be Branch, Environment or null(if results are fetched by BuildDefinitionId)"] + #[serde(rename = "groupBy", default, skip_serializing_if = "Option::is_none")] + pub group_by: Option<test_history_query::GroupBy>, + #[doc = "History to get between time interval MaxCompleteDate and (MaxCompleteDate - TrendDays). Default is current date time."] + #[serde( + rename = "maxCompleteDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub max_complete_date: Option<time::OffsetDateTime>, + #[doc = "Get the results history only for this ReleaseEnvDefinitionId. This to get used in query GroupBy should be Environment."] + #[serde( + rename = "releaseEnvDefinitionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_definition_id: Option<i32>, + #[doc = "List of TestResultHistoryForGroup which are grouped by GroupBy"] + #[serde( + rename = "resultsForGroup", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results_for_group: Vec<TestResultHistoryForGroup>, + #[doc = "Get the results history only for this testCaseId. This to get used in query to filter the result along with automatedtestname"] + #[serde( + rename = "testCaseId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_id: Option<i32>, + #[doc = "Number of days for which history to collect. Maximum supported value is 7 days. Default is 7 days."] + #[serde(rename = "trendDays", default, skip_serializing_if = "Option::is_none")] + pub trend_days: Option<i32>, } impl TestHistoryQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_history_query { - use super::*; - #[doc = "Group the result on the basis of TestResultGroupBy. This can be Branch, Environment or null(if results are fetched by BuildDefinitionId)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum GroupBy { - #[serde(rename = "branch")] - Branch, - #[serde(rename = "environment")] - Environment, - } + use super::*; + #[doc = "Group the result on the basis of TestResultGroupBy. This can be Branch, Environment or null(if results are fetched by BuildDefinitionId)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum GroupBy { + #[serde(rename = "branch")] + Branch, + #[serde(rename = "environment")] + Environment, + } } #[doc = "Represents a test iteration result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestIterationDetailsModel { - #[doc = "Test step results in an iteration."] - #[serde( - rename = "actionResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub action_results: Vec<TestActionResultModel>, - #[doc = "Reference to attachments in test iteration result."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub attachments: Vec<TestCaseResultAttachmentModel>, - #[doc = "Comment in test iteration result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Time when execution completed(UTC)."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Duration of execution."] - #[serde( - rename = "durationInMs", - default, - skip_serializing_if = "Option::is_none" - )] - pub duration_in_ms: Option<f64>, - #[doc = "Error message in test iteration result execution."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "ID of test iteration result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Test outcome if test iteration result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = "Test parameters in an iteration."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub parameters: Vec<TestResultParameterModel>, - #[doc = "Time when execution started(UTC)."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_date: Option<time::OffsetDateTime>, - #[doc = "Url to test iteration result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Test step results in an iteration."] + #[serde( + rename = "actionResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub action_results: Vec<TestActionResultModel>, + #[doc = "Reference to attachments in test iteration result."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub attachments: Vec<TestCaseResultAttachmentModel>, + #[doc = "Comment in test iteration result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Time when execution completed(UTC)."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Duration of execution."] + #[serde( + rename = "durationInMs", + default, + skip_serializing_if = "Option::is_none" + )] + pub duration_in_ms: Option<f64>, + #[doc = "Error message in test iteration result execution."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "ID of test iteration result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Test outcome if test iteration result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = "Test parameters in an iteration."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub parameters: Vec<TestResultParameterModel>, + #[doc = "Time when execution started(UTC)."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_date: Option<time::OffsetDateTime>, + #[doc = "Url to test iteration result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestIterationDetailsModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents Test Log Result object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestLog { - #[doc = "Test Log Reference object"] - #[serde( - rename = "logReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub log_reference: Option<TestLogReference>, - #[doc = "Meta data for Log file"] - #[serde(rename = "metaData", default, skip_serializing_if = "Option::is_none")] - pub meta_data: Option<serde_json::Value>, - #[doc = "LastUpdatedDate for Log file"] - #[serde( - rename = "modifiedOn", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_on: Option<time::OffsetDateTime>, - #[doc = "Size in Bytes for Log file"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, + #[doc = "Test Log Reference object"] + #[serde( + rename = "logReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub log_reference: Option<TestLogReference>, + #[doc = "Meta data for Log file"] + #[serde(rename = "metaData", default, skip_serializing_if = "Option::is_none")] + pub meta_data: Option<serde_json::Value>, + #[doc = "LastUpdatedDate for Log file"] + #[serde( + rename = "modifiedOn", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_on: Option<time::OffsetDateTime>, + #[doc = "Size in Bytes for Log file"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, } impl TestLog { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestLogList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestLog>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestLog>, } impl TestLogList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Log Reference object"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestLogReference { - #[doc = "BuildId for test log, if context is build"] - #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] - pub build_id: Option<i32>, - #[doc = "FileName for log file"] - #[serde(rename = "filePath", default, skip_serializing_if = "Option::is_none")] - pub file_path: Option<String>, - #[doc = "ReleaseEnvId for test log, if context is Release"] - #[serde( - rename = "releaseEnvId", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_env_id: Option<i32>, - #[doc = "ReleaseId for test log, if context is Release"] - #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] - pub release_id: Option<i32>, - #[doc = "Resultid for test log, if context is run and log is related to result"] - #[serde(rename = "resultId", default, skip_serializing_if = "Option::is_none")] - pub result_id: Option<i32>, - #[doc = "runid for test log, if context is run"] - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option<i32>, - #[doc = "Test Log Scope"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<test_log_reference::Scope>, - #[doc = "SubResultid for test log, if context is run and log is related to subresult"] - #[serde( - rename = "subResultId", - default, - skip_serializing_if = "Option::is_none" - )] - pub sub_result_id: Option<i32>, - #[doc = "Log Type"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<test_log_reference::Type>, + #[doc = "BuildId for test log, if context is build"] + #[serde(rename = "buildId", default, skip_serializing_if = "Option::is_none")] + pub build_id: Option<i32>, + #[doc = "FileName for log file"] + #[serde(rename = "filePath", default, skip_serializing_if = "Option::is_none")] + pub file_path: Option<String>, + #[doc = "ReleaseEnvId for test log, if context is Release"] + #[serde( + rename = "releaseEnvId", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_env_id: Option<i32>, + #[doc = "ReleaseId for test log, if context is Release"] + #[serde(rename = "releaseId", default, skip_serializing_if = "Option::is_none")] + pub release_id: Option<i32>, + #[doc = "Resultid for test log, if context is run and log is related to result"] + #[serde(rename = "resultId", default, skip_serializing_if = "Option::is_none")] + pub result_id: Option<i32>, + #[doc = "runid for test log, if context is run"] + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option<i32>, + #[doc = "Test Log Scope"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<test_log_reference::Scope>, + #[doc = "SubResultid for test log, if context is run and log is related to subresult"] + #[serde( + rename = "subResultId", + default, + skip_serializing_if = "Option::is_none" + )] + pub sub_result_id: Option<i32>, + #[doc = "Log Type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<test_log_reference::Type>, } impl TestLogReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_log_reference { - use super::*; - #[doc = "Test Log Scope"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Scope { - #[serde(rename = "run")] - Run, - } - #[doc = "Log Type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "generalAttachment")] - GeneralAttachment, - } -} -#[doc = "Attachment metadata for test attachments from LogStore."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TestLogStoreAttachment { - #[doc = "Attachment type."] - #[serde( - rename = "attachmentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub attachment_type: Option<test_log_store_attachment::AttachmentType>, - #[doc = "Comment associated with attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Attachment created date."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Attachment file name."] - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[doc = "Attachment size."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[doc = "Attachment Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, -} -impl TestLogStoreAttachment { - pub fn new() -> Self { - Self::default() - } -} -pub mod test_log_store_attachment { - use super::*; - #[doc = "Attachment type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AttachmentType { - #[serde(rename = "generalAttachment")] - GeneralAttachment, - #[serde(rename = "codeCoverage")] - CodeCoverage, - #[serde(rename = "consoleLog")] - ConsoleLog, - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TestLogStoreAttachmentList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestLogStoreAttachment>, -} -impl TestLogStoreAttachmentList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Reference to test attachment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TestLogStoreAttachmentReference { - #[doc = "Url to download the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, -} -impl TestLogStoreAttachmentReference { - pub fn new() -> Self { - Self::default() - } + use super::*; + #[doc = "Test Log Scope"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Scope { + #[serde(rename = "run")] + Run, + } + #[doc = "Log Type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "generalAttachment")] + GeneralAttachment, + } } #[doc = "Represents Test Log store endpoint details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestLogStoreEndpointDetails { - #[doc = "Test log store connection Uri."] - #[serde( - rename = "endpointSASUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_sas_uri: Option<String>, - #[doc = "Test log store endpoint type."] - #[serde( - rename = "endpointType", - default, - skip_serializing_if = "Option::is_none" - )] - pub endpoint_type: Option<test_log_store_endpoint_details::EndpointType>, - #[doc = "Test log store status code"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<test_log_store_endpoint_details::Status>, + #[doc = "Test log store connection Uri."] + #[serde( + rename = "endpointSASUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_sas_uri: Option<String>, + #[doc = "Test log store endpoint type."] + #[serde( + rename = "endpointType", + default, + skip_serializing_if = "Option::is_none" + )] + pub endpoint_type: Option<test_log_store_endpoint_details::EndpointType>, + #[doc = "Test log store status code"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<test_log_store_endpoint_details::Status>, } impl TestLogStoreEndpointDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_log_store_endpoint_details { - use super::*; - #[doc = "Test log store endpoint type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum EndpointType { - #[serde(rename = "root")] - Root, - #[serde(rename = "file")] - File, - } - #[doc = "Test log store status code"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Status { - #[serde(rename = "success")] - Success, - #[serde(rename = "failed")] - Failed, - #[serde(rename = "fileAlreadyExists")] - FileAlreadyExists, - #[serde(rename = "invalidInput")] - InvalidInput, - #[serde(rename = "invalidFileName")] - InvalidFileName, - #[serde(rename = "invalidContainer")] - InvalidContainer, - #[serde(rename = "transferFailed")] - TransferFailed, - #[serde(rename = "featureDisabled")] - FeatureDisabled, - #[serde(rename = "buildDoesNotExist")] - BuildDoesNotExist, - #[serde(rename = "runDoesNotExist")] - RunDoesNotExist, - #[serde(rename = "containerNotCreated")] - ContainerNotCreated, - #[serde(rename = "apiNotSupported")] - ApiNotSupported, - #[serde(rename = "fileSizeExceeds")] - FileSizeExceeds, - #[serde(rename = "containerNotFound")] - ContainerNotFound, - #[serde(rename = "fileNotFound")] - FileNotFound, - #[serde(rename = "directoryNotFound")] - DirectoryNotFound, - #[serde(rename = "storageCapacityExceeded")] - StorageCapacityExceeded, - } + use super::*; + #[doc = "Test log store endpoint type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum EndpointType { + #[serde(rename = "root")] + Root, + #[serde(rename = "file")] + File, + } + #[doc = "Test log store status code"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + #[serde(rename = "success")] + Success, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "fileAlreadyExists")] + FileAlreadyExists, + #[serde(rename = "invalidInput")] + InvalidInput, + #[serde(rename = "invalidFileName")] + InvalidFileName, + #[serde(rename = "invalidContainer")] + InvalidContainer, + #[serde(rename = "transferFailed")] + TransferFailed, + #[serde(rename = "featureDisabled")] + FeatureDisabled, + #[serde(rename = "buildDoesNotExist")] + BuildDoesNotExist, + #[serde(rename = "runDoesNotExist")] + RunDoesNotExist, + #[serde(rename = "containerNotCreated")] + ContainerNotCreated, + #[serde(rename = "apiNotSupported")] + ApiNotSupported, + #[serde(rename = "fileSizeExceeds")] + FileSizeExceeds, + #[serde(rename = "containerNotFound")] + ContainerNotFound, + #[serde(rename = "fileNotFound")] + FileNotFound, + #[serde(rename = "directoryNotFound")] + DirectoryNotFound, + #[serde(rename = "storageCapacityExceeded")] + StorageCapacityExceeded, + } } #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestMessageLogDetails { - #[doc = "Date when the resource is created"] - #[serde( - rename = "dateCreated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date_created: Option<time::OffsetDateTime>, - #[doc = "Id of the resource"] - #[serde(rename = "entryId", default, skip_serializing_if = "Option::is_none")] - pub entry_id: Option<i32>, - #[doc = "Message of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, + #[doc = "Date when the resource is created"] + #[serde( + rename = "dateCreated", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date_created: Option<time::OffsetDateTime>, + #[doc = "Id of the resource"] + #[serde(rename = "entryId", default, skip_serializing_if = "Option::is_none")] + pub entry_id: Option<i32>, + #[doc = "Message of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, } impl TestMessageLogDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestMethod { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub container: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub container: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TestMethod { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Class representing a reference to an operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestOperationReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestOperationReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test Resolution State Details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResolutionState { - #[doc = "Test Resolution state Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Test Resolution State Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, + #[doc = "Test Resolution state Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Test Resolution State Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, } impl TestResolutionState { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultDocument { - #[doc = "Class representing a reference to an operation."] - #[serde( - rename = "operationReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_reference: Option<TestOperationReference>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub payload: Option<TestResultPayload>, + #[doc = "Class representing a reference to an operation."] + #[serde( + rename = "operationReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub operation_reference: Option<TestOperationReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub payload: Option<TestResultPayload>, } impl TestResultDocument { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The test failure type resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TestResultFailureType { - #[doc = "ID of the test failure type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Name of the test failure type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, -} -impl TestResultFailureType { - pub fn new() -> Self { - Self::default() - } -} -#[doc = ""] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TestResultFailureTypeList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestResultFailureType>, -} -impl TestResultFailureTypeList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The test failure type request model"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TestResultFailureTypeRequestModel { - #[doc = "Name of the test failure type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, -} -impl TestResultFailureTypeRequestModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultFailuresAnalysis { - #[doc = ""] - #[serde( - rename = "existingFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub existing_failures: Option<TestFailureDetails>, - #[doc = ""] - #[serde( - rename = "fixedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub fixed_tests: Option<TestFailureDetails>, - #[doc = ""] - #[serde( - rename = "newFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_failures: Option<TestFailureDetails>, + #[doc = ""] + #[serde( + rename = "existingFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub existing_failures: Option<TestFailureDetails>, + #[doc = ""] + #[serde( + rename = "fixedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub fixed_tests: Option<TestFailureDetails>, + #[doc = ""] + #[serde( + rename = "newFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_failures: Option<TestFailureDetails>, } impl TestResultFailuresAnalysis { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultHistory { - #[serde( - rename = "groupByField", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_field: Option<String>, - #[serde( - rename = "resultsForGroup", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results_for_group: Vec<TestResultHistoryDetailsForGroup>, + #[serde( + rename = "groupByField", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_field: Option<String>, + #[serde( + rename = "resultsForGroup", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results_for_group: Vec<TestResultHistoryDetailsForGroup>, } impl TestResultHistory { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultHistoryDetailsForGroup { - #[serde( - rename = "groupByValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_value: Option<serde_json::Value>, - #[doc = "Represents a test result."] - #[serde( - rename = "latestResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub latest_result: Option<TestCaseResult>, + #[serde( + rename = "groupByValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_value: Option<serde_json::Value>, + #[doc = "Represents a test result."] + #[serde( + rename = "latestResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub latest_result: Option<TestCaseResult>, } impl TestResultHistoryDetailsForGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "List of test results filtered on the basis of GroupByValue"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultHistoryForGroup { - #[doc = "Display name of the group."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Name or Id of the group identifier by which results are grouped together."] - #[serde( - rename = "groupByValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_value: Option<String>, - #[doc = "List of results for GroupByValue"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<TestCaseResult>, + #[doc = "Display name of the group."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Name or Id of the group identifier by which results are grouped together."] + #[serde( + rename = "groupByValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_value: Option<String>, + #[doc = "List of results for GroupByValue"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<TestCaseResult>, } impl TestResultHistoryForGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a Meta Data of a test result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultMetaData { - #[doc = "AutomatedTestName of test result."] - #[serde( - rename = "automatedTestName", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_name: Option<String>, - #[doc = "AutomatedTestStorage of test result."] - #[serde( - rename = "automatedTestStorage", - default, - skip_serializing_if = "Option::is_none" - )] - pub automated_test_storage: Option<String>, - #[doc = "List of Flaky Identifier for TestCaseReferenceId"] - #[serde( - rename = "flakyIdentifiers", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub flaky_identifiers: Vec<TestFlakyIdentifier>, - #[doc = "Owner of test result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, - #[doc = "Priority of test result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option<i32>, - #[doc = "ID of TestCaseReference."] - #[serde( - rename = "testCaseReferenceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_reference_id: Option<i32>, - #[doc = "TestCaseTitle of test result."] - #[serde( - rename = "testCaseTitle", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_case_title: Option<String>, + #[doc = "AutomatedTestName of test result."] + #[serde( + rename = "automatedTestName", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_name: Option<String>, + #[doc = "AutomatedTestStorage of test result."] + #[serde( + rename = "automatedTestStorage", + default, + skip_serializing_if = "Option::is_none" + )] + pub automated_test_storage: Option<String>, + #[doc = "List of Flaky Identifier for TestCaseReferenceId"] + #[serde( + rename = "flakyIdentifiers", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub flaky_identifiers: Vec<TestFlakyIdentifier>, + #[doc = "Owner of test result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, + #[doc = "Priority of test result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub priority: Option<i32>, + #[doc = "ID of TestCaseReference."] + #[serde( + rename = "testCaseReferenceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_reference_id: Option<i32>, + #[doc = "TestCaseTitle of test result."] + #[serde( + rename = "testCaseTitle", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_case_title: Option<String>, } impl TestResultMetaData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultMetaDataList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TestResultMetaData>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TestResultMetaData>, } impl TestResultMetaDataList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a TestResultMetaData Input"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultMetaDataUpdateInput { - #[doc = "List of Flaky Identifiers"] - #[serde( - rename = "flakyIdentifiers", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub flaky_identifiers: Vec<TestFlakyIdentifier>, + #[doc = "List of Flaky Identifiers"] + #[serde( + rename = "flakyIdentifiers", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub flaky_identifiers: Vec<TestFlakyIdentifier>, } impl TestResultMetaDataUpdateInput { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultModelBase { - #[doc = "Comment in result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Time when execution completed(UTC)."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Duration of execution."] - #[serde( - rename = "durationInMs", - default, - skip_serializing_if = "Option::is_none" - )] - pub duration_in_ms: Option<f64>, - #[doc = "Error message in result."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "Test outcome of result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = "Time when execution started(UTC)."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_date: Option<time::OffsetDateTime>, + #[doc = "Comment in result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Time when execution completed(UTC)."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Duration of execution."] + #[serde( + rename = "durationInMs", + default, + skip_serializing_if = "Option::is_none" + )] + pub duration_in_ms: Option<f64>, + #[doc = "Error message in result."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "Test outcome of result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = "Time when execution started(UTC)."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_date: Option<time::OffsetDateTime>, } impl TestResultModelBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test parameter information in a test iteration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultParameterModel { - #[doc = "Test step path where parameter is referenced."] - #[serde( - rename = "actionPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_path: Option<String>, - #[doc = "Iteration ID."] - #[serde( - rename = "iterationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_id: Option<i32>, - #[doc = "Name of parameter."] - #[serde( - rename = "parameterName", - default, - skip_serializing_if = "Option::is_none" - )] - pub parameter_name: Option<String>, - #[doc = "This is step Id of test case. For shared step, it is step Id of shared step in test case workitem; step Id in shared step. Example: TestCase workitem has two steps: 1) Normal step with Id = 1 2) Shared Step with Id = 2. Inside shared step: a) Normal Step with Id = 1 Value for StepIdentifier for First step: \"1\" Second step: \"2;1\""] - #[serde( - rename = "stepIdentifier", - default, - skip_serializing_if = "Option::is_none" - )] - pub step_identifier: Option<String>, - #[doc = "Url of test parameter. Deprecated in hosted environment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Value of parameter."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Test step path where parameter is referenced."] + #[serde( + rename = "actionPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_path: Option<String>, + #[doc = "Iteration ID."] + #[serde( + rename = "iterationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_id: Option<i32>, + #[doc = "Name of parameter."] + #[serde( + rename = "parameterName", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_name: Option<String>, + #[doc = "This is step Id of test case. For shared step, it is step Id of shared step in test case workitem; step Id in shared step. Example: TestCase workitem has two steps: 1) Normal step with Id = 1 2) Shared Step with Id = 2. Inside shared step: a) Normal Step with Id = 1 Value for StepIdentifier for First step: \"1\" Second step: \"2;1\""] + #[serde( + rename = "stepIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub step_identifier: Option<String>, + #[doc = "Url of test parameter. Deprecated in hosted environment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Value of parameter."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl TestResultParameterModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultPayload { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stream: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stream: Option<String>, } impl TestResultPayload { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultSummary { - #[doc = ""] - #[serde( - rename = "aggregatedResultsAnalysis", - default, - skip_serializing_if = "Option::is_none" - )] - pub aggregated_results_analysis: Option<AggregatedResultsAnalysis>, - #[serde( - rename = "noConfigRunsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub no_config_runs_count: Option<i32>, - #[doc = ""] - #[serde( - rename = "teamProject", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project: Option<TeamProjectReference>, - #[doc = ""] - #[serde( - rename = "testFailures", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_failures: Option<TestFailuresAnalysis>, - #[doc = ""] - #[serde( - rename = "testResultsContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_results_context: Option<TestResultsContext>, - #[serde( - rename = "totalRunsCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_runs_count: Option<i32>, + #[doc = ""] + #[serde( + rename = "aggregatedResultsAnalysis", + default, + skip_serializing_if = "Option::is_none" + )] + pub aggregated_results_analysis: Option<AggregatedResultsAnalysis>, + #[serde( + rename = "noConfigRunsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub no_config_runs_count: Option<i32>, + #[doc = ""] + #[serde( + rename = "teamProject", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project: Option<TeamProjectReference>, + #[doc = ""] + #[serde( + rename = "testFailures", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_failures: Option<TestFailuresAnalysis>, + #[doc = ""] + #[serde( + rename = "testResultsContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_results_context: Option<TestResultsContext>, + #[serde( + rename = "totalRunsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_runs_count: Option<i32>, } impl TestResultSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultTrendFilter { - #[serde( - rename = "branchNames", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub branch_names: Vec<String>, - #[serde( - rename = "buildCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_count: Option<i32>, - #[serde( - rename = "definitionIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub definition_ids: Vec<i32>, - #[serde( - rename = "envDefinitionIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub env_definition_ids: Vec<i32>, - #[serde( - rename = "maxCompleteDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub max_complete_date: Option<time::OffsetDateTime>, - #[serde( - rename = "publishContext", - default, - skip_serializing_if = "Option::is_none" - )] - pub publish_context: Option<String>, - #[serde( - rename = "testRunTitles", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub test_run_titles: Vec<String>, - #[serde(rename = "trendDays", default, skip_serializing_if = "Option::is_none")] - pub trend_days: Option<i32>, + #[serde( + rename = "branchNames", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub branch_names: Vec<String>, + #[serde( + rename = "buildCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_count: Option<i32>, + #[serde( + rename = "definitionIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub definition_ids: Vec<i32>, + #[serde( + rename = "envDefinitionIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub env_definition_ids: Vec<i32>, + #[serde( + rename = "maxCompleteDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub max_complete_date: Option<time::OffsetDateTime>, + #[serde( + rename = "publishContext", + default, + skip_serializing_if = "Option::is_none" + )] + pub publish_context: Option<String>, + #[serde( + rename = "testRunTitles", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub test_run_titles: Vec<String>, + #[serde(rename = "trendDays", default, skip_serializing_if = "Option::is_none")] + pub trend_days: Option<i32>, } impl TestResultTrendFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsContext { - #[doc = "Reference to a build."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<BuildReference>, - #[serde( - rename = "contextType", - default, - skip_serializing_if = "Option::is_none" - )] - pub context_type: Option<test_results_context::ContextType>, - #[doc = "Pipeline reference"] - #[serde( - rename = "pipelineReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub pipeline_reference: Option<PipelineReference>, - #[doc = "Reference to a release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ReleaseReference>, + #[doc = "Reference to a build."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<BuildReference>, + #[serde( + rename = "contextType", + default, + skip_serializing_if = "Option::is_none" + )] + pub context_type: Option<test_results_context::ContextType>, + #[doc = "Pipeline reference"] + #[serde( + rename = "pipelineReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub pipeline_reference: Option<PipelineReference>, + #[doc = "Reference to a release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ReleaseReference>, } impl TestResultsContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_results_context { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ContextType { - #[serde(rename = "build")] - Build, - #[serde(rename = "release")] - Release, - #[serde(rename = "pipeline")] - Pipeline, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ContextType { + #[serde(rename = "build")] + Build, + #[serde(rename = "release")] + Release, + #[serde(rename = "pipeline")] + Pipeline, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsDetails { - #[serde( - rename = "groupByField", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_field: Option<String>, - #[serde( - rename = "resultsForGroup", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results_for_group: Vec<TestResultsDetailsForGroup>, + #[serde( + rename = "groupByField", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_field: Option<String>, + #[serde( + rename = "resultsForGroup", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results_for_group: Vec<TestResultsDetailsForGroup>, } impl TestResultsDetails { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsDetailsForGroup { - #[serde( - rename = "groupByValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub group_by_value: Option<serde_json::Value>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<TestCaseResult>, - #[serde( - rename = "resultsCountByOutcome", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_count_by_outcome: Option<serde_json::Value>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<String>, + #[serde( + rename = "groupByValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub group_by_value: Option<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<TestCaseResult>, + #[serde( + rename = "resultsCountByOutcome", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_count_by_outcome: Option<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<String>, } impl TestResultsDetailsForGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsQuery { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub fields: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<TestCaseResult>, - #[doc = ""] - #[serde( - rename = "resultsFilter", - default, - skip_serializing_if = "Option::is_none" - )] - pub results_filter: Option<ResultsFilter>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub fields: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<TestCaseResult>, + #[doc = ""] + #[serde( + rename = "resultsFilter", + default, + skip_serializing_if = "Option::is_none" + )] + pub results_filter: Option<ResultsFilter>, } impl TestResultsQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsSettings { - #[doc = ""] - #[serde( - rename = "flakySettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub flaky_settings: Option<FlakySettings>, - #[doc = ""] - #[serde( - rename = "newTestResultLoggingSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_test_result_logging_settings: Option<NewTestResultLoggingSettings>, + #[doc = ""] + #[serde( + rename = "flakySettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub flaky_settings: Option<FlakySettings>, + #[doc = ""] + #[serde( + rename = "newTestResultLoggingSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_test_result_logging_settings: Option<NewTestResultLoggingSettings>, } impl TestResultsSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestResultsUpdateSettings { - #[doc = ""] - #[serde( - rename = "flakySettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub flaky_settings: Option<FlakySettings>, - #[doc = ""] - #[serde( - rename = "newTestResultLoggingSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_test_result_logging_settings: Option<NewTestResultLoggingSettings>, + #[doc = ""] + #[serde( + rename = "flakySettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub flaky_settings: Option<FlakySettings>, + #[doc = ""] + #[serde( + rename = "newTestResultLoggingSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_test_result_logging_settings: Option<NewTestResultLoggingSettings>, } impl TestResultsUpdateSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test run details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRun { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub build: Option<ShallowReference>, - #[doc = "BuildConfiguration Details."] - #[serde( - rename = "buildConfiguration", - default, - skip_serializing_if = "Option::is_none" - )] - pub build_configuration: Option<BuildConfiguration>, - #[doc = "Comments entered by those analyzing the run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Completed date time of the run."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Test Run Controller."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub controller: Option<String>, - #[doc = "Test Run CreatedDate."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "List of Custom Fields for TestRun."] - #[serde( - rename = "customFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub custom_fields: Vec<CustomTestField>, - #[doc = "Drop Location for the test Run."] - #[serde( - rename = "dropLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub drop_location: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlAutEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_aut_environment: Option<ShallowReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "dtlEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_environment: Option<ShallowReference>, - #[doc = "This is a temporary class to provide the details for the test run environment."] - #[serde( - rename = "dtlEnvironmentCreationDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub dtl_environment_creation_details: Option<DtlEnvironmentDetails>, - #[doc = "Due date and time for test run."] - #[serde( - rename = "dueDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub due_date: Option<time::OffsetDateTime>, - #[doc = "Error message associated with the run."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "This class is used to provide the filters used for discovery"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option<RunFilter>, - #[doc = "ID of the test run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Number of Incomplete Tests."] - #[serde( - rename = "incompleteTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub incomplete_tests: Option<i32>, - #[doc = "true if test run is automated, false otherwise."] - #[serde( - rename = "isAutomated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_automated: Option<bool>, - #[doc = "The iteration to which the run belongs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub iteration: Option<String>, - #[doc = ""] - #[serde( - rename = "lastUpdatedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_updated_by: Option<IdentityRef>, - #[doc = "Last updated date and time"] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "Name of the test run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Number of Not Applicable Tests."] - #[serde( - rename = "notApplicableTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub not_applicable_tests: Option<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Number of passed tests in the run"] - #[serde( - rename = "passedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub passed_tests: Option<i32>, - #[doc = "Phase/State for the testRun."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub phase: Option<String>, - #[doc = "Pipeline reference"] - #[serde( - rename = "pipelineReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub pipeline_reference: Option<PipelineReference>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub plan: Option<ShallowReference>, - #[doc = "Post Process State."] - #[serde( - rename = "postProcessState", - default, - skip_serializing_if = "Option::is_none" - )] - pub post_process_state: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<ShallowReference>, - #[doc = "Reference to a release."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub release: Option<ReleaseReference>, - #[doc = "Release Environment Uri for TestRun."] - #[serde( - rename = "releaseEnvironmentUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_environment_uri: Option<String>, - #[doc = "Release Uri for TestRun."] - #[serde( - rename = "releaseUri", - default, - skip_serializing_if = "Option::is_none" - )] - pub release_uri: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "RunSummary by outcome."] - #[serde( - rename = "runStatistics", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub run_statistics: Vec<RunStatistic>, - #[doc = "Start date time of the run."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_date: Option<time::OffsetDateTime>, - #[doc = "The state of the run. Type TestRunState Valid states - Unspecified ,NotStarted, InProgress, Completed, Waiting, Aborted, NeedsInvestigation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "TestRun Substate."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub substate: Option<test_run::Substate>, - #[doc = "Tags attached with this test run."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<TestTag>, - #[doc = "Test environment Detail."] - #[serde( - rename = "testEnvironment", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_environment: Option<TestEnvironment>, - #[serde( - rename = "testMessageLogId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_message_log_id: Option<i32>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde( - rename = "testSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings: Option<ShallowReference>, - #[doc = "Total tests in the run"] - #[serde( - rename = "totalTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_tests: Option<i32>, - #[doc = "Number of failed tests in the run."] - #[serde( - rename = "unanalyzedTests", - default, - skip_serializing_if = "Option::is_none" - )] - pub unanalyzed_tests: Option<i32>, - #[doc = "Url of the test run"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Web Access Url for TestRun."] - #[serde( - rename = "webAccessUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub web_access_url: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub build: Option<ShallowReference>, + #[doc = "BuildConfiguration Details."] + #[serde( + rename = "buildConfiguration", + default, + skip_serializing_if = "Option::is_none" + )] + pub build_configuration: Option<BuildConfiguration>, + #[doc = "Comments entered by those analyzing the run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Completed date time of the run."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Test Run Controller."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub controller: Option<String>, + #[doc = "Test Run CreatedDate."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "List of Custom Fields for TestRun."] + #[serde( + rename = "customFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub custom_fields: Vec<CustomTestField>, + #[doc = "Drop Location for the test Run."] + #[serde( + rename = "dropLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub drop_location: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlAutEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_aut_environment: Option<ShallowReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "dtlEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_environment: Option<ShallowReference>, + #[doc = "This is a temporary class to provide the details for the test run environment."] + #[serde( + rename = "dtlEnvironmentCreationDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub dtl_environment_creation_details: Option<DtlEnvironmentDetails>, + #[doc = "Due date and time for test run."] + #[serde( + rename = "dueDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub due_date: Option<time::OffsetDateTime>, + #[doc = "Error message associated with the run."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "This class is used to provide the filters used for discovery"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option<RunFilter>, + #[doc = "ID of the test run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Number of Incomplete Tests."] + #[serde( + rename = "incompleteTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub incomplete_tests: Option<i32>, + #[doc = "true if test run is automated, false otherwise."] + #[serde( + rename = "isAutomated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_automated: Option<bool>, + #[doc = "The iteration to which the run belongs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iteration: Option<String>, + #[doc = ""] + #[serde( + rename = "lastUpdatedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_updated_by: Option<IdentityRef>, + #[doc = "Last updated date and time"] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "Name of the test run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Number of Not Applicable Tests."] + #[serde( + rename = "notApplicableTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub not_applicable_tests: Option<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Number of passed tests in the run"] + #[serde( + rename = "passedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub passed_tests: Option<i32>, + #[doc = "Phase/State for the testRun."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phase: Option<String>, + #[doc = "Pipeline reference"] + #[serde( + rename = "pipelineReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub pipeline_reference: Option<PipelineReference>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plan: Option<ShallowReference>, + #[doc = "Post Process State."] + #[serde( + rename = "postProcessState", + default, + skip_serializing_if = "Option::is_none" + )] + pub post_process_state: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<ShallowReference>, + #[doc = "Reference to a release."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub release: Option<ReleaseReference>, + #[doc = "Release Environment Uri for TestRun."] + #[serde( + rename = "releaseEnvironmentUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_environment_uri: Option<String>, + #[doc = "Release Uri for TestRun."] + #[serde( + rename = "releaseUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub release_uri: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "RunSummary by outcome."] + #[serde( + rename = "runStatistics", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub run_statistics: Vec<RunStatistic>, + #[doc = "Start date time of the run."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_date: Option<time::OffsetDateTime>, + #[doc = "The state of the run. Type TestRunState Valid states - Unspecified ,NotStarted, InProgress, Completed, Waiting, Aborted, NeedsInvestigation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "TestRun Substate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub substate: Option<test_run::Substate>, + #[doc = "Tags attached with this test run."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<TestTag>, + #[doc = "Test environment Detail."] + #[serde( + rename = "testEnvironment", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_environment: Option<TestEnvironment>, + #[serde( + rename = "testMessageLogId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_message_log_id: Option<i32>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde( + rename = "testSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings: Option<ShallowReference>, + #[doc = "Total tests in the run"] + #[serde( + rename = "totalTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_tests: Option<i32>, + #[doc = "Number of failed tests in the run."] + #[serde( + rename = "unanalyzedTests", + default, + skip_serializing_if = "Option::is_none" + )] + pub unanalyzed_tests: Option<i32>, + #[doc = "Url of the test run"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Web Access Url for TestRun."] + #[serde( + rename = "webAccessUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub web_access_url: Option<String>, } impl TestRun { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_run { - use super::*; - #[doc = "TestRun Substate."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Substate { - #[serde(rename = "none")] - None, - #[serde(rename = "creatingEnvironment")] - CreatingEnvironment, - #[serde(rename = "runningTests")] - RunningTests, - #[serde(rename = "canceledByUser")] - CanceledByUser, - #[serde(rename = "abortedBySystem")] - AbortedBySystem, - #[serde(rename = "timedOut")] - TimedOut, - #[serde(rename = "pendingAnalysis")] - PendingAnalysis, - #[serde(rename = "analyzed")] - Analyzed, - #[serde(rename = "cancellationInProgress")] - CancellationInProgress, - } + use super::*; + #[doc = "TestRun Substate."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Substate { + #[serde(rename = "none")] + None, + #[serde(rename = "creatingEnvironment")] + CreatingEnvironment, + #[serde(rename = "runningTests")] + RunningTests, + #[serde(rename = "canceledByUser")] + CanceledByUser, + #[serde(rename = "abortedBySystem")] + AbortedBySystem, + #[serde(rename = "timedOut")] + TimedOut, + #[serde(rename = "pendingAnalysis")] + PendingAnalysis, + #[serde(rename = "analyzed")] + Analyzed, + #[serde(rename = "cancellationInProgress")] + CancellationInProgress, + } } #[doc = "Test Run Code Coverage Details"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunCoverage { - #[doc = "Last Error"] - #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] - pub last_error: Option<String>, - #[doc = "List of Modules Coverage"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub modules: Vec<ModuleCoverage>, - #[doc = "State"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] - pub test_run: Option<ShallowReference>, + #[doc = "Last Error"] + #[serde(rename = "lastError", default, skip_serializing_if = "Option::is_none")] + pub last_error: Option<String>, + #[doc = "List of Modules Coverage"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub modules: Vec<ModuleCoverage>, + #[doc = "State"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(rename = "testRun", default, skip_serializing_if = "Option::is_none")] + pub test_run: Option<ShallowReference>, } impl TestRunCoverage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test run statistics."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestRunStatistic { - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub run: Option<ShallowReference>, - #[serde( - rename = "runStatistics", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub run_statistics: Vec<RunStatistic>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub run: Option<ShallowReference>, + #[serde( + rename = "runStatistics", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub run_statistics: Vec<RunStatistic>, } impl TestRunStatistic { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the test settings of the run. Used to create test settings and fetch test settings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSettings { - #[doc = "Area path required to create test settings"] - #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] - pub area_path: Option<String>, - #[doc = "Description of the test settings. Used in create test settings."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Indicates if the tests settings is public or private.Used in create test settings."] - #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] - pub is_public: Option<bool>, - #[doc = "Xml string of machine roles. Used in create test settings."] - #[serde( - rename = "machineRoles", - default, - skip_serializing_if = "Option::is_none" - )] - pub machine_roles: Option<String>, - #[doc = "Test settings content."] - #[serde( - rename = "testSettingsContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_content: Option<String>, - #[doc = "Test settings id."] - #[serde( - rename = "testSettingsId", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_id: Option<i32>, - #[doc = "Test settings name."] - #[serde( - rename = "testSettingsName", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_settings_name: Option<String>, + #[doc = "Area path required to create test settings"] + #[serde(rename = "areaPath", default, skip_serializing_if = "Option::is_none")] + pub area_path: Option<String>, + #[doc = "Description of the test settings. Used in create test settings."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Indicates if the tests settings is public or private.Used in create test settings."] + #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] + pub is_public: Option<bool>, + #[doc = "Xml string of machine roles. Used in create test settings."] + #[serde( + rename = "machineRoles", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_roles: Option<String>, + #[doc = "Test settings content."] + #[serde( + rename = "testSettingsContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_content: Option<String>, + #[doc = "Test settings id."] + #[serde( + rename = "testSettingsId", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_id: Option<i32>, + #[doc = "Test settings name."] + #[serde( + rename = "testSettingsName", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_settings_name: Option<String>, } impl TestSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a sub result of a test result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSubResult { - #[doc = "Comment in sub result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Time when test execution completed(UTC)."] - #[serde( - rename = "completedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub completed_date: Option<time::OffsetDateTime>, - #[doc = "Machine where test executed."] - #[serde( - rename = "computerName", - default, - skip_serializing_if = "Option::is_none" - )] - pub computer_name: Option<String>, - #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option<ShallowReference>, - #[doc = "Additional properties of sub result."] - #[serde( - rename = "customFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub custom_fields: Vec<CustomTestField>, - #[doc = "Name of sub result."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "Duration of test execution."] - #[serde( - rename = "durationInMs", - default, - skip_serializing_if = "Option::is_none" - )] - pub duration_in_ms: Option<i64>, - #[doc = "Error message in sub result."] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "ID of sub result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Time when result last updated(UTC)."] - #[serde( - rename = "lastUpdatedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated_date: Option<time::OffsetDateTime>, - #[doc = "Outcome of sub result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outcome: Option<String>, - #[doc = "Immediate parent ID of sub result."] - #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option<i32>, - #[doc = "Hierarchy type of the result, default value of None means its leaf node."] - #[serde( - rename = "resultGroupType", - default, - skip_serializing_if = "Option::is_none" - )] - pub result_group_type: Option<test_sub_result::ResultGroupType>, - #[doc = "Index number of sub result."] - #[serde( - rename = "sequenceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub sequence_id: Option<i32>, - #[doc = "Stacktrace."] - #[serde( - rename = "stackTrace", - default, - skip_serializing_if = "Option::is_none" - )] - pub stack_trace: Option<String>, - #[doc = "Time when test execution started(UTC)."] - #[serde( - rename = "startedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub started_date: Option<time::OffsetDateTime>, - #[doc = "List of sub results inside a sub result, if ResultGroupType is not None, it holds corresponding type sub results."] - #[serde( - rename = "subResults", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub sub_results: Vec<TestSubResult>, - #[doc = "Reference to a test result."] - #[serde( - rename = "testResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub test_result: Option<TestCaseResultIdentifier>, - #[doc = "Url of sub result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Comment in sub result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Time when test execution completed(UTC)."] + #[serde( + rename = "completedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub completed_date: Option<time::OffsetDateTime>, + #[doc = "Machine where test executed."] + #[serde( + rename = "computerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub computer_name: Option<String>, + #[doc = "An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option<ShallowReference>, + #[doc = "Additional properties of sub result."] + #[serde( + rename = "customFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub custom_fields: Vec<CustomTestField>, + #[doc = "Name of sub result."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "Duration of test execution."] + #[serde( + rename = "durationInMs", + default, + skip_serializing_if = "Option::is_none" + )] + pub duration_in_ms: Option<i64>, + #[doc = "Error message in sub result."] + #[serde( + rename = "errorMessage", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_message: Option<String>, + #[doc = "ID of sub result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Time when result last updated(UTC)."] + #[serde( + rename = "lastUpdatedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_updated_date: Option<time::OffsetDateTime>, + #[doc = "Outcome of sub result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option<String>, + #[doc = "Immediate parent ID of sub result."] + #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option<i32>, + #[doc = "Hierarchy type of the result, default value of None means its leaf node."] + #[serde( + rename = "resultGroupType", + default, + skip_serializing_if = "Option::is_none" + )] + pub result_group_type: Option<test_sub_result::ResultGroupType>, + #[doc = "Index number of sub result."] + #[serde( + rename = "sequenceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub sequence_id: Option<i32>, + #[doc = "Stacktrace."] + #[serde( + rename = "stackTrace", + default, + skip_serializing_if = "Option::is_none" + )] + pub stack_trace: Option<String>, + #[doc = "Time when test execution started(UTC)."] + #[serde( + rename = "startedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub started_date: Option<time::OffsetDateTime>, + #[doc = "List of sub results inside a sub result, if ResultGroupType is not None, it holds corresponding type sub results."] + #[serde( + rename = "subResults", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub sub_results: Vec<TestSubResult>, + #[doc = "Reference to a test result."] + #[serde( + rename = "testResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub test_result: Option<TestCaseResultIdentifier>, + #[doc = "Url of sub result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TestSubResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod test_sub_result { - use super::*; - #[doc = "Hierarchy type of the result, default value of None means its leaf node."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ResultGroupType { - #[serde(rename = "none")] - None, - #[serde(rename = "rerun")] - Rerun, - #[serde(rename = "dataDriven")] - DataDriven, - #[serde(rename = "orderedTest")] - OrderedTest, - #[serde(rename = "generic")] - Generic, - } + use super::*; + #[doc = "Hierarchy type of the result, default value of None means its leaf node."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ResultGroupType { + #[serde(rename = "none")] + None, + #[serde(rename = "rerun")] + Rerun, + #[serde(rename = "dataDriven")] + DataDriven, + #[serde(rename = "orderedTest")] + OrderedTest, + #[serde(rename = "generic")] + Generic, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestSummaryForWorkItem { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub summary: Option<AggregatedDataForResultTrend>, - #[doc = "WorkItem reference Details."] - #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] - pub work_item: Option<WorkItemReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub summary: Option<AggregatedDataForResultTrend>, + #[doc = "WorkItem reference Details."] + #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] + pub work_item: Option<WorkItemReference>, } impl TestSummaryForWorkItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Tag attached to a run or result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestTag { - #[doc = "Name of the tag, alphanumeric value less than 30 chars"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Name of the tag, alphanumeric value less than 30 chars"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl TestTag { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Test tag summary for build or release grouped by test run."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestTagSummary { - #[doc = "Dictionary which contains tags associated with a test run."] - #[serde( - rename = "tagsGroupByTestArtifact", - default, - skip_serializing_if = "Option::is_none" - )] - pub tags_group_by_test_artifact: Option<serde_json::Value>, + #[doc = "Dictionary which contains tags associated with a test run."] + #[serde( + rename = "tagsGroupByTestArtifact", + default, + skip_serializing_if = "Option::is_none" + )] + pub tags_group_by_test_artifact: Option<serde_json::Value>, } impl TestTagSummary { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Tags to update to a run or result."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestTagsUpdateModel { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tags: Vec<serde_json::Value>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tags: Vec<serde_json::Value>, } impl TestTagsUpdateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TestToWorkItemLinks { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub test: Option<TestMethod>, - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<WorkItemReference>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub test: Option<TestMethod>, + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<WorkItemReference>, } impl TestToWorkItemLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "WorkItem reference Details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemReference { - #[doc = "WorkItem Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "WorkItem Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "WorkItem Type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "WorkItem Url. Valid Values : (Bug, Task, User Story, Test Case)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "WorkItem WebUrl."] - #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] - pub web_url: Option<String>, + #[doc = "WorkItem Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "WorkItem Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "WorkItem Type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "WorkItem Url. Valid Values : (Bug, Task, User Story, Test Case)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "WorkItem WebUrl."] + #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] + pub web_url: Option<String>, } impl WorkItemReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemToTestLinks { - #[serde( - rename = "executedIn", - default, - skip_serializing_if = "Option::is_none" - )] - pub executed_in: Option<work_item_to_test_links::ExecutedIn>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tests: Vec<TestMethod>, - #[doc = "WorkItem reference Details."] - #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] - pub work_item: Option<WorkItemReference>, + #[serde( + rename = "executedIn", + default, + skip_serializing_if = "Option::is_none" + )] + pub executed_in: Option<work_item_to_test_links::ExecutedIn>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tests: Vec<TestMethod>, + #[doc = "WorkItem reference Details."] + #[serde(rename = "workItem", default, skip_serializing_if = "Option::is_none")] + pub work_item: Option<WorkItemReference>, } impl WorkItemToTestLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod work_item_to_test_links { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ExecutedIn { - #[serde(rename = "any")] - Any, - #[serde(rename = "tcm")] - Tcm, - #[serde(rename = "tfs")] - Tfs, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ExecutedIn { + #[serde(rename = "any")] + Any, + #[serde(rename = "tcm")] + Tcm, + #[serde(rename = "tfs")] + Tfs, + } } diff --git a/azure_devops_rust_api/src/tfvc/mod.rs b/azure_devops_rust_api/src/tfvc/mod.rs index d7bbd9fb..0a840ec2 100644 --- a/azure_devops_rust_api/src/tfvc/mod.rs +++ b/azure_devops_rust_api/src/tfvc/mod.rs @@ -9,3704 +9,3694 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + 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()) + } +} +pub mod shelvesets { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Return a collection of shallow shelveset references."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> 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 = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + #[doc = "Get a single deep shelveset."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `shelveset_id`: Shelveset's unique ID"] + pub fn get( + &self, + organization: impl Into<String>, + shelveset_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `shelveset_id`: Shelveset's unique ID"] + pub fn get_shelveset_changes( + &self, + organization: impl Into<String>, + shelveset_id: impl Into<String>, + ) -> 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 = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); + #[doc = "Get work items associated with a shelveset."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `shelveset_id`: Shelveset's unique ID"] + pub fn get_shelveset_work_items( + &self, + organization: impl Into<String>, + shelveset_id: impl Into<String>, + ) -> get_shelveset_work_items::RequestBuilder { + get_shelveset_work_items::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + shelveset_id: shelveset_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcShelvesetRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcShelvesetRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) request_data_include_details: Option<bool>, + pub(crate) request_data_include_links: Option<bool>, + pub(crate) request_data_include_work_items: Option<bool>, + pub(crate) request_data_max_change_count: Option<i32>, + pub(crate) request_data_max_comment_length: Option<i32>, + pub(crate) request_data_name: Option<String>, + pub(crate) request_data_owner: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + } + 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, request_data_include_details: bool) -> Self { + self.request_data_include_details = Some(request_data_include_details); + self + } + #[doc = "Whether to include the _links field on the shallow references. Does not apply when requesting a single deep shelveset object. Links will always be included in the deep shelveset."] + pub fn request_data_include_links(mut self, request_data_include_links: bool) -> Self { + self.request_data_include_links = Some(request_data_include_links); + self + } + #[doc = "Whether to include workItems"] + pub fn request_data_include_work_items( + mut self, + request_data_include_work_items: bool, + ) -> Self { + self.request_data_include_work_items = Some(request_data_include_work_items); + self + } + #[doc = "Max number of changes to include"] + pub fn request_data_max_change_count(mut self, request_data_max_change_count: i32) -> Self { + self.request_data_max_change_count = Some(request_data_max_change_count); self + } + #[doc = "Max length of comment"] + pub fn request_data_max_comment_length( + mut self, + request_data_max_comment_length: i32, + ) -> Self { + self.request_data_max_comment_length = Some(request_data_max_comment_length); + self + } + #[doc = "Shelveset name"] + pub fn request_data_name(mut self, request_data_name: impl Into<String>) -> Self { + self.request_data_name = Some(request_data_name.into()); + self + } + #[doc = "Owner's ID. Could be a name or a guid."] + pub fn request_data_owner(mut self, request_data_owner: impl Into<String>) -> Self { + self.request_data_owner = Some(request_data_owner.into()); + self + } + #[doc = "Max number of shelvesets to return"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of shelvesets to skip"] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tfvc/shelvesets?", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcShelvesetRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcShelvesetRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcShelveset> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcShelveset = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) shelveset_id: String, + pub(crate) request_data_include_details: Option<bool>, + pub(crate) request_data_include_links: Option<bool>, + pub(crate) request_data_include_work_items: Option<bool>, + pub(crate) request_data_max_change_count: Option<i32>, + pub(crate) request_data_max_comment_length: Option<i32>, + pub(crate) request_data_name: Option<String>, + pub(crate) request_data_owner: Option<String>, + } + 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, request_data_include_details: bool) -> Self { + self.request_data_include_details = Some(request_data_include_details); + self + } + #[doc = "Whether to include the _links field on the shallow references. Does not apply when requesting a single deep shelveset object. Links will always be included in the deep shelveset."] + pub fn request_data_include_links(mut self, request_data_include_links: bool) -> Self { + self.request_data_include_links = Some(request_data_include_links); + self + } + #[doc = "Whether to include workItems"] + pub fn request_data_include_work_items( + mut self, + request_data_include_work_items: bool, + ) -> Self { + self.request_data_include_work_items = Some(request_data_include_work_items); + self + } + #[doc = "Max number of changes to include"] + pub fn request_data_max_change_count(mut self, request_data_max_change_count: i32) -> Self { + self.request_data_max_change_count = Some(request_data_max_change_count); + self + } + #[doc = "Max length of comment"] + pub fn request_data_max_comment_length( mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + request_data_max_comment_length: i32, + ) -> Self { + self.request_data_max_comment_length = Some(request_data_max_comment_length); self + } + #[doc = "Shelveset name"] + pub fn request_data_name(mut self, request_data_name: impl Into<String>) -> Self { + self.request_data_name = Some(request_data_name.into()); + self + } + #[doc = "Owner's ID. Could be a name or a guid."] + pub fn request_data_owner(mut self, request_data_owner: impl Into<String>) -> Self { + self.request_data_owner = Some(request_data_owner.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tfvc/shelvesets", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcShelveset>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcShelveset>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) + } + pub mod get_shelveset_changes { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcChangeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcChangeList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod shelvesets { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) shelveset_id: String, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + } + impl RequestBuilder { + #[doc = "Max number of changes to return"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of changes to skip"] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tfvc/shelvesets/changes", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcChangeList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcChangeList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_shelveset_work_items { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Return a collection of shallow shelveset references."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `shelveset_id`: Shelveset's unique ID"] - pub fn get( - &self, - organization: impl Into<String>, - shelveset_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `shelveset_id`: Shelveset's unique ID"] - pub fn get_shelveset_changes( - &self, - organization: impl Into<String>, - shelveset_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `shelveset_id`: Shelveset's unique ID"] - pub fn get_shelveset_work_items( - &self, - organization: impl Into<String>, - shelveset_id: impl Into<String>, - ) -> get_shelveset_work_items::RequestBuilder { - get_shelveset_work_items::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - shelveset_id: shelveset_id.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcShelvesetRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcShelvesetRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) request_data_include_details: Option<bool>, - pub(crate) request_data_include_links: Option<bool>, - pub(crate) request_data_include_work_items: Option<bool>, - pub(crate) request_data_max_change_count: Option<i32>, - pub(crate) request_data_max_comment_length: Option<i32>, - pub(crate) request_data_name: Option<String>, - pub(crate) request_data_owner: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - } - 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, - request_data_include_details: bool, - ) -> Self { - self.request_data_include_details = Some(request_data_include_details); - self - } - #[doc = "Whether to include the _links field on the shallow references. Does not apply when requesting a single deep shelveset object. Links will always be included in the deep shelveset."] - pub fn request_data_include_links(mut self, request_data_include_links: bool) -> Self { - self.request_data_include_links = Some(request_data_include_links); - self - } - #[doc = "Whether to include workItems"] - pub fn request_data_include_work_items( - mut self, - request_data_include_work_items: bool, - ) -> Self { - self.request_data_include_work_items = Some(request_data_include_work_items); - self - } - #[doc = "Max number of changes to include"] - pub fn request_data_max_change_count( - mut self, - request_data_max_change_count: i32, - ) -> Self { - self.request_data_max_change_count = Some(request_data_max_change_count); - self - } - #[doc = "Max length of comment"] - pub fn request_data_max_comment_length( - mut self, - request_data_max_comment_length: i32, - ) -> Self { - self.request_data_max_comment_length = Some(request_data_max_comment_length); - self - } - #[doc = "Shelveset name"] - pub fn request_data_name(mut self, request_data_name: impl Into<String>) -> Self { - self.request_data_name = Some(request_data_name.into()); - self - } - #[doc = "Owner's ID. Could be a name or a guid."] - pub fn request_data_owner(mut self, request_data_owner: impl Into<String>) -> Self { - self.request_data_owner = Some(request_data_owner.into()); - self - } - #[doc = "Max number of shelvesets to return"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of shelvesets to skip"] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tfvc/shelvesets?", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcShelvesetRefList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TfvcShelvesetRefList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcShelveset> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcShelveset = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) shelveset_id: String, - pub(crate) request_data_include_details: Option<bool>, - pub(crate) request_data_include_links: Option<bool>, - pub(crate) request_data_include_work_items: Option<bool>, - pub(crate) request_data_max_change_count: Option<i32>, - pub(crate) request_data_max_comment_length: Option<i32>, - pub(crate) request_data_name: Option<String>, - pub(crate) request_data_owner: Option<String>, - } - 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, - request_data_include_details: bool, - ) -> Self { - self.request_data_include_details = Some(request_data_include_details); - self - } - #[doc = "Whether to include the _links field on the shallow references. Does not apply when requesting a single deep shelveset object. Links will always be included in the deep shelveset."] - pub fn request_data_include_links(mut self, request_data_include_links: bool) -> Self { - self.request_data_include_links = Some(request_data_include_links); - self - } - #[doc = "Whether to include workItems"] - pub fn request_data_include_work_items( - mut self, - request_data_include_work_items: bool, - ) -> Self { - self.request_data_include_work_items = Some(request_data_include_work_items); - self - } - #[doc = "Max number of changes to include"] - pub fn request_data_max_change_count( - mut self, - request_data_max_change_count: i32, - ) -> Self { - self.request_data_max_change_count = Some(request_data_max_change_count); - self - } - #[doc = "Max length of comment"] - pub fn request_data_max_comment_length( - mut self, - request_data_max_comment_length: i32, - ) -> Self { - self.request_data_max_comment_length = Some(request_data_max_comment_length); - self - } - #[doc = "Shelveset name"] - pub fn request_data_name(mut self, request_data_name: impl Into<String>) -> Self { - self.request_data_name = Some(request_data_name.into()); - self - } - #[doc = "Owner's ID. Could be a name or a guid."] - pub fn request_data_owner(mut self, request_data_owner: impl Into<String>) -> Self { - self.request_data_owner = Some(request_data_owner.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tfvc/shelvesets", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcShelveset>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcShelveset>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_shelveset_changes { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcChangeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcChangeList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) shelveset_id: String, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - } - impl RequestBuilder { - #[doc = "Max number of changes to return"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of changes to skip"] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tfvc/shelvesets/changes", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcChangeList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcChangeList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_shelveset_work_items { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AssociatedWorkItemList> { - let bytes = self.0.into_body().collect().await?; - let body: models::AssociatedWorkItemList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) shelveset_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tfvc/shelvesets/workitems", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let shelveset_id = &this.shelveset_id; - req.url_mut() - .query_pairs_mut() - .append_pair("shelvesetId", shelveset_id); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AssociatedWorkItemList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::AssociatedWorkItemList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AssociatedWorkItemList> { + let bytes = self.0.into_body().collect().await?; + let body: models::AssociatedWorkItemList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) shelveset_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tfvc/shelvesets/workitems", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let shelveset_id = &this.shelveset_id; + req + .url_mut() + .query_pairs_mut() + .append_pair("shelvesetId", shelveset_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AssociatedWorkItemList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AssociatedWorkItemList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod branches { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `path`: Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + path: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_branches( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `scope_path`: Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_branch_refs( + &self, + organization: impl Into<String>, + scope_path: impl Into<String>, + project: impl Into<String>, + ) -> 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 get { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `path`: Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - path: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_branches( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `scope_path`: Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_branch_refs( - &self, - organization: impl Into<String>, - scope_path: impl Into<String>, - project: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcBranch> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcBranch = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) path: String, - pub(crate) project: String, - pub(crate) include_parent: Option<bool>, - pub(crate) include_children: Option<bool>, - } - 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); - self - } - #[doc = "Return child branches, if there are any. Default: False"] - pub fn include_children(mut self, include_children: bool) -> Self { - self.include_children = Some(include_children); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/branches?path={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.path - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcBranch>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcBranch>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_branches { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcBranchList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcBranchList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) include_parent: Option<bool>, - pub(crate) include_children: Option<bool>, - pub(crate) include_deleted: Option<bool>, - pub(crate) include_links: Option<bool>, - } - 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); - self - } - #[doc = "Return the child branches for each root branch. Default: False"] - pub fn include_children(mut self, include_children: bool) -> Self { - self.include_children = Some(include_children); - self - } - #[doc = "Return deleted branches. Default: False"] - pub fn include_deleted(mut self, include_deleted: bool) -> Self { - self.include_deleted = Some(include_deleted); - self - } - #[doc = "Return links. Default: False"] - pub fn include_links(mut self, include_links: bool) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/branches?", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcBranchList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcBranchList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_branch_refs { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcBranchRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcBranchRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) scope_path: String, - pub(crate) project: String, - pub(crate) include_deleted: Option<bool>, - pub(crate) include_links: Option<bool>, - } - impl RequestBuilder { - #[doc = "Return deleted branches. Default: False"] - pub fn include_deleted(mut self, include_deleted: bool) -> Self { - self.include_deleted = Some(include_deleted); - self - } - #[doc = "Return links. Default: False"] - pub fn include_links(mut self, include_links: bool) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/branches", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcBranchRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcBranchRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcBranch> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcBranch = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) path: String, + pub(crate) project: String, + pub(crate) include_parent: Option<bool>, + pub(crate) include_children: Option<bool>, + } + 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); + self + } + #[doc = "Return child branches, if there are any. Default: False"] + pub fn include_children(mut self, include_children: bool) -> Self { + self.include_children = Some(include_children); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/branches?path={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.path + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcBranch>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TfvcBranch>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_branches { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcBranchList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcBranchList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) include_parent: Option<bool>, + pub(crate) include_children: Option<bool>, + pub(crate) include_deleted: Option<bool>, + pub(crate) include_links: Option<bool>, + } + 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); + self + } + #[doc = "Return the child branches for each root branch. Default: False"] + pub fn include_children(mut self, include_children: bool) -> Self { + self.include_children = Some(include_children); + self + } + #[doc = "Return deleted branches. Default: False"] + pub fn include_deleted(mut self, include_deleted: bool) -> Self { + self.include_deleted = Some(include_deleted); + self + } + #[doc = "Return links. Default: False"] + pub fn include_links(mut self, include_links: bool) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/branches?", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcBranchList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcBranchList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_branch_refs { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcBranchRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcBranchRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) scope_path: String, + pub(crate) project: String, + pub(crate) include_deleted: Option<bool>, + pub(crate) include_links: Option<bool>, + } + impl RequestBuilder { + #[doc = "Return deleted branches. Default: False"] + pub fn include_deleted(mut self, include_deleted: bool) -> Self { + self.include_deleted = Some(include_deleted); + self + } + #[doc = "Return links. Default: False"] + pub fn include_links(mut self, include_links: bool) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/branches", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcBranchRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcBranchRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod items { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `path`: Version control path of an individual item to return."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + path: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_items_batch( + &self, + organization: impl Into<String>, + body: impl Into<models::TfvcItemRequestData>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 get { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `path`: Version control path of an individual item to return."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - path: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_items_batch( - &self, - organization: impl Into<String>, - body: impl Into<models::TfvcItemRequestData>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcItem> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) path: String, - pub(crate) project: String, - pub(crate) file_name: Option<String>, - pub(crate) download: Option<bool>, - pub(crate) scope_path: Option<String>, - pub(crate) recursion_level: Option<String>, - pub(crate) version_descriptor_version: Option<String>, - pub(crate) version_descriptor_version_option: Option<String>, - pub(crate) version_descriptor_version_type: Option<String>, - pub(crate) include_content: Option<bool>, - } - impl RequestBuilder { - #[doc = "File name of item returned."] - pub fn file_name(mut self, file_name: impl Into<String>) -> Self { - self.file_name = Some(file_name.into()); - self - } - #[doc = "If true, create a downloadable attachment."] - pub fn download(mut self, download: bool) -> Self { - self.download = Some(download); - self - } - #[doc = "Version control path of a folder to return multiple items."] - pub fn scope_path(mut self, scope_path: impl Into<String>) -> Self { - self.scope_path = Some(scope_path.into()); - self - } - #[doc = "None (just the item), or OneLevel (contents of a folder)."] - pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self { - self.recursion_level = Some(recursion_level.into()); - self - } - #[doc = "Version object."] - pub fn version_descriptor_version( - mut self, - version_descriptor_version: impl Into<String>, - ) -> Self { - self.version_descriptor_version = Some(version_descriptor_version.into()); - self - } - #[doc = "Version descriptor. Default is null."] - pub fn version_descriptor_version_option( - mut self, - version_descriptor_version_option: impl Into<String>, - ) -> Self { - self.version_descriptor_version_option = - Some(version_descriptor_version_option.into()); - self - } - #[doc = "Version descriptor. Default is null."] - pub fn version_descriptor_version_type( - mut self, - version_descriptor_version_type: impl Into<String>, - ) -> Self { - self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); - self - } - #[doc = "Set to true to include item content when requesting json. Default is false."] - pub fn include_content(mut self, include_content: bool) -> Self { - self.include_content = Some(include_content); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/items?path={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.path - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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, - ); - } - 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, - ); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcItem>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcItem>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_items_batch { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<Vec<String>> { - let bytes = self.0.into_body().collect().await?; - let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TfvcItemRequestData, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/itembatch", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<Vec<String>>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcItemList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcItemList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) scope_path: Option<String>, - pub(crate) recursion_level: Option<String>, - pub(crate) include_links: Option<bool>, - pub(crate) version_descriptor_version: Option<String>, - pub(crate) version_descriptor_version_option: Option<String>, - pub(crate) version_descriptor_version_type: Option<String>, - } - impl RequestBuilder { - #[doc = "Version control path of a folder to return multiple items."] - pub fn scope_path(mut self, scope_path: impl Into<String>) -> Self { - self.scope_path = Some(scope_path.into()); - self - } - #[doc = "None (just the item), or OneLevel (contents of a folder)."] - pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self { - self.recursion_level = Some(recursion_level.into()); - self - } - #[doc = "Set to true to include links."] - pub fn include_links(mut self, include_links: bool) -> Self { - self.include_links = Some(include_links); - self - } - #[doc = "Version object."] - pub fn version_descriptor_version( - mut self, - version_descriptor_version: impl Into<String>, - ) -> Self { - self.version_descriptor_version = Some(version_descriptor_version.into()); - self - } - pub fn version_descriptor_version_option( - mut self, - version_descriptor_version_option: impl Into<String>, - ) -> Self { - self.version_descriptor_version_option = - Some(version_descriptor_version_option.into()); - self - } - pub fn version_descriptor_version_type( - mut self, - version_descriptor_version_type: impl Into<String>, - ) -> Self { - self.version_descriptor_version_type = Some(version_descriptor_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/items", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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, - ); - } - 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, - ); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcItemList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcItemList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcItem> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcItem = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) path: String, + pub(crate) project: String, + pub(crate) file_name: Option<String>, + pub(crate) download: Option<bool>, + pub(crate) scope_path: Option<String>, + pub(crate) recursion_level: Option<String>, + pub(crate) version_descriptor_version: Option<String>, + pub(crate) version_descriptor_version_option: Option<String>, + pub(crate) version_descriptor_version_type: Option<String>, + pub(crate) include_content: Option<bool>, + } + impl RequestBuilder { + #[doc = "File name of item returned."] + pub fn file_name(mut self, file_name: impl Into<String>) -> Self { + self.file_name = Some(file_name.into()); + self + } + #[doc = "If true, create a downloadable attachment."] + pub fn download(mut self, download: bool) -> Self { + self.download = Some(download); + self + } + #[doc = "Version control path of a folder to return multiple items."] + pub fn scope_path(mut self, scope_path: impl Into<String>) -> Self { + self.scope_path = Some(scope_path.into()); + self + } + #[doc = "None (just the item), or OneLevel (contents of a folder)."] + pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self { + self.recursion_level = Some(recursion_level.into()); + self + } + #[doc = "Version object."] + pub fn version_descriptor_version( + mut self, + version_descriptor_version: impl Into<String>, + ) -> Self { + self.version_descriptor_version = Some(version_descriptor_version.into()); + self + } + #[doc = "Version descriptor. Default is null."] + pub fn version_descriptor_version_option( + mut self, + version_descriptor_version_option: impl Into<String>, + ) -> Self { + self.version_descriptor_version_option = Some(version_descriptor_version_option.into()); + self + } + #[doc = "Version descriptor. Default is null."] + pub fn version_descriptor_version_type( + mut self, + version_descriptor_version_type: impl Into<String>, + ) -> Self { + self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); + self + } + #[doc = "Set to true to include item content when requesting json. Default is false."] + pub fn include_content(mut self, include_content: bool) -> Self { + self.include_content = Some(include_content); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/items?path={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.path + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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, + ); + } + 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, + ); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcItem>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TfvcItem>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_items_batch { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<Vec<String>> { + let bytes = self.0.into_body().collect().await?; + let body: Vec<String> = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TfvcItemRequestData, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/itembatch", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<Vec<String>>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<Vec<String>>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcItemList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcItemList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) scope_path: Option<String>, + pub(crate) recursion_level: Option<String>, + pub(crate) include_links: Option<bool>, + pub(crate) version_descriptor_version: Option<String>, + pub(crate) version_descriptor_version_option: Option<String>, + pub(crate) version_descriptor_version_type: Option<String>, + } + impl RequestBuilder { + #[doc = "Version control path of a folder to return multiple items."] + pub fn scope_path(mut self, scope_path: impl Into<String>) -> Self { + self.scope_path = Some(scope_path.into()); + self + } + #[doc = "None (just the item), or OneLevel (contents of a folder)."] + pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self { + self.recursion_level = Some(recursion_level.into()); + self + } + #[doc = "Set to true to include links."] + pub fn include_links(mut self, include_links: bool) -> Self { + self.include_links = Some(include_links); + self + } + #[doc = "Version object."] + pub fn version_descriptor_version( + mut self, + version_descriptor_version: impl Into<String>, + ) -> Self { + self.version_descriptor_version = Some(version_descriptor_version.into()); + self + } + pub fn version_descriptor_version_option( + mut self, + version_descriptor_version_option: impl Into<String>, + ) -> Self { + self.version_descriptor_version_option = Some(version_descriptor_version_option.into()); + self + } + pub fn version_descriptor_version_type( + mut self, + version_descriptor_version_type: impl Into<String>, + ) -> Self { + self.version_descriptor_version_type = Some(version_descriptor_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/items", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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, + ); + } + 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, + ); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcItemList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcItemList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } pub mod changesets { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve Tfvc changes for a given changeset."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: ID of the changeset. Default: null"] + pub fn get_changeset_changes( + &self, + organization: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: ID of the changeset."] + pub fn get_changeset_work_items( + &self, + organization: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: List of changeset IDs."] + pub fn get_batched_changesets( + &self, + organization: impl Into<String>, + body: impl Into<models::TfvcChangesetsRequestData>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_changesets( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::TfvcChangeset>, + project: impl Into<String>, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Retrieve a Tfvc Changeset"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: Changeset Id to retrieve."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + id: i32, + project: impl Into<String>, + ) -> 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 get_changeset_changes { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcChangeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcChangeList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) id: i32, + pub(crate) skip: Option<i32>, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + } + impl RequestBuilder { + #[doc = "Number of results to skip. Default: null"] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "The maximum number of results to return. Default: null"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Return the next page of results. Default: null"] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tfvc/changesets/{}/changes", + this.client.endpoint(), + &this.organization, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcChangeList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcChangeList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_changeset_work_items { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AssociatedWorkItemList> { + let bytes = self.0.into_body().collect().await?; + let body: models::AssociatedWorkItemList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tfvc/changesets/{}/workItems", + this.client.endpoint(), + &this.organization, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AssociatedWorkItemList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AssociatedWorkItemList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_batched_changesets { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcChangesetRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcChangesetRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tfvc/changesetsbatch", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcChangesetRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcChangesetRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_changesets { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcChangesetRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcChangesetRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) max_comment_length: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) top: Option<i32>, + pub(crate) orderby: Option<String>, + pub(crate) search_criteria_author: Option<String>, + pub(crate) search_criteria_follow_renames: Option<bool>, + pub(crate) search_criteria_from_date: Option<String>, + pub(crate) search_criteria_from_id: Option<i32>, + pub(crate) search_criteria_include_links: Option<bool>, + pub(crate) search_criteria_item_path: Option<String>, + pub(crate) search_criteria_mappings: Vec<models::TfvcMappingFilter>, + pub(crate) search_criteria_to_date: Option<String>, + pub(crate) search_criteria_to_id: Option<i32>, + } + 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); + self + } + #[doc = "Number of results to skip. Default: null"] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "The maximum number of results to return. Default: null"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order."] + pub fn orderby(mut self, orderby: impl Into<String>) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Alias or display name of user who made the changes."] + pub fn search_criteria_author(mut self, search_criteria_author: impl Into<String>) -> Self { + self.search_criteria_author = Some(search_criteria_author.into()); + self + } + #[doc = "Whether or not to follow renames for the given item being queried."] + pub fn search_criteria_follow_renames( + mut self, + search_criteria_follow_renames: bool, + ) -> Self { + self.search_criteria_follow_renames = Some(search_criteria_follow_renames); + self + } + #[doc = "If provided, only include changesets created after this date (string)."] + pub fn search_criteria_from_date( + mut self, + search_criteria_from_date: impl Into<String>, + ) -> Self { + self.search_criteria_from_date = Some(search_criteria_from_date.into()); + self + } + #[doc = "If provided, only include changesets after this changesetID."] + pub fn search_criteria_from_id(mut self, search_criteria_from_id: i32) -> Self { + self.search_criteria_from_id = Some(search_criteria_from_id); + self + } + #[doc = "Whether to include the _links field on the shallow references."] + pub fn search_criteria_include_links(mut self, search_criteria_include_links: bool) -> Self { + self.search_criteria_include_links = Some(search_criteria_include_links); + self + } + #[doc = "Path of item to search under."] + pub fn search_criteria_item_path( + mut self, + search_criteria_item_path: impl Into<String>, + ) -> Self { + self.search_criteria_item_path = Some(search_criteria_item_path.into()); + self + } + #[doc = "Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null"] + pub fn search_criteria_mappings( + mut self, + search_criteria_mappings: Vec<models::TfvcMappingFilter>, + ) -> Self { + self.search_criteria_mappings = search_criteria_mappings; + self + } + #[doc = "If provided, only include changesets created before this date (string)."] + pub fn search_criteria_to_date(mut self, search_criteria_to_date: impl Into<String>) -> Self { + self.search_criteria_to_date = Some(search_criteria_to_date.into()); + self + } + #[doc = "If provided, a version descriptor for the latest change list to include."] + pub fn search_criteria_to_id(mut self, search_criteria_to_id: i32) -> Self { + self.search_criteria_to_id = Some(search_criteria_to_id); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/changesets", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcChangesetRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcChangesetRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcChangesetRef> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcChangesetRef = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TfvcChangeset, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/changesets", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcChangesetRef>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcChangesetRef>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve Tfvc changes for a given changeset."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: ID of the changeset. Default: null"] - pub fn get_changeset_changes( - &self, - organization: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: ID of the changeset."] - pub fn get_changeset_work_items( - &self, - organization: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: List of changeset IDs."] - pub fn get_batched_changesets( - &self, - organization: impl Into<String>, - body: impl Into<models::TfvcChangesetsRequestData>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_changesets( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::TfvcChangeset>, - project: impl Into<String>, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - #[doc = "Retrieve a Tfvc Changeset"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: Changeset Id to retrieve."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - id: i32, - project: impl Into<String>, - ) -> 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 get_changeset_changes { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcChangeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcChangeList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) id: i32, - pub(crate) skip: Option<i32>, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - } - impl RequestBuilder { - #[doc = "Number of results to skip. Default: null"] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "The maximum number of results to return. Default: null"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Return the next page of results. Default: null"] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tfvc/changesets/{}/changes", - this.client.endpoint(), - &this.organization, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcChangeList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcChangeList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_changeset_work_items { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AssociatedWorkItemList> { - let bytes = self.0.into_body().collect().await?; - let body: models::AssociatedWorkItemList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tfvc/changesets/{}/workItems", - this.client.endpoint(), - &this.organization, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AssociatedWorkItemList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::AssociatedWorkItemList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_batched_changesets { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcChangesetRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcChangesetRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tfvc/changesetsbatch", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcChangesetRefList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TfvcChangesetRefList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_changesets { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcChangesetRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcChangesetRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) max_comment_length: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) top: Option<i32>, - pub(crate) orderby: Option<String>, - pub(crate) search_criteria_author: Option<String>, - pub(crate) search_criteria_follow_renames: Option<bool>, - pub(crate) search_criteria_from_date: Option<String>, - pub(crate) search_criteria_from_id: Option<i32>, - pub(crate) search_criteria_include_links: Option<bool>, - pub(crate) search_criteria_item_path: Option<String>, - pub(crate) search_criteria_mappings: Vec<models::TfvcMappingFilter>, - pub(crate) search_criteria_to_date: Option<String>, - pub(crate) search_criteria_to_id: Option<i32>, - } - 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); - self - } - #[doc = "Number of results to skip. Default: null"] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "The maximum number of results to return. Default: null"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order."] - pub fn orderby(mut self, orderby: impl Into<String>) -> Self { - self.orderby = Some(orderby.into()); - self - } - #[doc = "Alias or display name of user who made the changes."] - pub fn search_criteria_author( - mut self, - search_criteria_author: impl Into<String>, - ) -> Self { - self.search_criteria_author = Some(search_criteria_author.into()); - self - } - #[doc = "Whether or not to follow renames for the given item being queried."] - pub fn search_criteria_follow_renames( - mut self, - search_criteria_follow_renames: bool, - ) -> Self { - self.search_criteria_follow_renames = Some(search_criteria_follow_renames); - self - } - #[doc = "If provided, only include changesets created after this date (string)."] - pub fn search_criteria_from_date( - mut self, - search_criteria_from_date: impl Into<String>, - ) -> Self { - self.search_criteria_from_date = Some(search_criteria_from_date.into()); - self - } - #[doc = "If provided, only include changesets after this changesetID."] - pub fn search_criteria_from_id(mut self, search_criteria_from_id: i32) -> Self { - self.search_criteria_from_id = Some(search_criteria_from_id); - self - } - #[doc = "Whether to include the _links field on the shallow references."] - pub fn search_criteria_include_links( - mut self, - search_criteria_include_links: bool, - ) -> Self { - self.search_criteria_include_links = Some(search_criteria_include_links); - self - } - #[doc = "Path of item to search under."] - pub fn search_criteria_item_path( - mut self, - search_criteria_item_path: impl Into<String>, - ) -> Self { - self.search_criteria_item_path = Some(search_criteria_item_path.into()); - self - } - #[doc = "Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null"] - pub fn search_criteria_mappings( - mut self, - search_criteria_mappings: Vec<models::TfvcMappingFilter>, - ) -> Self { - self.search_criteria_mappings = search_criteria_mappings; - self - } - #[doc = "If provided, only include changesets created before this date (string)."] - pub fn search_criteria_to_date( - mut self, - search_criteria_to_date: impl Into<String>, - ) -> Self { - self.search_criteria_to_date = Some(search_criteria_to_date.into()); - self - } - #[doc = "If provided, a version descriptor for the latest change list to include."] - pub fn search_criteria_to_id(mut self, search_criteria_to_id: i32) -> Self { - self.search_criteria_to_id = Some(search_criteria_to_id); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/changesets", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcChangesetRefList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TfvcChangesetRefList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcChangesetRef> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcChangesetRef = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TfvcChangeset, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/changesets", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcChangesetRef>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcChangesetRef>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcChangeset> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcChangeset = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) id: i32, - pub(crate) project: String, - pub(crate) max_change_count: Option<i32>, - pub(crate) include_details: Option<bool>, - pub(crate) include_work_items: Option<bool>, - pub(crate) max_comment_length: Option<i32>, - pub(crate) include_source_rename: Option<bool>, - pub(crate) skip: Option<i32>, - pub(crate) top: Option<i32>, - pub(crate) orderby: Option<String>, - pub(crate) search_criteria_author: Option<String>, - pub(crate) search_criteria_follow_renames: Option<bool>, - pub(crate) search_criteria_from_date: Option<String>, - pub(crate) search_criteria_from_id: Option<i32>, - pub(crate) search_criteria_include_links: Option<bool>, - pub(crate) search_criteria_item_path: Option<String>, - pub(crate) search_criteria_mappings: Vec<models::TfvcMappingFilter>, - pub(crate) search_criteria_to_date: Option<String>, - pub(crate) search_criteria_to_id: Option<i32>, - } - 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); - self - } - #[doc = "Include policy details and check-in notes in the response. Default: false"] - pub fn include_details(mut self, include_details: bool) -> Self { - self.include_details = Some(include_details); - self - } - #[doc = "Include workitems. Default: false"] - pub fn include_work_items(mut self, include_work_items: bool) -> Self { - self.include_work_items = Some(include_work_items); - self - } - #[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); - self - } - #[doc = "Include renames. Default: false"] - pub fn include_source_rename(mut self, include_source_rename: bool) -> Self { - self.include_source_rename = Some(include_source_rename); - self - } - #[doc = "Number of results to skip. Default: null"] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "The maximum number of results to return. Default: null"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order."] - pub fn orderby(mut self, orderby: impl Into<String>) -> Self { - self.orderby = Some(orderby.into()); - self - } - #[doc = "Alias or display name of user who made the changes."] - pub fn search_criteria_author( - mut self, - search_criteria_author: impl Into<String>, - ) -> Self { - self.search_criteria_author = Some(search_criteria_author.into()); - self - } - #[doc = "Whether or not to follow renames for the given item being queried."] - pub fn search_criteria_follow_renames( - mut self, - search_criteria_follow_renames: bool, - ) -> Self { - self.search_criteria_follow_renames = Some(search_criteria_follow_renames); - self - } - #[doc = "If provided, only include changesets created after this date (string)."] - pub fn search_criteria_from_date( - mut self, - search_criteria_from_date: impl Into<String>, - ) -> Self { - self.search_criteria_from_date = Some(search_criteria_from_date.into()); - self - } - #[doc = "If provided, only include changesets after this changesetID."] - pub fn search_criteria_from_id(mut self, search_criteria_from_id: i32) -> Self { - self.search_criteria_from_id = Some(search_criteria_from_id); - self - } - #[doc = "Whether to include the _links field on the shallow references."] - pub fn search_criteria_include_links( - mut self, - search_criteria_include_links: bool, - ) -> Self { - self.search_criteria_include_links = Some(search_criteria_include_links); - self - } - #[doc = "Path of item to search under."] - pub fn search_criteria_item_path( - mut self, - search_criteria_item_path: impl Into<String>, - ) -> Self { - self.search_criteria_item_path = Some(search_criteria_item_path.into()); - self - } - #[doc = "Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null"] - pub fn search_criteria_mappings( - mut self, - search_criteria_mappings: Vec<models::TfvcMappingFilter>, - ) -> Self { - self.search_criteria_mappings = search_criteria_mappings; - self - } - #[doc = "If provided, only include changesets created before this date (string)."] - pub fn search_criteria_to_date( - mut self, - search_criteria_to_date: impl Into<String>, - ) -> Self { - self.search_criteria_to_date = Some(search_criteria_to_date.into()); - self - } - #[doc = "If provided, a version descriptor for the latest change list to include."] - pub fn search_criteria_to_id(mut self, search_criteria_to_id: i32) -> Self { - self.search_criteria_to_id = Some(search_criteria_to_id); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/changesets/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcChangeset>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcChangeset>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcChangeset> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcChangeset = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) id: i32, + pub(crate) project: String, + pub(crate) max_change_count: Option<i32>, + pub(crate) include_details: Option<bool>, + pub(crate) include_work_items: Option<bool>, + pub(crate) max_comment_length: Option<i32>, + pub(crate) include_source_rename: Option<bool>, + pub(crate) skip: Option<i32>, + pub(crate) top: Option<i32>, + pub(crate) orderby: Option<String>, + pub(crate) search_criteria_author: Option<String>, + pub(crate) search_criteria_follow_renames: Option<bool>, + pub(crate) search_criteria_from_date: Option<String>, + pub(crate) search_criteria_from_id: Option<i32>, + pub(crate) search_criteria_include_links: Option<bool>, + pub(crate) search_criteria_item_path: Option<String>, + pub(crate) search_criteria_mappings: Vec<models::TfvcMappingFilter>, + pub(crate) search_criteria_to_date: Option<String>, + pub(crate) search_criteria_to_id: Option<i32>, } + 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); + self + } + #[doc = "Include policy details and check-in notes in the response. Default: false"] + pub fn include_details(mut self, include_details: bool) -> Self { + self.include_details = Some(include_details); + self + } + #[doc = "Include workitems. Default: false"] + pub fn include_work_items(mut self, include_work_items: bool) -> Self { + self.include_work_items = Some(include_work_items); + self + } + #[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); + self + } + #[doc = "Include renames. Default: false"] + pub fn include_source_rename(mut self, include_source_rename: bool) -> Self { + self.include_source_rename = Some(include_source_rename); + self + } + #[doc = "Number of results to skip. Default: null"] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "The maximum number of results to return. Default: null"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order."] + pub fn orderby(mut self, orderby: impl Into<String>) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Alias or display name of user who made the changes."] + pub fn search_criteria_author(mut self, search_criteria_author: impl Into<String>) -> Self { + self.search_criteria_author = Some(search_criteria_author.into()); + self + } + #[doc = "Whether or not to follow renames for the given item being queried."] + pub fn search_criteria_follow_renames( + mut self, + search_criteria_follow_renames: bool, + ) -> Self { + self.search_criteria_follow_renames = Some(search_criteria_follow_renames); + self + } + #[doc = "If provided, only include changesets created after this date (string)."] + pub fn search_criteria_from_date( + mut self, + search_criteria_from_date: impl Into<String>, + ) -> Self { + self.search_criteria_from_date = Some(search_criteria_from_date.into()); + self + } + #[doc = "If provided, only include changesets after this changesetID."] + pub fn search_criteria_from_id(mut self, search_criteria_from_id: i32) -> Self { + self.search_criteria_from_id = Some(search_criteria_from_id); + self + } + #[doc = "Whether to include the _links field on the shallow references."] + pub fn search_criteria_include_links(mut self, search_criteria_include_links: bool) -> Self { + self.search_criteria_include_links = Some(search_criteria_include_links); + self + } + #[doc = "Path of item to search under."] + pub fn search_criteria_item_path( + mut self, + search_criteria_item_path: impl Into<String>, + ) -> Self { + self.search_criteria_item_path = Some(search_criteria_item_path.into()); + self + } + #[doc = "Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null"] + pub fn search_criteria_mappings( + mut self, + search_criteria_mappings: Vec<models::TfvcMappingFilter>, + ) -> Self { + self.search_criteria_mappings = search_criteria_mappings; + self + } + #[doc = "If provided, only include changesets created before this date (string)."] + pub fn search_criteria_to_date(mut self, search_criteria_to_date: impl Into<String>) -> Self { + self.search_criteria_to_date = Some(search_criteria_to_date.into()); + self + } + #[doc = "If provided, a version descriptor for the latest change list to include."] + pub fn search_criteria_to_id(mut self, search_criteria_to_id: i32) -> Self { + self.search_criteria_to_id = Some(search_criteria_to_id); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/changesets/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcChangeset>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcChangeset>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod labels { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get items under a label."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `label_id`: Unique identifier of label"] + pub fn get_label_items( + &self, + organization: impl Into<String>, + label_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `label_id`: Unique identifier of label"] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + label_id: impl Into<String>, + project: impl Into<String>, + ) -> 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, + } + } + } + pub mod get_label_items { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get items under a label."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `label_id`: Unique identifier of label"] - pub fn get_label_items( - &self, - organization: impl Into<String>, - label_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `label_id`: Unique identifier of label"] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - label_id: impl Into<String>, - project: impl Into<String>, - ) -> 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, - } - } - } - pub mod get_label_items { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcItemList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcItemList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) label_id: String, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - } - impl RequestBuilder { - #[doc = "Max number of items to return"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of items to skip"] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tfvc/labels/{}/items", - this.client.endpoint(), - &this.organization, - &this.label_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcItemList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcItemList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcLabelRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcLabelRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) request_data_include_links: Option<bool>, - pub(crate) request_data_item_label_filter: Option<String>, - pub(crate) request_data_label_scope: Option<String>, - pub(crate) request_data_max_item_count: Option<i32>, - pub(crate) request_data_name: Option<String>, - pub(crate) request_data_owner: Option<String>, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - } - 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); - self - } - #[doc = "labelScope, name, owner, and itemLabelFilter"] - pub fn request_data_item_label_filter( - mut self, - request_data_item_label_filter: impl Into<String>, - ) -> Self { - self.request_data_item_label_filter = Some(request_data_item_label_filter.into()); - self - } - #[doc = "labelScope, name, owner, and itemLabelFilter"] - pub fn request_data_label_scope( - mut self, - request_data_label_scope: impl Into<String>, - ) -> Self { - self.request_data_label_scope = Some(request_data_label_scope.into()); - self - } - #[doc = "labelScope, name, owner, and itemLabelFilter"] - pub fn request_data_max_item_count(mut self, request_data_max_item_count: i32) -> Self { - self.request_data_max_item_count = Some(request_data_max_item_count); - self - } - #[doc = "labelScope, name, owner, and itemLabelFilter"] - pub fn request_data_name(mut self, request_data_name: impl Into<String>) -> Self { - self.request_data_name = Some(request_data_name.into()); - self - } - #[doc = "labelScope, name, owner, and itemLabelFilter"] - pub fn request_data_owner(mut self, request_data_owner: impl Into<String>) -> Self { - self.request_data_owner = Some(request_data_owner.into()); - self - } - #[doc = "Max number of labels to return, defaults to 100 when undefined"] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of labels to skip"] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/labels", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcLabelRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcLabelRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TfvcLabel> { - let bytes = self.0.into_body().collect().await?; - let body: models::TfvcLabel = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) label_id: String, - pub(crate) project: String, - pub(crate) request_data_include_links: Option<bool>, - pub(crate) request_data_item_label_filter: Option<String>, - pub(crate) request_data_label_scope: Option<String>, - pub(crate) request_data_max_item_count: Option<i32>, - pub(crate) request_data_name: Option<String>, - pub(crate) request_data_owner: Option<String>, - } - 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); - self - } - #[doc = "maxItemCount"] - pub fn request_data_item_label_filter( - mut self, - request_data_item_label_filter: impl Into<String>, - ) -> Self { - self.request_data_item_label_filter = Some(request_data_item_label_filter.into()); - self - } - #[doc = "maxItemCount"] - pub fn request_data_label_scope( - mut self, - request_data_label_scope: impl Into<String>, - ) -> Self { - self.request_data_label_scope = Some(request_data_label_scope.into()); - self - } - #[doc = "maxItemCount"] - pub fn request_data_max_item_count(mut self, request_data_max_item_count: i32) -> Self { - self.request_data_max_item_count = Some(request_data_max_item_count); - self - } - #[doc = "maxItemCount"] - pub fn request_data_name(mut self, request_data_name: impl Into<String>) -> Self { - self.request_data_name = Some(request_data_name.into()); - self - } - #[doc = "maxItemCount"] - pub fn request_data_owner(mut self, request_data_owner: impl Into<String>) -> Self { - self.request_data_owner = Some(request_data_owner.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/labels/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.label_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TfvcLabel>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TfvcLabel>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcItemList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcItemList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) label_id: String, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + } + impl RequestBuilder { + #[doc = "Max number of items to return"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of items to skip"] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tfvc/labels/{}/items", + this.client.endpoint(), + &this.organization, + &this.label_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcItemList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcItemList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcLabelRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcLabelRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) request_data_include_links: Option<bool>, + pub(crate) request_data_item_label_filter: Option<String>, + pub(crate) request_data_label_scope: Option<String>, + pub(crate) request_data_max_item_count: Option<i32>, + pub(crate) request_data_name: Option<String>, + pub(crate) request_data_owner: Option<String>, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + } + 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); + self + } + #[doc = "labelScope, name, owner, and itemLabelFilter"] + pub fn request_data_item_label_filter( + mut self, + request_data_item_label_filter: impl Into<String>, + ) -> Self { + self.request_data_item_label_filter = Some(request_data_item_label_filter.into()); + self + } + #[doc = "labelScope, name, owner, and itemLabelFilter"] + pub fn request_data_label_scope( + mut self, + request_data_label_scope: impl Into<String>, + ) -> Self { + self.request_data_label_scope = Some(request_data_label_scope.into()); + self + } + #[doc = "labelScope, name, owner, and itemLabelFilter"] + pub fn request_data_max_item_count(mut self, request_data_max_item_count: i32) -> Self { + self.request_data_max_item_count = Some(request_data_max_item_count); + self + } + #[doc = "labelScope, name, owner, and itemLabelFilter"] + pub fn request_data_name(mut self, request_data_name: impl Into<String>) -> Self { + self.request_data_name = Some(request_data_name.into()); + self + } + #[doc = "labelScope, name, owner, and itemLabelFilter"] + pub fn request_data_owner(mut self, request_data_owner: impl Into<String>) -> Self { + self.request_data_owner = Some(request_data_owner.into()); + self + } + #[doc = "Max number of labels to return, defaults to 100 when undefined"] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of labels to skip"] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/labels", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcLabelRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TfvcLabelRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TfvcLabel> { + let bytes = self.0.into_body().collect().await?; + let body: models::TfvcLabel = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) label_id: String, + pub(crate) project: String, + pub(crate) request_data_include_links: Option<bool>, + pub(crate) request_data_item_label_filter: Option<String>, + pub(crate) request_data_label_scope: Option<String>, + pub(crate) request_data_max_item_count: Option<i32>, + pub(crate) request_data_name: Option<String>, + pub(crate) request_data_owner: Option<String>, + } + 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); + self + } + #[doc = "maxItemCount"] + pub fn request_data_item_label_filter( + mut self, + request_data_item_label_filter: impl Into<String>, + ) -> Self { + self.request_data_item_label_filter = Some(request_data_item_label_filter.into()); + self + } + #[doc = "maxItemCount"] + pub fn request_data_label_scope( + mut self, + request_data_label_scope: impl Into<String>, + ) -> Self { + self.request_data_label_scope = Some(request_data_label_scope.into()); + self + } + #[doc = "maxItemCount"] + pub fn request_data_max_item_count(mut self, request_data_max_item_count: i32) -> Self { + self.request_data_max_item_count = Some(request_data_max_item_count); + self + } + #[doc = "maxItemCount"] + pub fn request_data_name(mut self, request_data_name: impl Into<String>) -> Self { + self.request_data_name = Some(request_data_name.into()); + self + } + #[doc = "maxItemCount"] + pub fn request_data_owner(mut self, request_data_owner: impl Into<String>) -> Self { + self.request_data_owner = Some(request_data_owner.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/labels/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.label_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TfvcLabel>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::TfvcLabel>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/tfvc/models.rs b/azure_devops_rust_api/src/tfvc/models.rs index dc7cec0a..34e46bc2 100644 --- a/azure_devops_rust_api/src/tfvc/models.rs +++ b/azure_devops_rust_api/src/tfvc/models.rs @@ -8,1590 +8,1578 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AssociatedWorkItem { - #[serde( - rename = "assignedTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_to: Option<String>, - #[doc = "Id of associated the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[doc = "REST Url of the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] - pub web_url: Option<String>, - #[serde( - rename = "workItemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type: Option<String>, + #[serde( + rename = "assignedTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_to: Option<String>, + #[doc = "Id of associated the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[doc = "REST Url of the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] + pub web_url: Option<String>, + #[serde( + rename = "workItemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type: Option<String>, } impl AssociatedWorkItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AssociatedWorkItemList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<AssociatedWorkItem>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<AssociatedWorkItem>, } impl AssociatedWorkItemList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Change { - #[doc = "The type of change that was made to the item."] - #[serde( - rename = "changeType", - default, - skip_serializing_if = "Option::is_none" - )] - pub change_type: Option<change::ChangeType>, - #[doc = "Current version."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item: Option<String>, - #[doc = ""] - #[serde( - rename = "newContent", - default, - skip_serializing_if = "Option::is_none" - )] - pub new_content: Option<ItemContent>, - #[doc = "Path of the item on the server."] - #[serde( - rename = "sourceServerItem", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_server_item: Option<String>, - #[doc = "URL to retrieve the item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The type of change that was made to the item."] + #[serde( + rename = "changeType", + default, + skip_serializing_if = "Option::is_none" + )] + pub change_type: Option<change::ChangeType>, + #[doc = "Current version."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item: Option<String>, + #[doc = ""] + #[serde( + rename = "newContent", + default, + skip_serializing_if = "Option::is_none" + )] + pub new_content: Option<ItemContent>, + #[doc = "Path of the item on the server."] + #[serde( + rename = "sourceServerItem", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_server_item: Option<String>, + #[doc = "URL to retrieve the item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Change { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod change { - use super::*; - #[doc = "The type of change that was made to the item."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ChangeType { - #[serde(rename = "none")] - None, - #[serde(rename = "add")] - Add, - #[serde(rename = "edit")] - Edit, - #[serde(rename = "encoding")] - Encoding, - #[serde(rename = "rename")] - Rename, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "undelete")] - Undelete, - #[serde(rename = "branch")] - Branch, - #[serde(rename = "merge")] - Merge, - #[serde(rename = "lock")] - Lock, - #[serde(rename = "rollback")] - Rollback, - #[serde(rename = "sourceRename")] - SourceRename, - #[serde(rename = "targetRename")] - TargetRename, - #[serde(rename = "property")] - Property, - #[serde(rename = "all")] - All, - } + use super::*; + #[doc = "The type of change that was made to the item."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ChangeType { + #[serde(rename = "none")] + None, + #[serde(rename = "add")] + Add, + #[serde(rename = "edit")] + Edit, + #[serde(rename = "encoding")] + Encoding, + #[serde(rename = "rename")] + Rename, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "undelete")] + Undelete, + #[serde(rename = "branch")] + Branch, + #[serde(rename = "merge")] + Merge, + #[serde(rename = "lock")] + Lock, + #[serde(rename = "rollback")] + Rollback, + #[serde(rename = "sourceRename")] + SourceRename, + #[serde(rename = "targetRename")] + TargetRename, + #[serde(rename = "property")] + Property, + #[serde(rename = "all")] + All, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckinNote { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl CheckinNote { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FileContentMetadata { - #[serde( - rename = "contentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_type: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encoding: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub extension: Option<String>, - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option<String>, - #[serde(rename = "isBinary", default, skip_serializing_if = "Option::is_none")] - pub is_binary: Option<bool>, - #[serde(rename = "isImage", default, skip_serializing_if = "Option::is_none")] - pub is_image: Option<bool>, - #[serde(rename = "vsLink", default, skip_serializing_if = "Option::is_none")] - pub vs_link: Option<String>, + #[serde( + rename = "contentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_type: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encoding: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub extension: Option<String>, + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option<String>, + #[serde(rename = "isBinary", default, skip_serializing_if = "Option::is_none")] + pub is_binary: Option<bool>, + #[serde(rename = "isImage", default, skip_serializing_if = "Option::is_none")] + pub is_image: Option<bool>, + #[serde(rename = "vsLink", default, skip_serializing_if = "Option::is_none")] + pub vs_link: Option<String>, } impl FileContentMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRepository { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde( - rename = "defaultBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_branch: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "True if the repository is disabled. False otherwise."] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "True if the repository was created as a fork."] - #[serde(rename = "isFork", default, skip_serializing_if = "Option::is_none")] - pub is_fork: Option<bool>, - #[doc = "True if the repository is in maintenance. False otherwise."] - #[serde( - rename = "isInMaintenance", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_in_maintenance: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde( - rename = "parentRepository", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_repository: Option<GitRepositoryRef>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] - pub remote_url: Option<String>, - #[doc = "Compressed size (bytes) of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[serde(rename = "sshUrl", default, skip_serializing_if = "Option::is_none")] - pub ssh_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[serde( - rename = "validRemoteUrls", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub valid_remote_urls: Vec<String>, - #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] - pub web_url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde( + rename = "defaultBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_branch: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "True if the repository is disabled. False otherwise."] + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[doc = "True if the repository was created as a fork."] + #[serde(rename = "isFork", default, skip_serializing_if = "Option::is_none")] + pub is_fork: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde( + rename = "parentRepository", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_repository: Option<GitRepositoryRef>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] + pub remote_url: Option<String>, + #[doc = "Compressed size (bytes) of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[serde(rename = "sshUrl", default, skip_serializing_if = "Option::is_none")] + pub ssh_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[serde( + rename = "validRemoteUrls", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub valid_remote_urls: Vec<String>, + #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] + pub web_url: Option<String>, } impl GitRepository { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRepositoryRef { - #[doc = "Reference object for a TeamProjectCollection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub collection: Option<TeamProjectCollectionReference>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "True if the repository was created as a fork"] - #[serde(rename = "isFork", default, skip_serializing_if = "Option::is_none")] - pub is_fork: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] - pub remote_url: Option<String>, - #[serde(rename = "sshUrl", default, skip_serializing_if = "Option::is_none")] - pub ssh_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Reference object for a TeamProjectCollection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub collection: Option<TeamProjectCollectionReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "True if the repository was created as a fork"] + #[serde(rename = "isFork", default, skip_serializing_if = "Option::is_none")] + pub is_fork: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] + pub remote_url: Option<String>, + #[serde(rename = "sshUrl", default, skip_serializing_if = "Option::is_none")] + pub ssh_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitRepositoryRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ItemContent { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub content: Option<String>, - #[serde( - rename = "contentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_type: Option<item_content::ContentType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content: Option<String>, + #[serde( + rename = "contentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_type: Option<item_content::ContentType>, } impl ItemContent { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod item_content { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ContentType { - #[serde(rename = "rawText")] - RawText, - #[serde(rename = "base64Encoded")] - Base64Encoded, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ContentType { + #[serde(rename = "rawText")] + RawText, + #[serde(rename = "base64Encoded")] + Base64Encoded, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ItemModel { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub content: Option<String>, - #[doc = ""] - #[serde( - rename = "contentMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub content_metadata: Option<FileContentMetadata>, - #[serde(rename = "isFolder", default, skip_serializing_if = "Option::is_none")] - pub is_folder: Option<bool>, - #[serde(rename = "isSymLink", default, skip_serializing_if = "Option::is_none")] - pub is_sym_link: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content: Option<String>, + #[doc = ""] + #[serde( + rename = "contentMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_metadata: Option<FileContentMetadata>, + #[serde(rename = "isFolder", default, skip_serializing_if = "Option::is_none")] + pub is_folder: Option<bool>, + #[serde(rename = "isSymLink", default, skip_serializing_if = "Option::is_none")] + pub is_sym_link: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ItemModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference object for a TeamProjectCollection."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamProjectCollectionReference { - #[doc = "Collection avatar Url."] - #[serde(rename = "avatarUrl", default, skip_serializing_if = "Option::is_none")] - pub avatar_url: Option<String>, - #[doc = "Collection Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Collection Name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Collection REST Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Collection Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Collection Name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Collection REST Url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TeamProjectCollectionReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a shallow reference to a TeamProject."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TeamProjectReference { - #[doc = "Project abbreviation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub abbreviation: Option<String>, - #[doc = "Url to default team identity image."] - #[serde( - rename = "defaultTeamImageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_team_image_url: Option<String>, - #[doc = "The project's description (if any)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Project identifier."] - pub id: String, - #[doc = "Project last update time."] - #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] - pub last_update_time: time::OffsetDateTime, - #[doc = "Project name."] - pub name: String, - #[doc = "Project revision."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, - #[doc = "Project state."] - pub state: team_project_reference::State, - #[doc = "Url to the full version of the object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Project visibility."] - pub visibility: team_project_reference::Visibility, + #[doc = "Project abbreviation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub abbreviation: Option<String>, + #[doc = "Url to default team identity image."] + #[serde( + rename = "defaultTeamImageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_team_image_url: Option<String>, + #[doc = "The project's description (if any)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Project identifier."] + pub id: String, + #[doc = "Project last update time."] + #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] + pub last_update_time: time::OffsetDateTime, + #[doc = "Project name."] + pub name: String, + #[doc = "Project revision."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i64>, + #[doc = "Project state."] + pub state: team_project_reference::State, + #[doc = "Url to the full version of the object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Project visibility."] + pub visibility: team_project_reference::Visibility, } impl TeamProjectReference { - pub fn new( - id: String, - last_update_time: time::OffsetDateTime, - name: String, - state: team_project_reference::State, - visibility: team_project_reference::Visibility, - ) -> Self { - Self { - abbreviation: None, - default_team_image_url: None, - description: None, - id, - last_update_time, - name, - revision: None, - state, - url: None, - visibility, - } + pub fn new( + id: String, + last_update_time: time::OffsetDateTime, + name: String, + state: team_project_reference::State, + visibility: team_project_reference::Visibility, + ) -> Self { + Self { + abbreviation: None, + default_team_image_url: None, + description: None, + id, + last_update_time, + name, + revision: None, + state, + url: None, + visibility, } + } } pub mod team_project_reference { - use super::*; - #[doc = "Project state."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "deleting")] - Deleting, - #[serde(rename = "new")] - New, - #[serde(rename = "wellFormed")] - WellFormed, - #[serde(rename = "createPending")] - CreatePending, - #[serde(rename = "all")] - All, - #[serde(rename = "unchanged")] - Unchanged, - #[serde(rename = "deleted")] - Deleted, - } - #[doc = "Project visibility."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Visibility { - #[serde(rename = "private")] - Private, - #[serde(rename = "public")] - Public, - #[serde(rename = "organization")] - Organization, - #[serde(rename = "unchanged")] - Unchanged, - } + use super::*; + #[doc = "Project state."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "deleting")] + Deleting, + #[serde(rename = "new")] + New, + #[serde(rename = "wellFormed")] + WellFormed, + #[serde(rename = "createPending")] + CreatePending, + #[serde(rename = "all")] + All, + #[serde(rename = "unchanged")] + Unchanged, + #[serde(rename = "deleted")] + Deleted, + } + #[doc = "Project visibility."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Visibility { + #[serde(rename = "private")] + Private, + #[serde(rename = "public")] + Public, + #[serde(rename = "organization")] + Organization, + #[serde(rename = "unchanged")] + Unchanged, + } } #[doc = "Class representing a branch object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcBranch { - #[serde(flatten)] - pub tfvc_branch_ref: TfvcBranchRef, - #[doc = "List of children for the branch."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub children: Vec<TfvcBranch>, - #[doc = "List of branch mappings."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mappings: Vec<TfvcBranchMapping>, - #[doc = "This is the shallow branchref class."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option<TfvcShallowBranchRef>, - #[doc = "List of paths of the related branches."] - #[serde( - rename = "relatedBranches", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub related_branches: Vec<TfvcShallowBranchRef>, + #[serde(flatten)] + pub tfvc_branch_ref: TfvcBranchRef, + #[doc = "List of children for the branch."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub children: Vec<TfvcBranch>, + #[doc = "List of branch mappings."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mappings: Vec<TfvcBranchMapping>, + #[doc = "This is the shallow branchref class."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option<TfvcShallowBranchRef>, + #[doc = "List of paths of the related branches."] + #[serde( + rename = "relatedBranches", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub related_branches: Vec<TfvcShallowBranchRef>, } impl TfvcBranch { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcBranchList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TfvcBranch>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TfvcBranch>, } impl TfvcBranchList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A branch mapping."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcBranchMapping { - #[doc = "Depth of the branch."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub depth: Option<String>, - #[doc = "Server item for the branch."] - #[serde( - rename = "serverItem", - default, - skip_serializing_if = "Option::is_none" - )] - pub server_item: Option<String>, - #[doc = "Type of the branch."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[doc = "Depth of the branch."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub depth: Option<String>, + #[doc = "Server item for the branch."] + #[serde( + rename = "serverItem", + default, + skip_serializing_if = "Option::is_none" + )] + pub server_item: Option<String>, + #[doc = "Type of the branch."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl TfvcBranchMapping { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for a branchref."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcBranchRef { - #[serde(flatten)] - pub tfvc_shallow_branch_ref: TfvcShallowBranchRef, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Creation date of the branch."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Branch description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Is the branch deleted?"] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "URL to retrieve the item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(flatten)] + pub tfvc_shallow_branch_ref: TfvcShallowBranchRef, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Creation date of the branch."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Branch description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Is the branch deleted?"] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "URL to retrieve the item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TfvcBranchRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcBranchRefList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TfvcBranchRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TfvcBranchRef>, } impl TfvcBranchRefList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A change."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcChange { - #[serde(flatten)] - pub change: Change, - #[doc = "List of merge sources in case of rename or branch creation."] - #[serde( - rename = "mergeSources", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub merge_sources: Vec<TfvcMergeSource>, - #[doc = "Version at which a (shelved) change was pended against"] - #[serde( - rename = "pendingVersion", - default, - skip_serializing_if = "Option::is_none" - )] - pub pending_version: Option<i32>, + #[serde(flatten)] + pub change: Change, + #[doc = "List of merge sources in case of rename or branch creation."] + #[serde( + rename = "mergeSources", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub merge_sources: Vec<TfvcMergeSource>, + #[doc = "Version at which a (shelved) change was pended against"] + #[serde( + rename = "pendingVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub pending_version: Option<i32>, } impl TfvcChange { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcChangeList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TfvcChange>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TfvcChange>, } impl TfvcChangeList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A collection of changes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcChangeset { - #[serde(flatten)] - pub tfvc_changeset_ref: TfvcChangesetRef, - #[doc = "Changeset Account Id also known as Organization Id."] - #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] - pub account_id: Option<String>, - #[doc = "List of associated changes."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub changes: Vec<TfvcChange>, - #[doc = "List of Checkin Notes for the changeset."] - #[serde( - rename = "checkinNotes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub checkin_notes: Vec<CheckinNote>, - #[doc = "Changeset collection Id."] - #[serde( - rename = "collectionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub collection_id: Option<String>, - #[doc = "True if more changes are available."] - #[serde( - rename = "hasMoreChanges", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_more_changes: Option<bool>, - #[doc = "Information on the policy override."] - #[serde( - rename = "policyOverride", - default, - skip_serializing_if = "Option::is_none" - )] - pub policy_override: Option<TfvcPolicyOverrideInfo>, - #[doc = "Team Project Ids for the changeset."] - #[serde( - rename = "teamProjectIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub team_project_ids: Vec<String>, - #[doc = "List of work items associated with the changeset."] - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<AssociatedWorkItem>, + #[serde(flatten)] + pub tfvc_changeset_ref: TfvcChangesetRef, + #[doc = "Changeset Account Id also known as Organization Id."] + #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] + pub account_id: Option<String>, + #[doc = "List of associated changes."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub changes: Vec<TfvcChange>, + #[doc = "List of Checkin Notes for the changeset."] + #[serde( + rename = "checkinNotes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub checkin_notes: Vec<CheckinNote>, + #[doc = "Changeset collection Id."] + #[serde( + rename = "collectionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub collection_id: Option<String>, + #[doc = "True if more changes are available."] + #[serde( + rename = "hasMoreChanges", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_more_changes: Option<bool>, + #[doc = "Information on the policy override."] + #[serde( + rename = "policyOverride", + default, + skip_serializing_if = "Option::is_none" + )] + pub policy_override: Option<TfvcPolicyOverrideInfo>, + #[doc = "Team Project Ids for the changeset."] + #[serde( + rename = "teamProjectIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub team_project_ids: Vec<String>, + #[doc = "List of work items associated with the changeset."] + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<AssociatedWorkItem>, } impl TfvcChangeset { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for a changeset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcChangesetRef { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<IdentityRef>, - #[doc = "Changeset Id."] - #[serde( - rename = "changesetId", - default, - skip_serializing_if = "Option::is_none" - )] - pub changeset_id: Option<i32>, - #[doc = ""] - #[serde( - rename = "checkedInBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub checked_in_by: Option<IdentityRef>, - #[doc = "Comment for the changeset."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Was the Comment result truncated?"] - #[serde( - rename = "commentTruncated", - default, - skip_serializing_if = "Option::is_none" - )] - pub comment_truncated: Option<bool>, - #[doc = "Creation date of the changeset."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "URL to retrieve the item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<IdentityRef>, + #[doc = "Changeset Id."] + #[serde( + rename = "changesetId", + default, + skip_serializing_if = "Option::is_none" + )] + pub changeset_id: Option<i32>, + #[doc = ""] + #[serde( + rename = "checkedInBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub checked_in_by: Option<IdentityRef>, + #[doc = "Comment for the changeset."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Was the Comment result truncated?"] + #[serde( + rename = "commentTruncated", + default, + skip_serializing_if = "Option::is_none" + )] + pub comment_truncated: Option<bool>, + #[doc = "Creation date of the changeset."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "URL to retrieve the item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TfvcChangesetRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcChangesetRefList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TfvcChangesetRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TfvcChangesetRef>, } impl TfvcChangesetRefList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Criteria used in a search for change lists."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcChangesetSearchCriteria { - #[doc = "Alias or display name of user who made the changes."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option<String>, - #[doc = "Whether or not to follow renames for the given item being queried."] - #[serde( - rename = "followRenames", - default, - skip_serializing_if = "Option::is_none" - )] - pub follow_renames: Option<bool>, - #[doc = "If provided, only include changesets created after this date (string)."] - #[serde(rename = "fromDate", default, skip_serializing_if = "Option::is_none")] - pub from_date: Option<String>, - #[doc = "If provided, only include changesets after this changesetID."] - #[serde(rename = "fromId", default, skip_serializing_if = "Option::is_none")] - pub from_id: Option<i32>, - #[doc = "Whether to include the _links field on the shallow references."] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[doc = "Path of item to search under."] - #[serde(rename = "itemPath", default, skip_serializing_if = "Option::is_none")] - pub item_path: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mappings: Vec<TfvcMappingFilter>, - #[doc = "If provided, only include changesets created before this date (string)."] - #[serde(rename = "toDate", default, skip_serializing_if = "Option::is_none")] - pub to_date: Option<String>, - #[doc = "If provided, a version descriptor for the latest change list to include."] - #[serde(rename = "toId", default, skip_serializing_if = "Option::is_none")] - pub to_id: Option<i32>, + #[doc = "Alias or display name of user who made the changes."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option<String>, + #[doc = "Whether or not to follow renames for the given item being queried."] + #[serde( + rename = "followRenames", + default, + skip_serializing_if = "Option::is_none" + )] + pub follow_renames: Option<bool>, + #[doc = "If provided, only include changesets created after this date (string)."] + #[serde(rename = "fromDate", default, skip_serializing_if = "Option::is_none")] + pub from_date: Option<String>, + #[doc = "If provided, only include changesets after this changesetID."] + #[serde(rename = "fromId", default, skip_serializing_if = "Option::is_none")] + pub from_id: Option<i32>, + #[doc = "Whether to include the _links field on the shallow references."] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[doc = "Path of item to search under."] + #[serde(rename = "itemPath", default, skip_serializing_if = "Option::is_none")] + pub item_path: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mappings: Vec<TfvcMappingFilter>, + #[doc = "If provided, only include changesets created before this date (string)."] + #[serde(rename = "toDate", default, skip_serializing_if = "Option::is_none")] + pub to_date: Option<String>, + #[doc = "If provided, a version descriptor for the latest change list to include."] + #[serde(rename = "toId", default, skip_serializing_if = "Option::is_none")] + pub to_id: Option<i32>, } impl TfvcChangesetSearchCriteria { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Request body for Get batched changesets."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcChangesetsRequestData { - #[doc = "List of changeset Ids."] - #[serde( - rename = "changesetIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub changeset_ids: Vec<i32>, - #[doc = "Max length of the comment."] - #[serde( - rename = "commentLength", - default, - skip_serializing_if = "Option::is_none" - )] - pub comment_length: Option<i32>, - #[doc = "Whether to include the _links field on the shallow references"] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, + #[doc = "List of changeset Ids."] + #[serde( + rename = "changesetIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub changeset_ids: Vec<i32>, + #[doc = "Max length of the comment."] + #[serde( + rename = "commentLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub comment_length: Option<i32>, + #[doc = "Whether to include the _links field on the shallow references"] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, } impl TfvcChangesetsRequestData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for an item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcItem { - #[serde(flatten)] - pub item_model: ItemModel, - #[doc = "Item changed datetime."] - #[serde( - rename = "changeDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub change_date: Option<time::OffsetDateTime>, - #[doc = "Greater than 0 if item is deleted."] - #[serde( - rename = "deletionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub deletion_id: Option<i32>, - #[doc = "File encoding from database, -1 represents binary."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub encoding: Option<i32>, - #[doc = "MD5 hash as a base 64 string, applies to files only."] - #[serde(rename = "hashValue", default, skip_serializing_if = "Option::is_none")] - pub hash_value: Option<String>, - #[doc = "True if item is a branch."] - #[serde(rename = "isBranch", default, skip_serializing_if = "Option::is_none")] - pub is_branch: Option<bool>, - #[doc = "True if there is a change pending."] - #[serde( - rename = "isPendingChange", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_pending_change: Option<bool>, - #[doc = "The size of the file, if applicable."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[doc = "Changeset version Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i32>, + #[serde(flatten)] + pub item_model: ItemModel, + #[doc = "Item changed datetime."] + #[serde( + rename = "changeDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub change_date: Option<time::OffsetDateTime>, + #[doc = "Greater than 0 if item is deleted."] + #[serde( + rename = "deletionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub deletion_id: Option<i32>, + #[doc = "File encoding from database, -1 represents binary."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encoding: Option<i32>, + #[doc = "MD5 hash as a base 64 string, applies to files only."] + #[serde(rename = "hashValue", default, skip_serializing_if = "Option::is_none")] + pub hash_value: Option<String>, + #[doc = "True if item is a branch."] + #[serde(rename = "isBranch", default, skip_serializing_if = "Option::is_none")] + pub is_branch: Option<bool>, + #[doc = "True if there is a change pending."] + #[serde( + rename = "isPendingChange", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_pending_change: Option<bool>, + #[doc = "The size of the file, if applicable."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[doc = "Changeset version Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i32>, } impl TfvcItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Item path and Version descriptor properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcItemDescriptor { - #[doc = "Item path."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Defaults to OneLevel."] - #[serde( - rename = "recursionLevel", - default, - skip_serializing_if = "Option::is_none" - )] - pub recursion_level: Option<tfvc_item_descriptor::RecursionLevel>, - #[doc = "Specify the desired version, can be null or empty string only if VersionType is latest or tip."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, - #[doc = "Defaults to None."] - #[serde( - rename = "versionOption", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_option: Option<tfvc_item_descriptor::VersionOption>, - #[doc = "Defaults to Latest."] - #[serde( - rename = "versionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_type: Option<tfvc_item_descriptor::VersionType>, + #[doc = "Item path."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Defaults to OneLevel."] + #[serde( + rename = "recursionLevel", + default, + skip_serializing_if = "Option::is_none" + )] + pub recursion_level: Option<tfvc_item_descriptor::RecursionLevel>, + #[doc = "Specify the desired version, can be null or empty string only if VersionType is latest or tip."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, + #[doc = "Defaults to None."] + #[serde( + rename = "versionOption", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_option: Option<tfvc_item_descriptor::VersionOption>, + #[doc = "Defaults to Latest."] + #[serde( + rename = "versionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_type: Option<tfvc_item_descriptor::VersionType>, } impl TfvcItemDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod tfvc_item_descriptor { - use super::*; - #[doc = "Defaults to OneLevel."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum RecursionLevel { - #[serde(rename = "none")] - None, - #[serde(rename = "oneLevel")] - OneLevel, - #[serde(rename = "oneLevelPlusNestedEmptyFolders")] - OneLevelPlusNestedEmptyFolders, - #[serde(rename = "full")] - Full, - } - #[doc = "Defaults to None."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionOption { - #[serde(rename = "none")] - None, - #[serde(rename = "previous")] - Previous, - #[serde(rename = "useRename")] - UseRename, - } - #[doc = "Defaults to Latest."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionType { - #[serde(rename = "none")] - None, - #[serde(rename = "changeset")] - Changeset, - #[serde(rename = "shelveset")] - Shelveset, - #[serde(rename = "change")] - Change, - #[serde(rename = "date")] - Date, - #[serde(rename = "latest")] - Latest, - #[serde(rename = "tip")] - Tip, - #[serde(rename = "mergeSource")] - MergeSource, - } + use super::*; + #[doc = "Defaults to OneLevel."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum RecursionLevel { + #[serde(rename = "none")] + None, + #[serde(rename = "oneLevel")] + OneLevel, + #[serde(rename = "oneLevelPlusNestedEmptyFolders")] + OneLevelPlusNestedEmptyFolders, + #[serde(rename = "full")] + Full, + } + #[doc = "Defaults to None."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionOption { + #[serde(rename = "none")] + None, + #[serde(rename = "previous")] + Previous, + #[serde(rename = "useRename")] + UseRename, + } + #[doc = "Defaults to Latest."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionType { + #[serde(rename = "none")] + None, + #[serde(rename = "changeset")] + Changeset, + #[serde(rename = "shelveset")] + Shelveset, + #[serde(rename = "change")] + Change, + #[serde(rename = "date")] + Date, + #[serde(rename = "latest")] + Latest, + #[serde(rename = "tip")] + Tip, + #[serde(rename = "mergeSource")] + MergeSource, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcItemList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TfvcItem>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TfvcItem>, } impl TfvcItemList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Request body used by Get Items Batch"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcItemRequestData { - #[doc = "If true, include metadata about the file type"] - #[serde( - rename = "includeContentMetadata", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_content_metadata: Option<bool>, - #[doc = "Whether to include the _links field on the shallow references"] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[serde( - rename = "itemDescriptors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub item_descriptors: Vec<TfvcItemDescriptor>, + #[doc = "If true, include metadata about the file type"] + #[serde( + rename = "includeContentMetadata", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_content_metadata: Option<bool>, + #[doc = "Whether to include the _links field on the shallow references"] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[serde( + rename = "itemDescriptors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub item_descriptors: Vec<TfvcItemDescriptor>, } impl TfvcItemRequestData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for a label."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcLabel { - #[serde(flatten)] - pub tfvc_label_ref: TfvcLabelRef, - #[doc = "List of items."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub items: Vec<TfvcItem>, + #[serde(flatten)] + pub tfvc_label_ref: TfvcLabelRef, + #[doc = "List of items."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub items: Vec<TfvcItem>, } impl TfvcLabel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for a Label."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcLabelRef { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Label description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Label Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Label scope."] - #[serde( - rename = "labelScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub label_scope: Option<String>, - #[doc = "Last modified datetime for the label."] - #[serde( - rename = "modifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_date: Option<time::OffsetDateTime>, - #[doc = "Label name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Label Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Label description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Label Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Label scope."] + #[serde( + rename = "labelScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub label_scope: Option<String>, + #[doc = "Last modified datetime for the label."] + #[serde( + rename = "modifiedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_date: Option<time::OffsetDateTime>, + #[doc = "Label name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Label Url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TfvcLabelRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcLabelRefList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TfvcLabelRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TfvcLabelRef>, } impl TfvcLabelRefList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcLabelRequestData { - #[doc = "Whether to include the _links field on the shallow references"] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[serde( - rename = "itemLabelFilter", - default, - skip_serializing_if = "Option::is_none" - )] - pub item_label_filter: Option<String>, - #[serde( - rename = "labelScope", - default, - skip_serializing_if = "Option::is_none" - )] - pub label_scope: Option<String>, - #[serde( - rename = "maxItemCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_item_count: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, + #[doc = "Whether to include the _links field on the shallow references"] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[serde( + rename = "itemLabelFilter", + default, + skip_serializing_if = "Option::is_none" + )] + pub item_label_filter: Option<String>, + #[serde( + rename = "labelScope", + default, + skip_serializing_if = "Option::is_none" + )] + pub label_scope: Option<String>, + #[serde( + rename = "maxItemCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_item_count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, } impl TfvcLabelRequestData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "MappingFilter can be used to include or exclude specific paths."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcMappingFilter { - #[doc = "True if ServerPath should be excluded."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub exclude: Option<bool>, - #[doc = "Path to be included or excluded."] - #[serde( - rename = "serverPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub server_path: Option<String>, + #[doc = "True if ServerPath should be excluded."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub exclude: Option<bool>, + #[doc = "Path to be included or excluded."] + #[serde( + rename = "serverPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub server_path: Option<String>, } impl TfvcMappingFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcMergeSource { - #[doc = "Indicates if this a rename source. If false, it is a merge source."] - #[serde(rename = "isRename", default, skip_serializing_if = "Option::is_none")] - pub is_rename: Option<bool>, - #[doc = "The server item of the merge source."] - #[serde( - rename = "serverItem", - default, - skip_serializing_if = "Option::is_none" - )] - pub server_item: Option<String>, - #[doc = "Start of the version range."] - #[serde( - rename = "versionFrom", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_from: Option<i32>, - #[doc = "End of the version range."] - #[serde(rename = "versionTo", default, skip_serializing_if = "Option::is_none")] - pub version_to: Option<i32>, + #[doc = "Indicates if this a rename source. If false, it is a merge source."] + #[serde(rename = "isRename", default, skip_serializing_if = "Option::is_none")] + pub is_rename: Option<bool>, + #[doc = "The server item of the merge source."] + #[serde( + rename = "serverItem", + default, + skip_serializing_if = "Option::is_none" + )] + pub server_item: Option<String>, + #[doc = "Start of the version range."] + #[serde( + rename = "versionFrom", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_from: Option<i32>, + #[doc = "End of the version range."] + #[serde(rename = "versionTo", default, skip_serializing_if = "Option::is_none")] + pub version_to: Option<i32>, } impl TfvcMergeSource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Policy failure information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcPolicyFailureInfo { - #[doc = "Policy failure message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "Name of the policy that failed."] - #[serde( - rename = "policyName", - default, - skip_serializing_if = "Option::is_none" - )] - pub policy_name: Option<String>, + #[doc = "Policy failure message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "Name of the policy that failed."] + #[serde( + rename = "policyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub policy_name: Option<String>, } impl TfvcPolicyFailureInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Information on the policy override."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcPolicyOverrideInfo { - #[doc = "Overidden policy comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Information on the failed policy that was overridden."] - #[serde( - rename = "policyFailures", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub policy_failures: Vec<TfvcPolicyFailureInfo>, + #[doc = "Overidden policy comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Information on the failed policy that was overridden."] + #[serde( + rename = "policyFailures", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub policy_failures: Vec<TfvcPolicyFailureInfo>, } impl TfvcPolicyOverrideInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "This is the shallow branchref class."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcShallowBranchRef { - #[doc = "Path for the branch."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[doc = "Path for the branch."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl TfvcShallowBranchRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for a shelveset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcShelveset { - #[serde(flatten)] - pub tfvc_shelveset_ref: TfvcShelvesetRef, - #[doc = "List of changes."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub changes: Vec<TfvcChange>, - #[doc = "List of checkin notes."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub notes: Vec<CheckinNote>, - #[doc = "Information on the policy override."] - #[serde( - rename = "policyOverride", - default, - skip_serializing_if = "Option::is_none" - )] - pub policy_override: Option<TfvcPolicyOverrideInfo>, - #[doc = "List of associated workitems."] - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<AssociatedWorkItem>, + #[serde(flatten)] + pub tfvc_shelveset_ref: TfvcShelvesetRef, + #[doc = "List of changes."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub changes: Vec<TfvcChange>, + #[doc = "List of checkin notes."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub notes: Vec<CheckinNote>, + #[doc = "Information on the policy override."] + #[serde( + rename = "policyOverride", + default, + skip_serializing_if = "Option::is_none" + )] + pub policy_override: Option<TfvcPolicyOverrideInfo>, + #[doc = "List of associated workitems."] + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<AssociatedWorkItem>, } impl TfvcShelveset { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata for a shallow shelveset."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcShelvesetRef { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Shelveset comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comment: Option<String>, - #[doc = "Shelveset comment truncated as applicable."] - #[serde( - rename = "commentTruncated", - default, - skip_serializing_if = "Option::is_none" - )] - pub comment_truncated: Option<bool>, - #[doc = "Shelveset create date."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Shelveset Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Shelveset name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<IdentityRef>, - #[doc = "Shelveset Url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Shelveset comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, + #[doc = "Shelveset comment truncated as applicable."] + #[serde( + rename = "commentTruncated", + default, + skip_serializing_if = "Option::is_none" + )] + pub comment_truncated: Option<bool>, + #[doc = "Shelveset create date."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Shelveset Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Shelveset name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<IdentityRef>, + #[doc = "Shelveset Url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TfvcShelvesetRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcShelvesetRefList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TfvcShelvesetRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TfvcShelvesetRef>, } impl TfvcShelvesetRefList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcShelvesetRequestData { - #[doc = "Whether to include policyOverride and notes Only applies when requesting a single deep shelveset"] - #[serde( - rename = "includeDetails", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_details: Option<bool>, - #[doc = "Whether to include the _links field on the shallow references. Does not apply when requesting a single deep shelveset object. Links will always be included in the deep shelveset."] - #[serde( - rename = "includeLinks", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_links: Option<bool>, - #[doc = "Whether to include workItems"] - #[serde( - rename = "includeWorkItems", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_work_items: Option<bool>, - #[doc = "Max number of changes to include"] - #[serde( - rename = "maxChangeCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_change_count: Option<i32>, - #[doc = "Max length of comment"] - #[serde( - rename = "maxCommentLength", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_comment_length: Option<i32>, - #[doc = "Shelveset name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Owner's ID. Could be a name or a guid."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub owner: Option<String>, + #[doc = "Whether to include policyOverride and notes Only applies when requesting a single deep shelveset"] + #[serde( + rename = "includeDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_details: Option<bool>, + #[doc = "Whether to include the _links field on the shallow references. Does not apply when requesting a single deep shelveset object. Links will always be included in the deep shelveset."] + #[serde( + rename = "includeLinks", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_links: Option<bool>, + #[doc = "Whether to include workItems"] + #[serde( + rename = "includeWorkItems", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_work_items: Option<bool>, + #[doc = "Max number of changes to include"] + #[serde( + rename = "maxChangeCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_change_count: Option<i32>, + #[doc = "Max length of comment"] + #[serde( + rename = "maxCommentLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_comment_length: Option<i32>, + #[doc = "Shelveset name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Owner's ID. Could be a name or a guid."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option<String>, } impl TfvcShelvesetRequestData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcStatistics { - #[doc = "Id of the last changeset the stats are based on."] - #[serde( - rename = "changesetId", - default, - skip_serializing_if = "Option::is_none" - )] - pub changeset_id: Option<i32>, - #[doc = "Count of files at the requested scope."] - #[serde( - rename = "fileCountTotal", - default, - skip_serializing_if = "Option::is_none" - )] - pub file_count_total: Option<i64>, + #[doc = "Id of the last changeset the stats are based on."] + #[serde( + rename = "changesetId", + default, + skip_serializing_if = "Option::is_none" + )] + pub changeset_id: Option<i32>, + #[doc = "Count of files at the requested scope."] + #[serde( + rename = "fileCountTotal", + default, + skip_serializing_if = "Option::is_none" + )] + pub file_count_total: Option<i64>, } impl TfvcStatistics { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Version descriptor properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TfvcVersionDescriptor { - #[doc = "Version object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, - #[serde( - rename = "versionOption", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_option: Option<tfvc_version_descriptor::VersionOption>, - #[serde( - rename = "versionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_type: Option<tfvc_version_descriptor::VersionType>, + #[doc = "Version object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, + #[serde( + rename = "versionOption", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_option: Option<tfvc_version_descriptor::VersionOption>, + #[serde( + rename = "versionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_type: Option<tfvc_version_descriptor::VersionType>, } impl TfvcVersionDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod tfvc_version_descriptor { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionOption { - #[serde(rename = "none")] - None, - #[serde(rename = "previous")] - Previous, - #[serde(rename = "useRename")] - UseRename, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionType { - #[serde(rename = "none")] - None, - #[serde(rename = "changeset")] - Changeset, - #[serde(rename = "shelveset")] - Shelveset, - #[serde(rename = "change")] - Change, - #[serde(rename = "date")] - Date, - #[serde(rename = "latest")] - Latest, - #[serde(rename = "tip")] - Tip, - #[serde(rename = "mergeSource")] - MergeSource, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionOption { + #[serde(rename = "none")] + None, + #[serde(rename = "previous")] + Previous, + #[serde(rename = "useRename")] + UseRename, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionType { + #[serde(rename = "none")] + None, + #[serde(rename = "changeset")] + Changeset, + #[serde(rename = "shelveset")] + Shelveset, + #[serde(rename = "change")] + Change, + #[serde(rename = "date")] + Date, + #[serde(rename = "latest")] + Latest, + #[serde(rename = "tip")] + Tip, + #[serde(rename = "mergeSource")] + MergeSource, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VersionControlProjectInfo { - #[serde( - rename = "defaultSourceControlType", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_source_control_type: Option<version_control_project_info::DefaultSourceControlType>, - #[doc = "Represents a shallow reference to a TeamProject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[serde( - rename = "supportsGit", - default, - skip_serializing_if = "Option::is_none" - )] - pub supports_git: Option<bool>, - #[serde( - rename = "supportsTFVC", - default, - skip_serializing_if = "Option::is_none" - )] - pub supports_tfvc: Option<bool>, + #[serde( + rename = "defaultSourceControlType", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_source_control_type: Option<version_control_project_info::DefaultSourceControlType>, + #[doc = "Represents a shallow reference to a TeamProject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[serde( + rename = "supportsGit", + default, + skip_serializing_if = "Option::is_none" + )] + pub supports_git: Option<bool>, + #[serde( + rename = "supportsTFVC", + default, + skip_serializing_if = "Option::is_none" + )] + pub supports_tfvc: Option<bool>, } impl VersionControlProjectInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod version_control_project_info { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum DefaultSourceControlType { - #[serde(rename = "tfvc")] - Tfvc, - #[serde(rename = "git")] - Git, - } -} -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum DefaultSourceControlType { + #[serde(rename = "tfvc")] + Tfvc, + #[serde(rename = "git")] + Git, + } +} +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/token_admin/mod.rs b/azure_devops_rust_api/src/token_admin/mod.rs index 438dad4a..a0593d59 100644 --- a/azure_devops_rust_api/src/token_admin/mod.rs +++ b/azure_devops_rust_api/src/token_admin/mod.rs @@ -9,494 +9,499 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://vssps.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self - } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self - } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self - } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self - } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } } impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } + } + 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()) + } +} +pub mod personal_access_tokens { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `subject_descriptor`: The descriptor of the target user."] + pub fn list( + &self, + organization: impl Into<String>, + subject_descriptor: impl Into<String>, + ) -> 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 fn personal_access_tokens_client(&self) -> personal_access_tokens::Client { - personal_access_tokens::Client(self.clone()) + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TokenAdminPagedSessionTokens> { + let bytes = self.0.into_body().collect().await?; + let body: models::TokenAdminPagedSessionTokens = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub fn revocation_rules_client(&self) -> revocation_rules::Client { - revocation_rules::Client(self.clone()) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn revocations_client(&self) -> revocations::Client { - revocations::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } -} -pub mod personal_access_tokens { - use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `subject_descriptor`: The descriptor of the target user."] - pub fn list( - &self, - organization: impl Into<String>, - subject_descriptor: impl Into<String>, - ) -> 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, - } - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) subject_descriptor: String, + pub(crate) page_size: Option<i32>, + pub(crate) continuation_token: Option<String>, + pub(crate) is_public: Option<bool>, } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TokenAdminPagedSessionTokens> { - let bytes = self.0.into_body().collect().await?; - let body: models::TokenAdminPagedSessionTokens = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) subject_descriptor: String, - pub(crate) page_size: Option<i32>, - pub(crate) continuation_token: Option<String>, - pub(crate) is_public: Option<bool>, - } - 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); - self - } - #[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<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self + 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); + self + } + #[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<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tokenadmin/personalaccesstokens/{}", + this.client.endpoint(), + &this.organization, + &this.subject_descriptor + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); } - #[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 + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(page_size) = &this.page_size { + req + .url_mut() + .query_pairs_mut() + .append_pair("pageSize", &page_size.to_string()); } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tokenadmin/personalaccesstokens/{}", - this.client.endpoint(), - &this.organization, - &this.subject_descriptor - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + if let Some(continuation_token) = &this.continuation_token { + req + .url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TokenAdminPagedSessionTokens>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TokenAdminPagedSessionTokens>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TokenAdminPagedSessionTokens>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::TokenAdminPagedSessionTokens>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } pub mod revocation_rules { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The revocation rule to create. The rule must specify a space-separated list of scopes, after which preexisting OAuth authorizations that match that any of the scopes will be rejected. For a list of all OAuth scopes supported by VSTS, see:<https://docs>.microsoft.com/en-us/vsts/integrate/get-started/authentication/oauth?view=vsts#scopes The rule may also specify the time before which to revoke tokens."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::TokenAdminRevocationRule>, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + pub mod create { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The revocation rule to create. The rule must specify a space-separated list of scopes, after which preexisting OAuth authorizations that match that any of the scopes will be rejected. For a list of all OAuth scopes supported by VSTS, see:<https://docs>.microsoft.com/en-us/vsts/integrate/get-started/authentication/oauth?view=vsts#scopes The rule may also specify the time before which to revoke tokens."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::TokenAdminRevocationRule>, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TokenAdminRevocationRule, } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TokenAdminRevocationRule, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tokenadmin/revocationrules", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tokenadmin/revocationrules", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); } - } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod revocations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Revokes the listed OAuth authorizations."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The list of objects containing the authorization IDs of the OAuth authorizations, such as session tokens retrieved by listed a users PATs, that should be revoked."] + pub fn revoke_authorizations( + &self, + organization: impl Into<String>, + body: Vec<models::TokenAdminRevocation>, + ) -> revoke_authorizations::RequestBuilder { + revoke_authorizations::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + is_public: None, + } + } + } + pub mod revoke_authorizations { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Revokes the listed OAuth authorizations."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The list of objects containing the authorization IDs of the OAuth authorizations, such as session tokens retrieved by listed a users PATs, that should be revoked."] - pub fn revoke_authorizations( - &self, - organization: impl Into<String>, - body: Vec<models::TokenAdminRevocation>, - ) -> revoke_authorizations::RequestBuilder { - revoke_authorizations::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body, - is_public: None, - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::TokenAdminRevocation>, + pub(crate) is_public: Option<bool>, } - pub mod revoke_authorizations { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::TokenAdminRevocation>, - pub(crate) is_public: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tokenadmin/revocations", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tokenadmin/revocations", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } diff --git a/azure_devops_rust_api/src/token_admin/models.rs b/azure_devops_rust_api/src/token_admin/models.rs index a83c3f9f..fb26870b 100644 --- a/azure_devops_rust_api/src/token_admin/models.rs +++ b/azure_devops_rust_api/src/token_admin/models.rs @@ -8,235 +8,227 @@ use std::str::FromStr; #[doc = "Represents a session token used to access Azure DevOps resources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SessionToken { - #[serde(rename = "accessId", default, skip_serializing_if = "Option::is_none")] - pub access_id: Option<String>, - #[doc = "This is populated when user requests a compact token. The alternate token value is self describing token."] - #[serde( - rename = "alternateToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub alternate_token: Option<String>, - #[serde( - rename = "authorizationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub claims: Option<serde_json::Value>, - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option<String>, - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde( - rename = "hostAuthorizationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub host_authorization_id: Option<String>, - #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] - pub is_public: Option<bool>, - #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] - pub is_valid: Option<bool>, - #[serde( - rename = "publicData", - default, - skip_serializing_if = "Option::is_none" - )] - pub public_data: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<String>, - #[serde( - rename = "targetAccounts", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub target_accounts: Vec<String>, - #[doc = "This is computed and not returned in Get queries"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub token: Option<String>, - #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] - pub user_id: Option<String>, - #[serde( - rename = "validFrom", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub valid_from: Option<time::OffsetDateTime>, - #[serde( - rename = "validTo", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub valid_to: Option<time::OffsetDateTime>, + #[serde(rename = "accessId", default, skip_serializing_if = "Option::is_none")] + pub access_id: Option<String>, + #[doc = "This is populated when user requests a compact token. The alternate token value is self describing token."] + #[serde( + rename = "alternateToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub alternate_token: Option<String>, + #[serde( + rename = "authorizationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorization_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub claims: Option<serde_json::Value>, + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde( + rename = "hostAuthorizationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub host_authorization_id: Option<String>, + #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] + pub is_public: Option<bool>, + #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] + pub is_valid: Option<bool>, + #[serde( + rename = "publicData", + default, + skip_serializing_if = "Option::is_none" + )] + pub public_data: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<String>, + #[serde( + rename = "targetAccounts", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub target_accounts: Vec<String>, + #[doc = "This is computed and not returned in Get queries"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option<String>, + #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] + pub user_id: Option<String>, + #[serde( + rename = "validFrom", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub valid_from: Option<time::OffsetDateTime>, + #[serde( + rename = "validTo", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub valid_to: Option<time::OffsetDateTime>, } impl SessionToken { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SessionTokenResult { - #[serde(rename = "hasError", default, skip_serializing_if = "Option::is_none")] - pub has_error: Option<bool>, - #[doc = "Represents a session token used to access Azure DevOps resources"] - #[serde( - rename = "sessionToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub session_token: Option<SessionToken>, - #[serde( - rename = "sessionTokenError", - default, - skip_serializing_if = "Option::is_none" - )] - pub session_token_error: Option<session_token_result::SessionTokenError>, + #[serde(rename = "hasError", default, skip_serializing_if = "Option::is_none")] + pub has_error: Option<bool>, + #[doc = "Represents a session token used to access Azure DevOps resources"] + #[serde( + rename = "sessionToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub session_token: Option<SessionToken>, + #[serde( + rename = "sessionTokenError", + default, + skip_serializing_if = "Option::is_none" + )] + pub session_token_error: Option<session_token_result::SessionTokenError>, } impl SessionTokenResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod session_token_result { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum SessionTokenError { - #[serde(rename = "none")] - None, - #[serde(rename = "displayNameRequired")] - DisplayNameRequired, - #[serde(rename = "invalidDisplayName")] - InvalidDisplayName, - #[serde(rename = "invalidValidTo")] - InvalidValidTo, - #[serde(rename = "invalidScope")] - InvalidScope, - #[serde(rename = "userIdRequired")] - UserIdRequired, - #[serde(rename = "invalidUserId")] - InvalidUserId, - #[serde(rename = "invalidUserType")] - InvalidUserType, - #[serde(rename = "accessDenied")] - AccessDenied, - #[serde(rename = "failedToIssueAccessToken")] - FailedToIssueAccessToken, - #[serde(rename = "invalidClient")] - InvalidClient, - #[serde(rename = "invalidClientType")] - InvalidClientType, - #[serde(rename = "invalidClientId")] - InvalidClientId, - #[serde(rename = "invalidTargetAccounts")] - InvalidTargetAccounts, - #[serde(rename = "hostAuthorizationNotFound")] - HostAuthorizationNotFound, - #[serde(rename = "authorizationNotFound")] - AuthorizationNotFound, - #[serde(rename = "failedToUpdateAccessToken")] - FailedToUpdateAccessToken, - #[serde(rename = "sourceNotSupported")] - SourceNotSupported, - #[serde(rename = "invalidSourceIP")] - InvalidSourceIp, - #[serde(rename = "invalidSource")] - InvalidSource, - #[serde(rename = "duplicateHash")] - DuplicateHash, - #[serde(rename = "sshPolicyDisabled")] - SshPolicyDisabled, - #[serde(rename = "invalidToken")] - InvalidToken, - #[serde(rename = "tokenNotFound")] - TokenNotFound, - #[serde(rename = "invalidAuthorizationId")] - InvalidAuthorizationId, - #[serde(rename = "failedToReadTenantPolicy")] - FailedToReadTenantPolicy, - #[serde(rename = "globalPatPolicyViolation")] - GlobalPatPolicyViolation, - #[serde(rename = "fullScopePatPolicyViolation")] - FullScopePatPolicyViolation, - #[serde(rename = "patLifespanPolicyViolation")] - PatLifespanPolicyViolation, - #[serde(rename = "invalidTokenType")] - InvalidTokenType, - #[serde(rename = "invalidAudience")] - InvalidAudience, - #[serde(rename = "invalidSubject")] - InvalidSubject, - #[serde(rename = "deploymentHostNotSupported")] - DeploymentHostNotSupported, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum SessionTokenError { + #[serde(rename = "none")] + None, + #[serde(rename = "displayNameRequired")] + DisplayNameRequired, + #[serde(rename = "invalidDisplayName")] + InvalidDisplayName, + #[serde(rename = "invalidValidTo")] + InvalidValidTo, + #[serde(rename = "invalidScope")] + InvalidScope, + #[serde(rename = "userIdRequired")] + UserIdRequired, + #[serde(rename = "invalidUserId")] + InvalidUserId, + #[serde(rename = "invalidUserType")] + InvalidUserType, + #[serde(rename = "accessDenied")] + AccessDenied, + #[serde(rename = "failedToIssueAccessToken")] + FailedToIssueAccessToken, + #[serde(rename = "invalidClient")] + InvalidClient, + #[serde(rename = "invalidClientType")] + InvalidClientType, + #[serde(rename = "invalidClientId")] + InvalidClientId, + #[serde(rename = "invalidTargetAccounts")] + InvalidTargetAccounts, + #[serde(rename = "hostAuthorizationNotFound")] + HostAuthorizationNotFound, + #[serde(rename = "authorizationNotFound")] + AuthorizationNotFound, + #[serde(rename = "failedToUpdateAccessToken")] + FailedToUpdateAccessToken, + #[serde(rename = "sourceNotSupported")] + SourceNotSupported, + #[serde(rename = "invalidSourceIP")] + InvalidSourceIp, + #[serde(rename = "invalidSource")] + InvalidSource, + #[serde(rename = "duplicateHash")] + DuplicateHash, + #[serde(rename = "sshPolicyDisabled")] + SshPolicyDisabled, + #[serde(rename = "invalidToken")] + InvalidToken, + #[serde(rename = "tokenNotFound")] + TokenNotFound, + #[serde(rename = "invalidAuthorizationId")] + InvalidAuthorizationId, + #[serde(rename = "failedToReadTenantPolicy")] + FailedToReadTenantPolicy, + #[serde(rename = "globalPatPolicyViolation")] + GlobalPatPolicyViolation, + #[serde(rename = "fullScopePatPolicyViolation")] + FullScopePatPolicyViolation, + #[serde(rename = "patLifespanPolicyViolation")] + PatLifespanPolicyViolation, + } } #[doc = "A paginated list of session tokens. Session tokens correspond to OAuth credentials such as personal access tokens (PATs) and other OAuth authorizations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TokenAdminPagedSessionTokens { - #[doc = "The continuation token that can be used to retrieve the next page of session tokens, or <code>null</code> if there is no next page."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[doc = "The list of all session tokens in the current page."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<SessionToken>, + #[doc = "The continuation token that can be used to retrieve the next page of session tokens, or <code>null</code> if there is no next page."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[doc = "The list of all session tokens in the current page."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<SessionToken>, } impl TokenAdminPagedSessionTokens { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A request to revoke a particular delegated authorization."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TokenAdminRevocation { - #[doc = "The authorization ID of the OAuth authorization to revoke."] - #[serde( - rename = "authorizationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_id: Option<String>, + #[doc = "The authorization ID of the OAuth authorization to revoke."] + #[serde( + rename = "authorizationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorization_id: Option<String>, } impl TokenAdminRevocation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A rule which is applied to disable any incoming delegated authorization which matches the given properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TokenAdminRevocationRule { - #[doc = "A datetime cutoff. Tokens created before this time will be rejected. This is an optional parameter. If omitted, defaults to the time at which the rule was created."] - #[serde( - rename = "createdBefore", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_before: Option<time::OffsetDateTime>, - #[doc = "A string containing a space-delimited list of OAuth scopes. A token matching any one of the scopes will be rejected. For a list of all OAuth scopes supported by Azure DevOps, see:<https://docs>.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops#scopes This is a mandatory parameter."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scopes: Option<String>, + #[doc = "A datetime cutoff. Tokens created before this time will be rejected. This is an optional parameter. If omitted, defaults to the time at which the rule was created."] + #[serde( + rename = "createdBefore", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_before: Option<time::OffsetDateTime>, + #[doc = "A string containing a space-delimited list of OAuth scopes. A token matching any one of the scopes will be rejected. For a list of all OAuth scopes supported by Azure DevOps, see:<https://docs>.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops#scopes This is a mandatory parameter."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scopes: Option<String>, } impl TokenAdminRevocationRule { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/tokens/mod.rs b/azure_devops_rust_api/src/tokens/mod.rs index eb2ab99a..4d23c1e3 100644 --- a/azure_devops_rust_api/src/tokens/mod.rs +++ b/azure_devops_rust_api/src/tokens/mod.rs @@ -9,750 +9,759 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://vssps.dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + pub fn pats_client(&self) -> pats::Client { + pats::Client(self.clone()) + } +} +pub mod pats { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> 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 = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Gets a single personal access token (PAT)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `authorization_id`: The authorizationId identifying a single, unique personal access token (PAT)"] + pub fn get( + &self, + organization: impl Into<String>, + authorization_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::PatTokenCreateRequest>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::PatTokenUpdateRequest>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `authorization_id`: The authorizationId identifying a single, unique personal access token (PAT)"] + pub fn revoke( + &self, + organization: impl Into<String>, + authorization_id: impl Into<String>, + ) -> revoke::RequestBuilder { + revoke::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + authorization_id: authorization_id.into(), + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PagedPatTokens> { + let bytes = self.0.into_body().collect().await?; + let body: models::PagedPatTokens = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) display_filter_option: Option<String>, + pub(crate) sort_by_option: Option<String>, + pub(crate) is_sort_ascending: Option<bool>, + pub(crate) continuation_token: Option<String>, + pub(crate) top: Option<i32>, + } + impl RequestBuilder { + #[doc = "(Optional) Refers to the status of the personal access token (PAT)"] + pub fn display_filter_option(mut self, display_filter_option: impl Into<String>) -> Self { + self.display_filter_option = Some(display_filter_option.into()); + self + } + #[doc = "(Optional) Which field to sort by"] + pub fn sort_by_option(mut self, sort_by_option: impl Into<String>) -> Self { + self.sort_by_option = Some(sort_by_option.into()); self + } + #[doc = "(Optional) Ascending or descending"] + pub fn is_sort_ascending(mut self, is_sort_ascending: bool) -> Self { + self.is_sort_ascending = Some(is_sort_ascending); + self + } + #[doc = "(Optional) Where to start returning tokens from"] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "(Optional) How many tokens to return, limit of 100"] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tokens/pats?", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(display_filter_option) = &this.display_filter_option { + req + .url_mut() + .query_pairs_mut() + .append_pair("displayFilterOption", display_filter_option); + } + if let Some(sort_by_option) = &this.sort_by_option { + req + .url_mut() + .query_pairs_mut() + .append_pair("sortByOption", sort_by_option); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PagedPatTokens>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PagedPatTokens>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - pub fn pats_client(&self) -> pats::Client { - pats::Client(self.clone()) + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PatTokenResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::PatTokenResult = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod pats { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) authorization_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tokens/pats", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let authorization_id = &this.authorization_id; + req + .url_mut() + .query_pairs_mut() + .append_pair("authorizationId", authorization_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PatTokenResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PatTokenResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `authorization_id`: The authorizationId identifying a single, unique personal access token (PAT)"] - pub fn get( - &self, - organization: impl Into<String>, - authorization_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::PatTokenCreateRequest>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::PatTokenUpdateRequest>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `authorization_id`: The authorizationId identifying a single, unique personal access token (PAT)"] - pub fn revoke( - &self, - organization: impl Into<String>, - authorization_id: impl Into<String>, - ) -> revoke::RequestBuilder { - revoke::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - authorization_id: authorization_id.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PagedPatTokens> { - let bytes = self.0.into_body().collect().await?; - let body: models::PagedPatTokens = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) display_filter_option: Option<String>, - pub(crate) sort_by_option: Option<String>, - pub(crate) is_sort_ascending: Option<bool>, - pub(crate) continuation_token: Option<String>, - pub(crate) top: Option<i32>, - } - impl RequestBuilder { - #[doc = "(Optional) Refers to the status of the personal access token (PAT)"] - pub fn display_filter_option( - mut self, - display_filter_option: impl Into<String>, - ) -> Self { - self.display_filter_option = Some(display_filter_option.into()); - self - } - #[doc = "(Optional) Which field to sort by"] - pub fn sort_by_option(mut self, sort_by_option: impl Into<String>) -> Self { - self.sort_by_option = Some(sort_by_option.into()); - self - } - #[doc = "(Optional) Ascending or descending"] - pub fn is_sort_ascending(mut self, is_sort_ascending: bool) -> Self { - self.is_sort_ascending = Some(is_sort_ascending); - self - } - #[doc = "(Optional) Where to start returning tokens from"] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "(Optional) How many tokens to return, limit of 100"] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tokens/pats?", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(display_filter_option) = &this.display_filter_option { - req.url_mut() - .query_pairs_mut() - .append_pair("displayFilterOption", display_filter_option); - } - if let Some(sort_by_option) = &this.sort_by_option { - req.url_mut() - .query_pairs_mut() - .append_pair("sortByOption", sort_by_option); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PagedPatTokens>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PagedPatTokens>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PatTokenResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::PatTokenResult = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) authorization_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tokens/pats", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let authorization_id = &this.authorization_id; - req.url_mut() - .query_pairs_mut() - .append_pair("authorizationId", authorization_id); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PatTokenResult>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PatTokenResult>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PatTokenResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::PatTokenResult = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PatTokenCreateRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tokens/pats", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PatTokenResult>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PatTokenResult>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PatTokenResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::PatTokenResult = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::PatTokenUpdateRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tokens/pats", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PatTokenResult>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PatTokenResult>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod revoke { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) authorization_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/tokens/pats", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let authorization_id = &this.authorization_id; - req.url_mut() - .query_pairs_mut() - .append_pair("authorizationId", authorization_id); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PatTokenResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::PatTokenResult = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PatTokenCreateRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tokens/pats", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PatTokenResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PatTokenResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PatTokenResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::PatTokenResult = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::PatTokenUpdateRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tokens/pats", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PatTokenResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::PatTokenResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod revoke { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) authorization_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/tokens/pats", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let authorization_id = &this.authorization_id; + req + .url_mut() + .query_pairs_mut() + .append_pair("authorizationId", authorization_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } diff --git a/azure_devops_rust_api/src/tokens/models.rs b/azure_devops_rust_api/src/tokens/models.rs index 6079907c..bebc95f8 100644 --- a/azure_devops_rust_api/src/tokens/models.rs +++ b/azure_devops_rust_api/src/tokens/models.rs @@ -8,521 +8,513 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessTokenResult { - #[doc = ""] - #[serde( - rename = "accessToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub access_token: Option<JsonWebToken>, - #[serde( - rename = "accessTokenError", - default, - skip_serializing_if = "Option::is_none" - )] - pub access_token_error: Option<access_token_result::AccessTokenError>, - #[serde( - rename = "authorizationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_id: Option<String>, - #[serde( - rename = "errorDescription", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_description: Option<String>, - #[serde(rename = "hasError", default, skip_serializing_if = "Option::is_none")] - pub has_error: Option<bool>, - #[serde( - rename = "isFirstPartyClient", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_first_party_client: Option<bool>, - #[doc = ""] - #[serde( - rename = "refreshToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub refresh_token: Option<RefreshTokenGrant>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, - #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] - pub token_type: Option<String>, - #[serde( - rename = "validTo", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub valid_to: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "accessToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub access_token: Option<JsonWebToken>, + #[serde( + rename = "accessTokenError", + default, + skip_serializing_if = "Option::is_none" + )] + pub access_token_error: Option<access_token_result::AccessTokenError>, + #[serde( + rename = "authorizationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorization_id: Option<String>, + #[serde( + rename = "errorDescription", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_description: Option<String>, + #[serde(rename = "hasError", default, skip_serializing_if = "Option::is_none")] + pub has_error: Option<bool>, + #[serde( + rename = "isFirstPartyClient", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_first_party_client: Option<bool>, + #[doc = ""] + #[serde( + rename = "refreshToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub refresh_token: Option<RefreshTokenGrant>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, + #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")] + pub token_type: Option<String>, + #[serde( + rename = "validTo", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub valid_to: Option<time::OffsetDateTime>, } impl AccessTokenResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod access_token_result { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AccessTokenError { - #[serde(rename = "none")] - None, - #[serde(rename = "grantTypeRequired")] - GrantTypeRequired, - #[serde(rename = "authorizationGrantRequired")] - AuthorizationGrantRequired, - #[serde(rename = "clientSecretRequired")] - ClientSecretRequired, - #[serde(rename = "redirectUriRequired")] - RedirectUriRequired, - #[serde(rename = "invalidAuthorizationGrant")] - InvalidAuthorizationGrant, - #[serde(rename = "invalidAuthorizationScopes")] - InvalidAuthorizationScopes, - #[serde(rename = "invalidRefreshToken")] - InvalidRefreshToken, - #[serde(rename = "authorizationNotFound")] - AuthorizationNotFound, - #[serde(rename = "authorizationGrantExpired")] - AuthorizationGrantExpired, - #[serde(rename = "accessAlreadyIssued")] - AccessAlreadyIssued, - #[serde(rename = "invalidRedirectUri")] - InvalidRedirectUri, - #[serde(rename = "accessTokenNotFound")] - AccessTokenNotFound, - #[serde(rename = "invalidAccessToken")] - InvalidAccessToken, - #[serde(rename = "accessTokenAlreadyRefreshed")] - AccessTokenAlreadyRefreshed, - #[serde(rename = "invalidClientSecret")] - InvalidClientSecret, - #[serde(rename = "clientSecretExpired")] - ClientSecretExpired, - #[serde(rename = "serverError")] - ServerError, - #[serde(rename = "accessDenied")] - AccessDenied, - #[serde(rename = "accessTokenKeyRequired")] - AccessTokenKeyRequired, - #[serde(rename = "invalidAccessTokenKey")] - InvalidAccessTokenKey, - #[serde(rename = "failedToGetAccessToken")] - FailedToGetAccessToken, - #[serde(rename = "invalidClientId")] - InvalidClientId, - #[serde(rename = "invalidClient")] - InvalidClient, - #[serde(rename = "invalidValidTo")] - InvalidValidTo, - #[serde(rename = "invalidUserId")] - InvalidUserId, - #[serde(rename = "failedToIssueAccessToken")] - FailedToIssueAccessToken, - #[serde(rename = "authorizationGrantScopeMissing")] - AuthorizationGrantScopeMissing, - #[serde(rename = "invalidPublicAccessTokenKey")] - InvalidPublicAccessTokenKey, - #[serde(rename = "invalidPublicAccessToken")] - InvalidPublicAccessToken, - #[serde(rename = "publicFeatureFlagNotEnabled")] - PublicFeatureFlagNotEnabled, - #[serde(rename = "sshPolicyDisabled")] - SshPolicyDisabled, - #[serde(rename = "hostAuthorizationNotFound")] - HostAuthorizationNotFound, - #[serde(rename = "hostAuthorizationIsNotValid")] - HostAuthorizationIsNotValid, - #[serde(rename = "invalidScope")] - InvalidScope, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AccessTokenError { + #[serde(rename = "none")] + None, + #[serde(rename = "grantTypeRequired")] + GrantTypeRequired, + #[serde(rename = "authorizationGrantRequired")] + AuthorizationGrantRequired, + #[serde(rename = "clientSecretRequired")] + ClientSecretRequired, + #[serde(rename = "redirectUriRequired")] + RedirectUriRequired, + #[serde(rename = "invalidAuthorizationGrant")] + InvalidAuthorizationGrant, + #[serde(rename = "invalidAuthorizationScopes")] + InvalidAuthorizationScopes, + #[serde(rename = "invalidRefreshToken")] + InvalidRefreshToken, + #[serde(rename = "authorizationNotFound")] + AuthorizationNotFound, + #[serde(rename = "authorizationGrantExpired")] + AuthorizationGrantExpired, + #[serde(rename = "accessAlreadyIssued")] + AccessAlreadyIssued, + #[serde(rename = "invalidRedirectUri")] + InvalidRedirectUri, + #[serde(rename = "accessTokenNotFound")] + AccessTokenNotFound, + #[serde(rename = "invalidAccessToken")] + InvalidAccessToken, + #[serde(rename = "accessTokenAlreadyRefreshed")] + AccessTokenAlreadyRefreshed, + #[serde(rename = "invalidClientSecret")] + InvalidClientSecret, + #[serde(rename = "clientSecretExpired")] + ClientSecretExpired, + #[serde(rename = "serverError")] + ServerError, + #[serde(rename = "accessDenied")] + AccessDenied, + #[serde(rename = "accessTokenKeyRequired")] + AccessTokenKeyRequired, + #[serde(rename = "invalidAccessTokenKey")] + InvalidAccessTokenKey, + #[serde(rename = "failedToGetAccessToken")] + FailedToGetAccessToken, + #[serde(rename = "invalidClientId")] + InvalidClientId, + #[serde(rename = "invalidClient")] + InvalidClient, + #[serde(rename = "invalidValidTo")] + InvalidValidTo, + #[serde(rename = "invalidUserId")] + InvalidUserId, + #[serde(rename = "failedToIssueAccessToken")] + FailedToIssueAccessToken, + #[serde(rename = "authorizationGrantScopeMissing")] + AuthorizationGrantScopeMissing, + #[serde(rename = "invalidPublicAccessTokenKey")] + InvalidPublicAccessTokenKey, + #[serde(rename = "invalidPublicAccessToken")] + InvalidPublicAccessToken, + #[serde(rename = "publicFeatureFlagNotEnabled")] + PublicFeatureFlagNotEnabled, + #[serde(rename = "sshPolicyDisabled")] + SshPolicyDisabled, + #[serde(rename = "hostAuthorizationNotFound")] + HostAuthorizationNotFound, + #[serde(rename = "hostAuthorizationIsNotValid")] + HostAuthorizationIsNotValid, + #[serde(rename = "invalidScope")] + InvalidScope, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AuthorizationGrant { - #[serde(rename = "grantType", default, skip_serializing_if = "Option::is_none")] - pub grant_type: Option<authorization_grant::GrantType>, + #[serde(rename = "grantType", default, skip_serializing_if = "Option::is_none")] + pub grant_type: Option<authorization_grant::GrantType>, } impl AuthorizationGrant { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod authorization_grant { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum GrantType { - #[serde(rename = "none")] - None, - #[serde(rename = "jwtBearer")] - JwtBearer, - #[serde(rename = "refreshToken")] - RefreshToken, - #[serde(rename = "implicit")] - Implicit, - #[serde(rename = "clientCredentials")] - ClientCredentials, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum GrantType { + #[serde(rename = "none")] + None, + #[serde(rename = "jwtBearer")] + JwtBearer, + #[serde(rename = "refreshToken")] + RefreshToken, + #[serde(rename = "implicit")] + Implicit, + #[serde(rename = "clientCredentials")] + ClientCredentials, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IssuedToken { - #[serde( - rename = "isAuthenticated", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_authenticated: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, + #[serde( + rename = "isAuthenticated", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_authenticated: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, } impl IssuedToken { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonWebToken { - #[serde(flatten)] - pub issued_token: IssuedToken, + #[serde(flatten)] + pub issued_token: IssuedToken, } impl JsonWebToken { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Returned by the List method; contains a list of personal access tokens (PATs) and the continuation token to get the next page of results"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PagedPatTokens { - #[doc = "Used to access the next page of results in successive API calls to list personal access tokens (PATs)"] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[doc = "The list of personal access tokens (PATs)"] - #[serde( - rename = "patTokens", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub pat_tokens: Vec<PatToken>, + #[doc = "Used to access the next page of results in successive API calls to list personal access tokens (PATs)"] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[doc = "The list of personal access tokens (PATs)"] + #[serde( + rename = "patTokens", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub pat_tokens: Vec<PatToken>, } impl PagedPatTokens { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a personal access token (PAT) used to access Azure DevOps resources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PatToken { - #[doc = "Unique guid identifier"] - #[serde( - rename = "authorizationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_id: Option<String>, - #[doc = "The token name"] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "The token scopes for accessing Azure DevOps resources"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, - #[doc = "The organizations for which the token is valid; null if the token applies to all of the user's accessible organizations"] - #[serde( - rename = "targetAccounts", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub target_accounts: Vec<String>, - #[doc = "The unique token string generated at creation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub token: Option<String>, - #[doc = "The token creation date"] - #[serde( - rename = "validFrom", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub valid_from: Option<time::OffsetDateTime>, - #[doc = "The token expiration date"] - #[serde( - rename = "validTo", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub valid_to: Option<time::OffsetDateTime>, + #[doc = "Unique guid identifier"] + #[serde( + rename = "authorizationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorization_id: Option<String>, + #[doc = "The token name"] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "The token scopes for accessing Azure DevOps resources"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, + #[doc = "The organizations for which the token is valid; null if the token applies to all of the user's accessible organizations"] + #[serde( + rename = "targetAccounts", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub target_accounts: Vec<String>, + #[doc = "The unique token string generated at creation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option<String>, + #[doc = "The token creation date"] + #[serde( + rename = "validFrom", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub valid_from: Option<time::OffsetDateTime>, + #[doc = "The token expiration date"] + #[serde( + rename = "validTo", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub valid_to: Option<time::OffsetDateTime>, } impl PatToken { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Encapsulates the request parameters for creating a new personal access token (PAT)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PatTokenCreateRequest { - #[doc = "True, if this personal access token (PAT) is for all of the user's accessible organizations. False, if otherwise (e.g. if the token is for a specific organization)"] - #[serde(rename = "allOrgs", default, skip_serializing_if = "Option::is_none")] - pub all_orgs: Option<bool>, - #[doc = "The token name"] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "The token scopes for accessing Azure DevOps resources"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, - #[doc = "The token expiration date"] - #[serde( - rename = "validTo", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub valid_to: Option<time::OffsetDateTime>, + #[doc = "True, if this personal access token (PAT) is for all of the user's accessible organizations. False, if otherwise (e.g. if the token is for a specific organization)"] + #[serde(rename = "allOrgs", default, skip_serializing_if = "Option::is_none")] + pub all_orgs: Option<bool>, + #[doc = "The token name"] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "The token scopes for accessing Azure DevOps resources"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, + #[doc = "The token expiration date"] + #[serde( + rename = "validTo", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub valid_to: Option<time::OffsetDateTime>, } impl PatTokenCreateRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contains the resulting personal access token (PAT) and the error (if any) that occurred during the operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PatTokenResult { - #[doc = "Represents a personal access token (PAT) used to access Azure DevOps resources"] - #[serde(rename = "patToken", default, skip_serializing_if = "Option::is_none")] - pub pat_token: Option<PatToken>, - #[doc = "The error (if any) that occurred"] - #[serde( - rename = "patTokenError", - default, - skip_serializing_if = "Option::is_none" - )] - pub pat_token_error: Option<pat_token_result::PatTokenError>, + #[doc = "Represents a personal access token (PAT) used to access Azure DevOps resources"] + #[serde(rename = "patToken", default, skip_serializing_if = "Option::is_none")] + pub pat_token: Option<PatToken>, + #[doc = "The error (if any) that occurred"] + #[serde( + rename = "patTokenError", + default, + skip_serializing_if = "Option::is_none" + )] + pub pat_token_error: Option<pat_token_result::PatTokenError>, } impl PatTokenResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod pat_token_result { - use super::*; - #[doc = "The error (if any) that occurred"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum PatTokenError { - #[serde(rename = "none")] - None, - #[serde(rename = "displayNameRequired")] - DisplayNameRequired, - #[serde(rename = "invalidDisplayName")] - InvalidDisplayName, - #[serde(rename = "invalidValidTo")] - InvalidValidTo, - #[serde(rename = "invalidScope")] - InvalidScope, - #[serde(rename = "userIdRequired")] - UserIdRequired, - #[serde(rename = "invalidUserId")] - InvalidUserId, - #[serde(rename = "invalidUserType")] - InvalidUserType, - #[serde(rename = "accessDenied")] - AccessDenied, - #[serde(rename = "failedToIssueAccessToken")] - FailedToIssueAccessToken, - #[serde(rename = "invalidClient")] - InvalidClient, - #[serde(rename = "invalidClientType")] - InvalidClientType, - #[serde(rename = "invalidClientId")] - InvalidClientId, - #[serde(rename = "invalidTargetAccounts")] - InvalidTargetAccounts, - #[serde(rename = "hostAuthorizationNotFound")] - HostAuthorizationNotFound, - #[serde(rename = "authorizationNotFound")] - AuthorizationNotFound, - #[serde(rename = "failedToUpdateAccessToken")] - FailedToUpdateAccessToken, - #[serde(rename = "sourceNotSupported")] - SourceNotSupported, - #[serde(rename = "invalidSourceIP")] - InvalidSourceIp, - #[serde(rename = "invalidSource")] - InvalidSource, - #[serde(rename = "duplicateHash")] - DuplicateHash, - #[serde(rename = "sshPolicyDisabled")] - SshPolicyDisabled, - #[serde(rename = "invalidToken")] - InvalidToken, - #[serde(rename = "tokenNotFound")] - TokenNotFound, - #[serde(rename = "invalidAuthorizationId")] - InvalidAuthorizationId, - #[serde(rename = "failedToReadTenantPolicy")] - FailedToReadTenantPolicy, - #[serde(rename = "globalPatPolicyViolation")] - GlobalPatPolicyViolation, - #[serde(rename = "fullScopePatPolicyViolation")] - FullScopePatPolicyViolation, - #[serde(rename = "patLifespanPolicyViolation")] - PatLifespanPolicyViolation, - #[serde(rename = "invalidTokenType")] - InvalidTokenType, - #[serde(rename = "invalidAudience")] - InvalidAudience, - #[serde(rename = "invalidSubject")] - InvalidSubject, - #[serde(rename = "deploymentHostNotSupported")] - DeploymentHostNotSupported, - } + use super::*; + #[doc = "The error (if any) that occurred"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum PatTokenError { + #[serde(rename = "none")] + None, + #[serde(rename = "displayNameRequired")] + DisplayNameRequired, + #[serde(rename = "invalidDisplayName")] + InvalidDisplayName, + #[serde(rename = "invalidValidTo")] + InvalidValidTo, + #[serde(rename = "invalidScope")] + InvalidScope, + #[serde(rename = "userIdRequired")] + UserIdRequired, + #[serde(rename = "invalidUserId")] + InvalidUserId, + #[serde(rename = "invalidUserType")] + InvalidUserType, + #[serde(rename = "accessDenied")] + AccessDenied, + #[serde(rename = "failedToIssueAccessToken")] + FailedToIssueAccessToken, + #[serde(rename = "invalidClient")] + InvalidClient, + #[serde(rename = "invalidClientType")] + InvalidClientType, + #[serde(rename = "invalidClientId")] + InvalidClientId, + #[serde(rename = "invalidTargetAccounts")] + InvalidTargetAccounts, + #[serde(rename = "hostAuthorizationNotFound")] + HostAuthorizationNotFound, + #[serde(rename = "authorizationNotFound")] + AuthorizationNotFound, + #[serde(rename = "failedToUpdateAccessToken")] + FailedToUpdateAccessToken, + #[serde(rename = "sourceNotSupported")] + SourceNotSupported, + #[serde(rename = "invalidSourceIP")] + InvalidSourceIp, + #[serde(rename = "invalidSource")] + InvalidSource, + #[serde(rename = "duplicateHash")] + DuplicateHash, + #[serde(rename = "sshPolicyDisabled")] + SshPolicyDisabled, + #[serde(rename = "invalidToken")] + InvalidToken, + #[serde(rename = "tokenNotFound")] + TokenNotFound, + #[serde(rename = "invalidAuthorizationId")] + InvalidAuthorizationId, + #[serde(rename = "failedToReadTenantPolicy")] + FailedToReadTenantPolicy, + #[serde(rename = "globalPatPolicyViolation")] + GlobalPatPolicyViolation, + #[serde(rename = "fullScopePatPolicyViolation")] + FullScopePatPolicyViolation, + #[serde(rename = "patLifespanPolicyViolation")] + PatLifespanPolicyViolation, + } } #[doc = "Encapsulates the request parameters for updating a personal access token (PAT)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PatTokenUpdateRequest { - #[doc = "(Optional) True if this personal access token (PAT) is for all of the user's accessible organizations. False if otherwise (e.g. if the token is for a specific organization)"] - #[serde(rename = "allOrgs", default, skip_serializing_if = "Option::is_none")] - pub all_orgs: Option<bool>, - #[doc = "The authorizationId identifying a single, unique personal access token (PAT)"] - #[serde( - rename = "authorizationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_id: Option<String>, - #[doc = "(Optional) The token name"] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "(Optional) The token scopes for accessing Azure DevOps resources"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, - #[doc = "(Optional) The token expiration date"] - #[serde( - rename = "validTo", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub valid_to: Option<time::OffsetDateTime>, + #[doc = "(Optional) True if this personal access token (PAT) is for all of the user's accessible organizations. False if otherwise (e.g. if the token is for a specific organization)"] + #[serde(rename = "allOrgs", default, skip_serializing_if = "Option::is_none")] + pub all_orgs: Option<bool>, + #[doc = "The authorizationId identifying a single, unique personal access token (PAT)"] + #[serde( + rename = "authorizationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorization_id: Option<String>, + #[doc = "(Optional) The token name"] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "(Optional) The token scopes for accessing Azure DevOps resources"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, + #[doc = "(Optional) The token expiration date"] + #[serde( + rename = "validTo", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub valid_to: Option<time::OffsetDateTime>, } impl PatTokenUpdateRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RefreshTokenGrant { - #[serde(flatten)] - pub authorization_grant: AuthorizationGrant, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub jwt: Option<JsonWebToken>, + #[serde(flatten)] + pub authorization_grant: AuthorizationGrant, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub jwt: Option<JsonWebToken>, } impl RefreshTokenGrant { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a session token used to access Azure DevOps resources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SessionToken { - #[serde(rename = "accessId", default, skip_serializing_if = "Option::is_none")] - pub access_id: Option<String>, - #[doc = "This is populated when user requests a compact token. The alternate token value is self describing token."] - #[serde( - rename = "alternateToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub alternate_token: Option<String>, - #[serde( - rename = "authorizationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub claims: Option<serde_json::Value>, - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option<String>, - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde( - rename = "hostAuthorizationId", - default, - skip_serializing_if = "Option::is_none" - )] - pub host_authorization_id: Option<String>, - #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] - pub is_public: Option<bool>, - #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] - pub is_valid: Option<bool>, - #[serde( - rename = "publicData", - default, - skip_serializing_if = "Option::is_none" - )] - pub public_data: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<String>, - #[serde( - rename = "targetAccounts", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub target_accounts: Vec<String>, - #[doc = "This is computed and not returned in Get queries"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub token: Option<String>, - #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] - pub user_id: Option<String>, - #[serde( - rename = "validFrom", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub valid_from: Option<time::OffsetDateTime>, - #[serde( - rename = "validTo", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub valid_to: Option<time::OffsetDateTime>, + #[serde(rename = "accessId", default, skip_serializing_if = "Option::is_none")] + pub access_id: Option<String>, + #[doc = "This is populated when user requests a compact token. The alternate token value is self describing token."] + #[serde( + rename = "alternateToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub alternate_token: Option<String>, + #[serde( + rename = "authorizationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorization_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub claims: Option<serde_json::Value>, + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde( + rename = "hostAuthorizationId", + default, + skip_serializing_if = "Option::is_none" + )] + pub host_authorization_id: Option<String>, + #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] + pub is_public: Option<bool>, + #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] + pub is_valid: Option<bool>, + #[serde( + rename = "publicData", + default, + skip_serializing_if = "Option::is_none" + )] + pub public_data: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<String>, + #[serde( + rename = "targetAccounts", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub target_accounts: Vec<String>, + #[doc = "This is computed and not returned in Get queries"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option<String>, + #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] + pub user_id: Option<String>, + #[serde( + rename = "validFrom", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub valid_from: Option<time::OffsetDateTime>, + #[serde( + rename = "validTo", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub valid_to: Option<time::OffsetDateTime>, } impl SessionToken { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/wiki/mod.rs b/azure_devops_rust_api/src/wiki/mod.rs index 383b2e8e..b22bfc60 100644 --- a/azure_devops_rust_api/src/wiki/mod.rs +++ b/azure_devops_rust_api/src/wiki/mod.rs @@ -9,2633 +9,2636 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + 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()) + } +} +pub mod wikis { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all wikis in a project or collection."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + #[doc = "Creates the wiki resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Parameters for the wiki creation."] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::WikiCreateParametersV2>, + project: impl Into<String>, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self + #[doc = "Gets the wiki corresponding to the wiki ID or wiki name provided."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + wiki_identifier: impl Into<String>, + project: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + wiki_identifier: wiki_identifier.into(), + project: project.into(), + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + #[doc = "Updates the wiki corresponding to the wiki ID or wiki name provided using the update parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Update parameters."] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::WikiUpdateParameters>, + wiki_identifier: impl Into<String>, + project: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + wiki_identifier: wiki_identifier.into(), + project: project.into(), + } } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) + #[doc = "Deletes the wiki corresponding to the wiki ID or wiki name provided."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + wiki_identifier: impl Into<String>, + project: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + wiki_identifier: wiki_identifier.into(), + project: project.into(), + } } -} -pub mod wikis { + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets all wikis in a project or collection."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - #[doc = "Creates the wiki resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Parameters for the wiki creation."] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::WikiCreateParametersV2>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - wiki_identifier: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Update parameters."] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::WikiUpdateParameters>, - wiki_identifier: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - wiki_identifier: impl Into<String>, - project: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - wiki_identifier: wiki_identifier.into(), - project: project.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiV2List> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiV2List = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiV2List>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiV2List>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiV2> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiV2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WikiCreateParametersV2, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiV2>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiV2>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiV2> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiV2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) wiki_identifier: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiV2>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiV2>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiV2> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiV2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WikiUpdateParameters, - pub(crate) wiki_identifier: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiV2>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiV2>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiV2> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiV2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) wiki_identifier: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiV2>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiV2>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiV2List> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiV2List = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiV2List>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WikiV2List>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiV2> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiV2 = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WikiCreateParametersV2, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiV2>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WikiV2>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiV2> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiV2 = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) wiki_identifier: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiV2>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WikiV2>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiV2> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiV2 = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WikiUpdateParameters, + pub(crate) wiki_identifier: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiV2>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WikiV2>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiV2> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiV2 = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) wiki_identifier: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiV2>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WikiV2>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } pub mod attachments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Creates an attachment in the wiki."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Stream to upload"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] + #[doc = "* `name`: Wiki attachment name."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<String>, + project: impl Into<String>, + wiki_identifier: impl Into<String>, + name: impl Into<String>, + ) -> 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 create { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Creates an attachment in the wiki."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Stream to upload"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] - #[doc = "* `name`: Wiki attachment name."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<String>, - project: impl Into<String>, - wiki_identifier: impl Into<String>, - name: impl Into<String>, - ) -> 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 create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiAttachment> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiAttachment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: String, - pub(crate) project: String, - pub(crate) wiki_identifier: String, - pub(crate) name: String, - pub(crate) version_descriptor_version: Option<String>, - pub(crate) version_descriptor_version_options: Option<String>, - pub(crate) version_descriptor_version_type: Option<String>, - } - impl RequestBuilder { - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn version_descriptor_version( - mut self, - version_descriptor_version: impl Into<String>, - ) -> Self { - self.version_descriptor_version = Some(version_descriptor_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn version_descriptor_version_options( - mut self, - version_descriptor_version_options: impl Into<String>, - ) -> Self { - self.version_descriptor_version_options = - Some(version_descriptor_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn version_descriptor_version_type( - mut self, - version_descriptor_version_type: impl Into<String>, - ) -> Self { - self.version_descriptor_version_type = Some(version_descriptor_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/attachments", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::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, - ); - } - 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, - ); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiAttachment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiAttachment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiAttachment> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiAttachment = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn e_tag(&self) -> azure_core::Result<&str> { + self + .0 + .get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: String, + pub(crate) project: String, + pub(crate) wiki_identifier: String, + pub(crate) name: String, + pub(crate) version_descriptor_version: Option<String>, + pub(crate) version_descriptor_version_options: Option<String>, + pub(crate) version_descriptor_version_type: Option<String>, + } + impl RequestBuilder { + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn version_descriptor_version( + mut self, + version_descriptor_version: impl Into<String>, + ) -> Self { + self.version_descriptor_version = Some(version_descriptor_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn version_descriptor_version_options( + mut self, + version_descriptor_version_options: impl Into<String>, + ) -> Self { + self.version_descriptor_version_options = Some(version_descriptor_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn version_descriptor_version_type( + mut self, + version_descriptor_version_type: impl Into<String>, + ) -> Self { + self.version_descriptor_version_type = Some(version_descriptor_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/attachments", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/octet-stream"); + let req_body = azure_core::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, + ); + } + 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, + ); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiAttachment>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WikiAttachment>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod page_moves { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Page more operation parameters."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::WikiPageMoveParameters>, + project: impl Into<String>, + wiki_identifier: impl Into<String>, + ) -> 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 create { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Page more operation parameters."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::WikiPageMoveParameters>, - project: impl Into<String>, - wiki_identifier: impl Into<String>, - ) -> 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 create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiPageMove> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPageMove = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WikiPageMoveParameters, - pub(crate) project: String, - pub(crate) wiki_identifier: String, - pub(crate) comment: Option<String>, - pub(crate) version_descriptor_version: Option<String>, - pub(crate) version_descriptor_version_options: Option<String>, - pub(crate) version_descriptor_version_type: Option<String>, - } - impl RequestBuilder { - #[doc = "Comment that is to be associated with this page move."] - pub fn comment(mut self, comment: impl Into<String>) -> Self { - self.comment = Some(comment.into()); - self - } - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn version_descriptor_version( - mut self, - version_descriptor_version: impl Into<String>, - ) -> Self { - self.version_descriptor_version = Some(version_descriptor_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn version_descriptor_version_options( - mut self, - version_descriptor_version_options: impl Into<String>, - ) -> Self { - self.version_descriptor_version_options = - Some(version_descriptor_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn version_descriptor_version_type( - mut self, - version_descriptor_version_type: impl Into<String>, - ) -> Self { - self.version_descriptor_version_type = Some(version_descriptor_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pagemoves", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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, - ); - } - 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, - ); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiPageMove>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiPageMove>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiPageMove> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiPageMove = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn e_tag(&self) -> azure_core::Result<&str> { + self + .0 + .get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WikiPageMoveParameters, + pub(crate) project: String, + pub(crate) wiki_identifier: String, + pub(crate) comment: Option<String>, + pub(crate) version_descriptor_version: Option<String>, + pub(crate) version_descriptor_version_options: Option<String>, + pub(crate) version_descriptor_version_type: Option<String>, + } + impl RequestBuilder { + #[doc = "Comment that is to be associated with this page move."] + pub fn comment(mut self, comment: impl Into<String>) -> Self { + self.comment = Some(comment.into()); + self + } + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn version_descriptor_version( + mut self, + version_descriptor_version: impl Into<String>, + ) -> Self { + self.version_descriptor_version = Some(version_descriptor_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn version_descriptor_version_options( + mut self, + version_descriptor_version_options: impl Into<String>, + ) -> Self { + self.version_descriptor_version_options = Some(version_descriptor_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn version_descriptor_version_type( + mut self, + version_descriptor_version_type: impl Into<String>, + ) -> Self { + self.version_descriptor_version_type = Some(version_descriptor_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pagemoves", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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, + ); + } + 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, + ); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiPageMove>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WikiPageMove>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod pages { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] + pub fn get_page( + &self, + organization: impl Into<String>, + project: impl Into<String>, + wiki_identifier: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Wiki create or update operation parameters."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] + #[doc = "* `path`: Wiki page path."] + #[doc = "* `if_match`: Version of the page on which the change is to be made. Mandatory for `Edit` scenario. To be populated in the If-Match header of the request."] + pub fn create_or_update( + &self, + organization: impl Into<String>, + body: impl Into<models::WikiPageCreateOrUpdateParameters>, + project: impl Into<String>, + wiki_identifier: impl Into<String>, + path: impl Into<String>, + if_match: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] + #[doc = "* `path`: Wiki page path."] + pub fn delete_page( + &self, + organization: impl Into<String>, + project: impl Into<String>, + wiki_identifier: impl Into<String>, + path: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name.."] + #[doc = "* `id`: Wiki page ID."] + pub fn get_page_by_id( + &self, + organization: impl Into<String>, + project: impl Into<String>, + wiki_identifier: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Wiki update operation parameters."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] + #[doc = "* `id`: Wiki page ID."] + #[doc = "* `if_match`: Version of the page on which the change is to be made. Mandatory for `Edit` scenario. To be populated in the If-Match header of the request."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::WikiPageCreateOrUpdateParameters>, + project: impl Into<String>, + wiki_identifier: impl Into<String>, + id: i32, + if_match: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] + #[doc = "* `id`: Wiki page ID."] + pub fn delete_page_by_id( + &self, + organization: impl Into<String>, + project: impl Into<String>, + wiki_identifier: impl Into<String>, + 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 get_page { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] - pub fn get_page( - &self, - organization: impl Into<String>, - project: impl Into<String>, - wiki_identifier: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Wiki create or update operation parameters."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] - #[doc = "* `path`: Wiki page path."] - #[doc = "* `if_match`: Version of the page on which the change is to be made. Mandatory for `Edit` scenario. To be populated in the If-Match header of the request."] - pub fn create_or_update( - &self, - organization: impl Into<String>, - body: impl Into<models::WikiPageCreateOrUpdateParameters>, - project: impl Into<String>, - wiki_identifier: impl Into<String>, - path: impl Into<String>, - if_match: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] - #[doc = "* `path`: Wiki page path."] - pub fn delete_page( - &self, - organization: impl Into<String>, - project: impl Into<String>, - wiki_identifier: impl Into<String>, - path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name.."] - #[doc = "* `id`: Wiki page ID."] - pub fn get_page_by_id( - &self, - organization: impl Into<String>, - project: impl Into<String>, - wiki_identifier: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Wiki update operation parameters."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] - #[doc = "* `id`: Wiki page ID."] - #[doc = "* `if_match`: Version of the page on which the change is to be made. Mandatory for `Edit` scenario. To be populated in the If-Match header of the request."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::WikiPageCreateOrUpdateParameters>, - project: impl Into<String>, - wiki_identifier: impl Into<String>, - id: i32, - if_match: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] - #[doc = "* `id`: Wiki page ID."] - pub fn delete_page_by_id( - &self, - organization: impl Into<String>, - project: impl Into<String>, - wiki_identifier: impl Into<String>, - 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 get_page { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiPage> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) wiki_identifier: String, - pub(crate) path: Option<String>, - pub(crate) recursion_level: Option<String>, - pub(crate) version_descriptor_version: Option<String>, - pub(crate) version_descriptor_version_options: Option<String>, - pub(crate) version_descriptor_version_type: Option<String>, - pub(crate) include_content: Option<bool>, - } - impl RequestBuilder { - #[doc = "Wiki page path."] - pub fn path(mut self, path: impl Into<String>) -> Self { - self.path = Some(path.into()); - self - } - #[doc = "Recursion level for subpages retrieval. Defaults to `None` (Optional)."] - pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self { - self.recursion_level = Some(recursion_level.into()); - self - } - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn version_descriptor_version( - mut self, - version_descriptor_version: impl Into<String>, - ) -> Self { - self.version_descriptor_version = Some(version_descriptor_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn version_descriptor_version_options( - mut self, - version_descriptor_version_options: impl Into<String>, - ) -> Self { - self.version_descriptor_version_options = - Some(version_descriptor_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn version_descriptor_version_type( - mut self, - version_descriptor_version_type: impl Into<String>, - ) -> Self { - self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); - self - } - #[doc = "Set to true to include the content of the page in the response for Json content type. Defaults to false (Optional)"] - pub fn include_content(mut self, include_content: bool) -> Self { - self.include_content = Some(include_content); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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, - ); - } - 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, - ); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiPage>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiPage>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiPage> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WikiPageCreateOrUpdateParameters, - pub(crate) project: String, - pub(crate) wiki_identifier: String, - pub(crate) path: String, - pub(crate) if_match: String, - pub(crate) comment: Option<String>, - pub(crate) version_descriptor_version: Option<String>, - pub(crate) version_descriptor_version_options: Option<String>, - pub(crate) version_descriptor_version_type: Option<String>, - } - impl RequestBuilder { - #[doc = "Comment to be associated with the page operation."] - pub fn comment(mut self, comment: impl Into<String>) -> Self { - self.comment = Some(comment.into()); - self - } - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn version_descriptor_version( - mut self, - version_descriptor_version: impl Into<String>, - ) -> Self { - self.version_descriptor_version = Some(version_descriptor_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn version_descriptor_version_options( - mut self, - version_descriptor_version_options: impl Into<String>, - ) -> Self { - self.version_descriptor_version_options = - Some(version_descriptor_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn version_descriptor_version_type( - mut self, - version_descriptor_version_type: impl Into<String>, - ) -> Self { - self.version_descriptor_version_type = Some(version_descriptor_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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, - ); - } - 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, - ); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiPage>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiPage>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_page { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiPage> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) wiki_identifier: String, - pub(crate) path: String, - pub(crate) comment: Option<String>, - pub(crate) version_descriptor_version: Option<String>, - pub(crate) version_descriptor_version_options: Option<String>, - pub(crate) version_descriptor_version_type: Option<String>, - } - impl RequestBuilder { - #[doc = "Comment to be associated with this page delete."] - pub fn comment(mut self, comment: impl Into<String>) -> Self { - self.comment = Some(comment.into()); - self - } - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn version_descriptor_version( - mut self, - version_descriptor_version: impl Into<String>, - ) -> Self { - self.version_descriptor_version = Some(version_descriptor_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn version_descriptor_version_options( - mut self, - version_descriptor_version_options: impl Into<String>, - ) -> Self { - self.version_descriptor_version_options = - Some(version_descriptor_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn version_descriptor_version_type( - mut self, - version_descriptor_version_type: impl Into<String>, - ) -> Self { - self.version_descriptor_version_type = Some(version_descriptor_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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, - ); - } - 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, - ); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiPage>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiPage>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_page_by_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiPage> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) wiki_identifier: String, - pub(crate) id: i32, - pub(crate) recursion_level: Option<String>, - pub(crate) include_content: Option<bool>, - } - impl RequestBuilder { - #[doc = "Recursion level for subpages retrieval. Defaults to `None` (Optional)."] - pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self { - self.recursion_level = Some(recursion_level.into()); - self - } - #[doc = "Set to true to include the content of the page in the response for Json content type. Defaults to false (Optional)"] - pub fn include_content(mut self, include_content: bool) -> Self { - self.include_content = Some(include_content); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(recursion_level) = &this.recursion_level { - req.url_mut() - .query_pairs_mut() - .append_pair("recursionLevel", recursion_level); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiPage>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiPage>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiPage> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WikiPageCreateOrUpdateParameters, - pub(crate) project: String, - pub(crate) wiki_identifier: String, - pub(crate) id: i32, - pub(crate) if_match: String, - pub(crate) comment: Option<String>, - } - impl RequestBuilder { - #[doc = "Comment to be associated with the page operation."] - pub fn comment(mut self, comment: impl Into<String>) -> Self { - self.comment = Some(comment.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiPage>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiPage>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_page_by_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiPage> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) wiki_identifier: String, - pub(crate) id: i32, - pub(crate) comment: Option<String>, - } - impl RequestBuilder { - #[doc = "Comment to be associated with this page delete."] - pub fn comment(mut self, comment: impl Into<String>) -> Self { - self.comment = Some(comment.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(comment) = &this.comment { - req.url_mut() - .query_pairs_mut() - .append_pair("comment", comment); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiPage>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiPage>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiPage> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn e_tag(&self) -> azure_core::Result<&str> { + self + .0 + .get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) wiki_identifier: String, + pub(crate) path: Option<String>, + pub(crate) recursion_level: Option<String>, + pub(crate) version_descriptor_version: Option<String>, + pub(crate) version_descriptor_version_options: Option<String>, + pub(crate) version_descriptor_version_type: Option<String>, + pub(crate) include_content: Option<bool>, + } + impl RequestBuilder { + #[doc = "Wiki page path."] + pub fn path(mut self, path: impl Into<String>) -> Self { + self.path = Some(path.into()); + self + } + #[doc = "Recursion level for subpages retrieval. Defaults to `None` (Optional)."] + pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self { + self.recursion_level = Some(recursion_level.into()); + self + } + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn version_descriptor_version( + mut self, + version_descriptor_version: impl Into<String>, + ) -> Self { + self.version_descriptor_version = Some(version_descriptor_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn version_descriptor_version_options( + mut self, + version_descriptor_version_options: impl Into<String>, + ) -> Self { + self.version_descriptor_version_options = Some(version_descriptor_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn version_descriptor_version_type( + mut self, + version_descriptor_version_type: impl Into<String>, + ) -> Self { + self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); + self + } + #[doc = "Set to true to include the content of the page in the response for Json content type. Defaults to false (Optional)"] + pub fn include_content(mut self, include_content: bool) -> Self { + self.include_content = Some(include_content); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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, + ); + } + 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, + ); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiPage>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WikiPage>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiPage> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn e_tag(&self) -> azure_core::Result<&str> { + self + .0 + .get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WikiPageCreateOrUpdateParameters, + pub(crate) project: String, + pub(crate) wiki_identifier: String, + pub(crate) path: String, + pub(crate) if_match: String, + pub(crate) comment: Option<String>, + pub(crate) version_descriptor_version: Option<String>, + pub(crate) version_descriptor_version_options: Option<String>, + pub(crate) version_descriptor_version_type: Option<String>, + } + impl RequestBuilder { + #[doc = "Comment to be associated with the page operation."] + pub fn comment(mut self, comment: impl Into<String>) -> Self { + self.comment = Some(comment.into()); + self + } + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn version_descriptor_version( + mut self, + version_descriptor_version: impl Into<String>, + ) -> Self { + self.version_descriptor_version = Some(version_descriptor_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn version_descriptor_version_options( + mut self, + version_descriptor_version_options: impl Into<String>, + ) -> Self { + self.version_descriptor_version_options = Some(version_descriptor_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn version_descriptor_version_type( + mut self, + version_descriptor_version_type: impl Into<String>, + ) -> Self { + self.version_descriptor_version_type = Some(version_descriptor_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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, + ); + } + 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, + ); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiPage>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WikiPage>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_page { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiPage> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn e_tag(&self) -> azure_core::Result<&str> { + self + .0 + .get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) wiki_identifier: String, + pub(crate) path: String, + pub(crate) comment: Option<String>, + pub(crate) version_descriptor_version: Option<String>, + pub(crate) version_descriptor_version_options: Option<String>, + pub(crate) version_descriptor_version_type: Option<String>, + } + impl RequestBuilder { + #[doc = "Comment to be associated with this page delete."] + pub fn comment(mut self, comment: impl Into<String>) -> Self { + self.comment = Some(comment.into()); + self + } + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn version_descriptor_version( + mut self, + version_descriptor_version: impl Into<String>, + ) -> Self { + self.version_descriptor_version = Some(version_descriptor_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn version_descriptor_version_options( + mut self, + version_descriptor_version_options: impl Into<String>, + ) -> Self { + self.version_descriptor_version_options = Some(version_descriptor_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn version_descriptor_version_type( + mut self, + version_descriptor_version_type: impl Into<String>, + ) -> Self { + self.version_descriptor_version_type = Some(version_descriptor_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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, + ); + } + 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, + ); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiPage>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WikiPage>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_page_by_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiPage> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn e_tag(&self) -> azure_core::Result<&str> { + self + .0 + .get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) wiki_identifier: String, + pub(crate) id: i32, + pub(crate) recursion_level: Option<String>, + pub(crate) include_content: Option<bool>, + } + impl RequestBuilder { + #[doc = "Recursion level for subpages retrieval. Defaults to `None` (Optional)."] + pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self { + self.recursion_level = Some(recursion_level.into()); + self + } + #[doc = "Set to true to include the content of the page in the response for Json content type. Defaults to false (Optional)"] + pub fn include_content(mut self, include_content: bool) -> Self { + self.include_content = Some(include_content); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(recursion_level) = &this.recursion_level { + req + .url_mut() + .query_pairs_mut() + .append_pair("recursionLevel", recursion_level); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiPage>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WikiPage>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiPage> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn e_tag(&self) -> azure_core::Result<&str> { + self + .0 + .get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WikiPageCreateOrUpdateParameters, + pub(crate) project: String, + pub(crate) wiki_identifier: String, + pub(crate) id: i32, + pub(crate) if_match: String, + pub(crate) comment: Option<String>, + } + impl RequestBuilder { + #[doc = "Comment to be associated with the page operation."] + pub fn comment(mut self, comment: impl Into<String>) -> Self { + self.comment = Some(comment.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiPage>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WikiPage>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_page_by_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiPage> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiPage = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn e_tag(&self) -> azure_core::Result<&str> { + self + .0 + .get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) wiki_identifier: String, + pub(crate) id: i32, + pub(crate) comment: Option<String>, + } + impl RequestBuilder { + #[doc = "Comment to be associated with this page delete."] + pub fn comment(mut self, comment: impl Into<String>) -> Self { + self.comment = Some(comment.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(comment) = &this.comment { + req + .url_mut() + .query_pairs_mut() + .append_pair("comment", comment); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiPage>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WikiPage>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } pub mod page_stats { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns page detail corresponding to Page ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] + #[doc = "* `page_id`: Wiki page ID."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + wiki_identifier: impl Into<String>, + 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 get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns page detail corresponding to Page ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] - #[doc = "* `page_id`: Wiki page ID."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - wiki_identifier: impl Into<String>, - 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiPageDetail> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPageDetail = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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<i32>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}/stats", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier, - &this.page_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(page_views_for_days) = &this.page_views_for_days { - req.url_mut() - .query_pairs_mut() - .append_pair("pageViewsForDays", &page_views_for_days.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiPageDetail>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiPageDetail>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiPageDetail> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiPageDetail = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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<i32>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}/stats", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier, + &this.page_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(page_views_for_days) = &this.page_views_for_days { + req + .url_mut() + .query_pairs_mut() + .append_pair("pageViewsForDays", &page_views_for_days.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiPageDetail>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WikiPageDetail>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod pages_batch { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns pageable list of Wiki Pages"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Wiki batch page request."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] + pub fn get( + &self, + organization: impl Into<String>, + body: impl Into<models::WikiPagesBatchRequest>, + project: impl Into<String>, + wiki_identifier: impl Into<String>, + ) -> 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, + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns pageable list of Wiki Pages"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Wiki batch page request."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `wiki_identifier`: Wiki ID or wiki name."] - pub fn get( - &self, - organization: impl Into<String>, - body: impl Into<models::WikiPagesBatchRequest>, - project: impl Into<String>, - wiki_identifier: impl Into<String>, - ) -> 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, - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WikiPageDetailList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WikiPageDetailList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WikiPagesBatchRequest, - pub(crate) project: String, - pub(crate) wiki_identifier: String, - pub(crate) version_descriptor_version: Option<String>, - pub(crate) version_descriptor_version_options: Option<String>, - pub(crate) version_descriptor_version_type: Option<String>, - } - impl RequestBuilder { - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - pub fn version_descriptor_version( - mut self, - version_descriptor_version: impl Into<String>, - ) -> Self { - self.version_descriptor_version = Some(version_descriptor_version.into()); - self - } - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - pub fn version_descriptor_version_options( - mut self, - version_descriptor_version_options: impl Into<String>, - ) -> Self { - self.version_descriptor_version_options = - Some(version_descriptor_version_options.into()); - self - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - pub fn version_descriptor_version_type( - mut self, - version_descriptor_version_type: impl Into<String>, - ) -> Self { - self.version_descriptor_version_type = Some(version_descriptor_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pagesbatch", - this.client.endpoint(), - &this.organization, - &this.project, - &this.wiki_identifier - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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, - ); - } - 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, - ); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WikiPageDetailList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WikiPageDetailList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WikiPageDetailList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiPageDetailList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WikiPagesBatchRequest, + pub(crate) project: String, + pub(crate) wiki_identifier: String, + pub(crate) version_descriptor_version: Option<String>, + pub(crate) version_descriptor_version_options: Option<String>, + pub(crate) version_descriptor_version_type: Option<String>, + } + impl RequestBuilder { + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + pub fn version_descriptor_version( + mut self, + version_descriptor_version: impl Into<String>, + ) -> Self { + self.version_descriptor_version = Some(version_descriptor_version.into()); + self + } + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + pub fn version_descriptor_version_options( + mut self, + version_descriptor_version_options: impl Into<String>, + ) -> Self { + self.version_descriptor_version_options = Some(version_descriptor_version_options.into()); + self + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + pub fn version_descriptor_version_type( + mut self, + version_descriptor_version_type: impl Into<String>, + ) -> Self { + self.version_descriptor_version_type = Some(version_descriptor_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pagesbatch", + this.client.endpoint(), + &this.organization, + &this.project, + &this.wiki_identifier + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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, + ); + } + 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, + ); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WikiPageDetailList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WikiPageDetailList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/wiki/models.rs b/azure_devops_rust_api/src/wiki/models.rs index 69c699bd..8a0cac58 100644 --- a/azure_devops_rust_api/src/wiki/models.rs +++ b/azure_devops_rust_api/src/wiki/models.rs @@ -8,1149 +8,1131 @@ use std::str::FromStr; #[doc = "Comment on an artifact like Work Item or Wiki, etc."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Comment { - #[serde(flatten)] - pub comment_resource_reference: CommentResourceReference, - #[doc = "The id of the artifact this comment belongs to"] - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<String>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "The creation date of the comment."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "The id assigned to the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Indicates if the comment has been deleted."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "The mentions of the comment."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mentions: Vec<CommentMention>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "The last modification date of the comment."] - #[serde( - rename = "modifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_date: Option<time::OffsetDateTime>, - #[doc = "The comment id of the parent comment, if any"] - #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option<i32>, - #[doc = "The reactions on the comment."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub reactions: Vec<CommentReaction>, - #[doc = "The rendered text of the comment"] - #[serde( - rename = "renderedText", - default, - skip_serializing_if = "Option::is_none" - )] - pub rendered_text: Option<String>, - #[doc = "Represents a list of comments."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub replies: Option<CommentList>, - #[doc = "Indicates the current state of the comment"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<comment::State>, - #[doc = "The plaintext/markdown version of the comment"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, - #[doc = "The current version of the comment"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i32>, + #[serde(flatten)] + pub comment_resource_reference: CommentResourceReference, + #[doc = "The id of the artifact this comment belongs to"] + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<String>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "The creation date of the comment."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "The id assigned to the comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Indicates if the comment has been deleted."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "The mentions of the comment."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mentions: Vec<CommentMention>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "The last modification date of the comment."] + #[serde( + rename = "modifiedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_date: Option<time::OffsetDateTime>, + #[doc = "The comment id of the parent comment, if any"] + #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option<i32>, + #[doc = "The reactions on the comment."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub reactions: Vec<CommentReaction>, + #[doc = "The rendered text of the comment"] + #[serde( + rename = "renderedText", + default, + skip_serializing_if = "Option::is_none" + )] + pub rendered_text: Option<String>, + #[doc = "Represents a list of comments."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub replies: Option<CommentList>, + #[doc = "Indicates the current state of the comment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<comment::State>, + #[doc = "The plaintext/markdown version of the comment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, + #[doc = "The current version of the comment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i32>, } impl Comment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod comment { - use super::*; - #[doc = "Indicates the current state of the comment"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "active")] - Active, - #[serde(rename = "resolved")] - Resolved, - #[serde(rename = "closed")] - Closed, - } + use super::*; + #[doc = "Indicates the current state of the comment"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "active")] + Active, + #[serde(rename = "resolved")] + Resolved, + #[serde(rename = "closed")] + Closed, + } } #[doc = "Represents an attachment to a comment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentAttachment { - #[serde(flatten)] - pub comment_resource_reference: CommentResourceReference, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "The creation date of the attachment."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Unique Id of the attachment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, + #[serde(flatten)] + pub comment_resource_reference: CommentResourceReference, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "The creation date of the attachment."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Unique Id of the attachment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, } impl CommentAttachment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a request to create a work item comment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentCreateParameters { - #[doc = "Optional CommentId of the parent in order to add a reply for an existing comment"] - #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, + #[doc = "Optional CommentId of the parent in order to add a reply for an existing comment"] + #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, } impl CommentCreateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a list of comments."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentList { - #[serde(flatten)] - pub comment_resource_reference: CommentResourceReference, - #[doc = "List of comments in the current batch."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub comments: Vec<Comment>, - #[doc = "A string token that can be used to retrieving next page of comments if available. Otherwise null."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[doc = "The count of comments in the current batch."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Uri to the next page of comments if it is available. Otherwise null."] - #[serde(rename = "nextPage", default, skip_serializing_if = "Option::is_none")] - pub next_page: Option<String>, - #[doc = "Total count of comments on a work item."] - #[serde( - rename = "totalCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_count: Option<i32>, + #[serde(flatten)] + pub comment_resource_reference: CommentResourceReference, + #[doc = "List of comments in the current batch."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub comments: Vec<Comment>, + #[doc = "A string token that can be used to retrieving next page of comments if available. Otherwise null."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[doc = "The count of comments in the current batch."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Uri to the next page of comments if it is available. Otherwise null."] + #[serde(rename = "nextPage", default, skip_serializing_if = "Option::is_none")] + pub next_page: Option<String>, + #[doc = "Total count of comments on a work item."] + #[serde( + rename = "totalCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_count: Option<i32>, } impl CommentList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contains information about various artifacts mentioned in the comment"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentMention { - #[serde(flatten)] - pub comment_resource_reference: CommentResourceReference, - #[doc = "Id of the artifact this mention belongs to"] - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<String>, - #[doc = "Id of the comment associated with this mention. Nullable to support legacy mentions which can potentially have null commentId"] - #[serde(rename = "commentId", default, skip_serializing_if = "Option::is_none")] - pub comment_id: Option<i32>, - #[doc = "Value of the mentioned artifact. Expected Value varies by CommentMentionType: Person: VSID associated with the identity Work Item: ID of the work item Pull Request: ID of the Pull Request"] - #[serde( - rename = "mentionedArtifact", - default, - skip_serializing_if = "Option::is_none" - )] - pub mentioned_artifact: Option<String>, - #[doc = "The context which represent where this mentioned was parsed from"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<comment_mention::Type>, + #[serde(flatten)] + pub comment_resource_reference: CommentResourceReference, + #[doc = "Id of the artifact this mention belongs to"] + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<String>, + #[doc = "Id of the comment associated with this mention. Nullable to support legacy mentions which can potentially have null commentId"] + #[serde(rename = "commentId", default, skip_serializing_if = "Option::is_none")] + pub comment_id: Option<i32>, + #[doc = "Value of the mentioned artifact. Expected Value varies by CommentMentionType: Person: VSID associated with the identity Work Item: ID of the work item Pull Request: ID of the Pull Request"] + #[serde( + rename = "mentionedArtifact", + default, + skip_serializing_if = "Option::is_none" + )] + pub mentioned_artifact: Option<String>, + #[doc = "The context which represent where this mentioned was parsed from"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<comment_mention::Type>, } impl CommentMention { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod comment_mention { - use super::*; - #[doc = "The context which represent where this mentioned was parsed from"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "person")] - Person, - #[serde(rename = "workItem")] - WorkItem, - #[serde(rename = "pullRequest")] - PullRequest, - } + use super::*; + #[doc = "The context which represent where this mentioned was parsed from"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "person")] + Person, + #[serde(rename = "workItem")] + WorkItem, + #[serde(rename = "pullRequest")] + PullRequest, + } } #[doc = "Contains information about comment reaction for a particular reaction type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentReaction { - #[serde(flatten)] - pub comment_resource_reference: CommentResourceReference, - #[doc = "The id of the comment this reaction belongs to."] - #[serde(rename = "commentId", default, skip_serializing_if = "Option::is_none")] - pub comment_id: Option<i32>, - #[doc = "Total number of reactions for the CommentReactionType."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Flag to indicate if the current user has engaged on this particular EngagementType (e.g. if they liked the associated comment)."] - #[serde( - rename = "isCurrentUserEngaged", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_current_user_engaged: Option<bool>, - #[doc = "Type of the reaction."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<comment_reaction::Type>, + #[serde(flatten)] + pub comment_resource_reference: CommentResourceReference, + #[doc = "The id of the comment this reaction belongs to."] + #[serde(rename = "commentId", default, skip_serializing_if = "Option::is_none")] + pub comment_id: Option<i32>, + #[doc = "Total number of reactions for the CommentReactionType."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Flag to indicate if the current user has engaged on this particular EngagementType (e.g. if they liked the associated comment)."] + #[serde( + rename = "isCurrentUserEngaged", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_current_user_engaged: Option<bool>, + #[doc = "Type of the reaction."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<comment_reaction::Type>, } impl CommentReaction { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod comment_reaction { - use super::*; - #[doc = "Type of the reaction."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "like")] - Like, - #[serde(rename = "dislike")] - Dislike, - #[serde(rename = "heart")] - Heart, - #[serde(rename = "hooray")] - Hooray, - #[serde(rename = "smile")] - Smile, - #[serde(rename = "confused")] - Confused, - } + use super::*; + #[doc = "Type of the reaction."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "like")] + Like, + #[serde(rename = "dislike")] + Dislike, + #[serde(rename = "heart")] + Heart, + #[serde(rename = "hooray")] + Hooray, + #[serde(rename = "smile")] + Smile, + #[serde(rename = "confused")] + Confused, + } } #[doc = "Base class for comment resource references"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentResourceReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl CommentResourceReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a request to update a comment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentUpdateParameters { - #[doc = "Set the current state of the comment"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<comment_update_parameters::State>, - #[doc = "The updated text of the comment"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, + #[doc = "Set the current state of the comment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<comment_update_parameters::State>, + #[doc = "The updated text of the comment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, } impl CommentUpdateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod comment_update_parameters { - use super::*; - #[doc = "Set the current state of the comment"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "active")] - Active, - #[serde(rename = "resolved")] - Resolved, - #[serde(rename = "closed")] - Closed, - } + use super::*; + #[doc = "Set the current state of the comment"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "active")] + Active, + #[serde(rename = "resolved")] + Resolved, + #[serde(rename = "closed")] + Closed, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRepository { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde( - rename = "defaultBranch", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_branch: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "True if the repository is disabled. False otherwise."] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "True if the repository was created as a fork."] - #[serde(rename = "isFork", default, skip_serializing_if = "Option::is_none")] - pub is_fork: Option<bool>, - #[doc = "True if the repository is in maintenance. False otherwise."] - #[serde( - rename = "isInMaintenance", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_in_maintenance: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde( - rename = "parentRepository", - default, - skip_serializing_if = "Option::is_none" - )] - pub parent_repository: Option<GitRepositoryRef>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] - pub remote_url: Option<String>, - #[doc = "Compressed size (bytes) of the repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option<i64>, - #[serde(rename = "sshUrl", default, skip_serializing_if = "Option::is_none")] - pub ssh_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[serde( - rename = "validRemoteUrls", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub valid_remote_urls: Vec<String>, - #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] - pub web_url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde( + rename = "defaultBranch", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_branch: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "True if the repository is disabled. False otherwise."] + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[doc = "True if the repository was created as a fork."] + #[serde(rename = "isFork", default, skip_serializing_if = "Option::is_none")] + pub is_fork: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde( + rename = "parentRepository", + default, + skip_serializing_if = "Option::is_none" + )] + pub parent_repository: Option<GitRepositoryRef>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] + pub remote_url: Option<String>, + #[doc = "Compressed size (bytes) of the repository."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option<i64>, + #[serde(rename = "sshUrl", default, skip_serializing_if = "Option::is_none")] + pub ssh_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[serde( + rename = "validRemoteUrls", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub valid_remote_urls: Vec<String>, + #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] + pub web_url: Option<String>, } impl GitRepository { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitRepositoryRef { - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub collection: Option<TeamProjectCollectionReference>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "True if the repository was created as a fork"] - #[serde(rename = "isFork", default, skip_serializing_if = "Option::is_none")] - pub is_fork: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<TeamProjectReference>, - #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] - pub remote_url: Option<String>, - #[serde(rename = "sshUrl", default, skip_serializing_if = "Option::is_none")] - pub ssh_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub collection: Option<TeamProjectCollectionReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "True if the repository was created as a fork"] + #[serde(rename = "isFork", default, skip_serializing_if = "Option::is_none")] + pub is_fork: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<TeamProjectReference>, + #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] + pub remote_url: Option<String>, + #[serde(rename = "sshUrl", default, skip_serializing_if = "Option::is_none")] + pub ssh_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GitRepositoryRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GitVersionDescriptor { - #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<String>, - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - #[serde( - rename = "versionOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_options: Option<git_version_descriptor::VersionOptions>, - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - #[serde( - rename = "versionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub version_type: Option<git_version_descriptor::VersionType>, + #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<String>, + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + #[serde( + rename = "versionOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_options: Option<git_version_descriptor::VersionOptions>, + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + #[serde( + rename = "versionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub version_type: Option<git_version_descriptor::VersionType>, } impl GitVersionDescriptor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod git_version_descriptor { - use super::*; - #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionOptions { - #[serde(rename = "none")] - None, - #[serde(rename = "previousChange")] - PreviousChange, - #[serde(rename = "firstParent")] - FirstParent, - } - #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum VersionType { - #[serde(rename = "branch")] - Branch, - #[serde(rename = "tag")] - Tag, - #[serde(rename = "commit")] - Commit, - } + use super::*; + #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionOptions { + #[serde(rename = "none")] + None, + #[serde(rename = "previousChange")] + PreviousChange, + #[serde(rename = "firstParent")] + FirstParent, + } + #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum VersionType { + #[serde(rename = "branch")] + Branch, + #[serde(rename = "tag")] + Tag, + #[serde(rename = "commit")] + Commit, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, } + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamProjectCollectionReference { - #[serde(rename = "avatarUrl", default, skip_serializing_if = "Option::is_none")] - pub avatar_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TeamProjectCollectionReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TeamProjectReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub abbreviation: Option<String>, - #[serde( - rename = "defaultTeamImageUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_team_image_url: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - pub id: String, - #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] - pub last_update_time: time::OffsetDateTime, - pub name: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i64>, - pub state: team_project_reference::State, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - pub visibility: team_project_reference::Visibility, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub abbreviation: Option<String>, + #[serde( + rename = "defaultTeamImageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_team_image_url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + pub id: String, + #[serde(rename = "lastUpdateTime", with = "crate::date_time::rfc3339")] + pub last_update_time: time::OffsetDateTime, + pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i64>, + pub state: team_project_reference::State, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + pub visibility: team_project_reference::Visibility, } impl TeamProjectReference { - pub fn new( - id: String, - last_update_time: time::OffsetDateTime, - name: String, - state: team_project_reference::State, - visibility: team_project_reference::Visibility, - ) -> Self { - Self { - abbreviation: None, - default_team_image_url: None, - description: None, - id, - last_update_time, - name, - revision: None, - state, - url: None, - visibility, - } + pub fn new( + id: String, + last_update_time: time::OffsetDateTime, + name: String, + state: team_project_reference::State, + visibility: team_project_reference::Visibility, + ) -> Self { + Self { + abbreviation: None, + default_team_image_url: None, + description: None, + id, + last_update_time, + name, + revision: None, + state, + url: None, + visibility, } + } } pub mod team_project_reference { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum State { - #[serde(rename = "deleting")] - Deleting, - #[serde(rename = "new")] - New, - #[serde(rename = "wellFormed")] - WellFormed, - #[serde(rename = "createPending")] - CreatePending, - #[serde(rename = "all")] - All, - #[serde(rename = "unchanged")] - Unchanged, - #[serde(rename = "deleted")] - Deleted, - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Visibility { - #[serde(rename = "private")] - Private, - #[serde(rename = "public")] - Public, - #[serde(rename = "organization")] - Organization, - #[serde(rename = "unchanged")] - Unchanged, - } -} -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + #[serde(rename = "deleting")] + Deleting, + #[serde(rename = "new")] + New, + #[serde(rename = "wellFormed")] + WellFormed, + #[serde(rename = "createPending")] + CreatePending, + #[serde(rename = "all")] + All, + #[serde(rename = "unchanged")] + Unchanged, + #[serde(rename = "deleted")] + Deleted, + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Visibility { + #[serde(rename = "private")] + Private, + #[serde(rename = "public")] + Public, + #[serde(rename = "organization")] + Organization, + #[serde(rename = "unchanged")] + Unchanged, + } +} +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a wiki repository which encapsulates the git repository backing the wiki."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Wiki { - #[serde(flatten)] - pub wiki_create_parameters: WikiCreateParameters, - #[doc = "The head commit associated with the git repository backing up the wiki."] - #[serde( - rename = "headCommit", - default, - skip_serializing_if = "Option::is_none" - )] - pub head_commit: Option<String>, - #[doc = "The ID of the wiki which is same as the ID of the Git repository that it is backed by."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub repository: Option<GitRepository>, + #[serde(flatten)] + pub wiki_create_parameters: WikiCreateParameters, + #[doc = "The head commit associated with the git repository backing up the wiki."] + #[serde( + rename = "headCommit", + default, + skip_serializing_if = "Option::is_none" + )] + pub head_commit: Option<String>, + #[doc = "The ID of the wiki which is same as the ID of the Git repository that it is backed by."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option<GitRepository>, } impl Wiki { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines properties for wiki attachment file."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiAttachment { - #[doc = "Name of the wiki attachment file."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Path of the wiki attachment file."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[doc = "Name of the wiki attachment file."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Path of the wiki attachment file."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl WikiAttachment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Response contract for the Wiki Attachments API"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiAttachmentResponse { - #[doc = "Defines properties for wiki attachment file."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attachment: Option<WikiAttachment>, - #[doc = "Contains the list of ETag values from the response header of the attachments API call. The first item in the list contains the version of the wiki attachment."] - #[serde( - rename = "eTag", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub e_tag: Vec<String>, + #[doc = "Defines properties for wiki attachment file."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attachment: Option<WikiAttachment>, + #[doc = "Contains the list of ETag values from the response header of the attachments API call. The first item in the list contains the version of the wiki attachment."] + #[serde( + rename = "eTag", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub e_tag: Vec<String>, } impl WikiAttachmentResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Base wiki creation parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiCreateBaseParameters { - #[doc = "Folder path inside repository which is shown as Wiki. Not required for ProjectWiki type."] - #[serde( - rename = "mappedPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub mapped_path: Option<String>, - #[doc = "Wiki name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "ID of the project in which the wiki is to be created."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "ID of the git repository that backs up the wiki. Not required for ProjectWiki type."] - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, - #[doc = "Type of the wiki."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<wiki_create_base_parameters::Type>, + #[doc = "Folder path inside repository which is shown as Wiki. Not required for ProjectWiki type."] + #[serde( + rename = "mappedPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub mapped_path: Option<String>, + #[doc = "Wiki name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "ID of the project in which the wiki is to be created."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "ID of the git repository that backs up the wiki. Not required for ProjectWiki type."] + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, + #[doc = "Type of the wiki."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<wiki_create_base_parameters::Type>, } impl WikiCreateBaseParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod wiki_create_base_parameters { - use super::*; - #[doc = "Type of the wiki."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "projectWiki")] - ProjectWiki, - #[serde(rename = "codeWiki")] - CodeWiki, - } + use super::*; + #[doc = "Type of the wiki."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "projectWiki")] + ProjectWiki, + #[serde(rename = "codeWiki")] + CodeWiki, + } } #[doc = "Wiki creations parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiCreateParameters { - #[doc = "Wiki name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "ID of the project in which the wiki is to be created."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, + #[doc = "Wiki name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "ID of the project in which the wiki is to be created."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, } impl WikiCreateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Wiki creation parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiCreateParametersV2 { - #[serde(flatten)] - pub wiki_create_base_parameters: WikiCreateBaseParameters, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<GitVersionDescriptor>, + #[serde(flatten)] + pub wiki_create_base_parameters: WikiCreateBaseParameters, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<GitVersionDescriptor>, } impl WikiCreateParametersV2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a page in a wiki."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiPage { - #[serde(flatten)] - pub wiki_page_create_or_update_parameters: WikiPageCreateOrUpdateParameters, - #[doc = "Path of the git item corresponding to the wiki page stored in the backing Git repository."] - #[serde( - rename = "gitItemPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub git_item_path: Option<String>, - #[doc = "When present, permanent identifier for the wiki page"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "True if a page is non-conforming, i.e. 1) if the name doesn't match page naming standards. 2) if the page does not have a valid entry in the appropriate order file."] - #[serde( - rename = "isNonConformant", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_non_conformant: Option<bool>, - #[doc = "True if this page has subpages under its path."] - #[serde( - rename = "isParentPage", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_parent_page: Option<bool>, - #[doc = "Order of the wiki page, relative to other pages in the same hierarchy level."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, - #[doc = "Path of the wiki page."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Remote web url to the wiki page."] - #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] - pub remote_url: Option<String>, - #[doc = "List of subpages of the current page."] - #[serde( - rename = "subPages", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub sub_pages: Vec<WikiPage>, - #[doc = "REST url for this wiki page."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(flatten)] + pub wiki_page_create_or_update_parameters: WikiPageCreateOrUpdateParameters, + #[doc = "Path of the git item corresponding to the wiki page stored in the backing Git repository."] + #[serde( + rename = "gitItemPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub git_item_path: Option<String>, + #[doc = "When present, permanent identifier for the wiki page"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "True if a page is non-conforming, i.e. 1) if the name doesn't match page naming standards. 2) if the page does not have a valid entry in the appropriate order file."] + #[serde( + rename = "isNonConformant", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_non_conformant: Option<bool>, + #[doc = "True if this page has subpages under its path."] + #[serde( + rename = "isParentPage", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_parent_page: Option<bool>, + #[doc = "Order of the wiki page, relative to other pages in the same hierarchy level."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, + #[doc = "Path of the wiki page."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Remote web url to the wiki page."] + #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] + pub remote_url: Option<String>, + #[doc = "List of subpages of the current page."] + #[serde( + rename = "subPages", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub sub_pages: Vec<WikiPage>, + #[doc = "REST url for this wiki page."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WikiPage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contract encapsulating parameters for the page create or update operations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiPageCreateOrUpdateParameters { - #[doc = "Content of the wiki page."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub content: Option<String>, + #[doc = "Content of the wiki page."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content: Option<String>, } impl WikiPageCreateOrUpdateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a page with its metedata in a wiki."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiPageDetail { - #[doc = "When present, permanent identifier for the wiki page"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Path of the wiki page."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Path of the wiki page."] - #[serde( - rename = "viewStats", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub view_stats: Vec<WikiPageStat>, + #[doc = "When present, permanent identifier for the wiki page"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Path of the wiki page."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Path of the wiki page."] + #[serde( + rename = "viewStats", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub view_stats: Vec<WikiPageStat>, } impl WikiPageDetail { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiPageDetailList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WikiPageDetail>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WikiPageDetail>, } impl WikiPageDetailList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Request contract for Wiki Page Move."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiPageMove { - #[serde(flatten)] - pub wiki_page_move_parameters: WikiPageMoveParameters, - #[doc = "Defines a page in a wiki."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub page: Option<WikiPage>, + #[serde(flatten)] + pub wiki_page_move_parameters: WikiPageMoveParameters, + #[doc = "Defines a page in a wiki."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option<WikiPage>, } impl WikiPageMove { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contract encapsulating parameters for the page move operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiPageMoveParameters { - #[doc = "New order of the wiki page."] - #[serde(rename = "newOrder", default, skip_serializing_if = "Option::is_none")] - pub new_order: Option<i32>, - #[doc = "New path of the wiki page."] - #[serde(rename = "newPath", default, skip_serializing_if = "Option::is_none")] - pub new_path: Option<String>, - #[doc = "Current path of the wiki page."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[doc = "New order of the wiki page."] + #[serde(rename = "newOrder", default, skip_serializing_if = "Option::is_none")] + pub new_order: Option<i32>, + #[doc = "New path of the wiki page."] + #[serde(rename = "newPath", default, skip_serializing_if = "Option::is_none")] + pub new_path: Option<String>, + #[doc = "Current path of the wiki page."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl WikiPageMoveParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Response contract for the Wiki Page Move API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiPageMoveResponse { - #[doc = "Contains the list of ETag values from the response header of the page move API call. The first item in the list contains the version of the wiki page subject to page move."] - #[serde( - rename = "eTag", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub e_tag: Vec<String>, - #[doc = "Request contract for Wiki Page Move."] - #[serde(rename = "pageMove", default, skip_serializing_if = "Option::is_none")] - pub page_move: Option<WikiPageMove>, + #[doc = "Contains the list of ETag values from the response header of the page move API call. The first item in the list contains the version of the wiki page subject to page move."] + #[serde( + rename = "eTag", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub e_tag: Vec<String>, + #[doc = "Request contract for Wiki Page Move."] + #[serde(rename = "pageMove", default, skip_serializing_if = "Option::is_none")] + pub page_move: Option<WikiPageMove>, } impl WikiPageMoveResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Response contract for the Wiki Pages PUT, PATCH and DELETE APIs."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiPageResponse { - #[doc = "Contains the list of ETag values from the response header of the pages API call. The first item in the list contains the version of the wiki page."] - #[serde( - rename = "eTag", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub e_tag: Vec<String>, - #[doc = "Defines a page in a wiki."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub page: Option<WikiPage>, + #[doc = "Contains the list of ETag values from the response header of the pages API call. The first item in the list contains the version of the wiki page."] + #[serde( + rename = "eTag", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub e_tag: Vec<String>, + #[doc = "Defines a page in a wiki."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option<WikiPage>, } impl WikiPageResponse { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines properties for wiki page stat."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiPageStat { - #[doc = "the count of the stat for the Day"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Day of the stat"] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub day: Option<time::OffsetDateTime>, + #[doc = "the count of the stat for the Day"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Day of the stat"] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub day: Option<time::OffsetDateTime>, } impl WikiPageStat { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines properties for wiki page view stats."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiPageViewStats { - #[doc = "Wiki page view count."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Wiki page last viewed time."] - #[serde( - rename = "lastViewedTime", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_viewed_time: Option<time::OffsetDateTime>, - #[doc = "Wiki page path."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[doc = "Wiki page view count."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Wiki page last viewed time."] + #[serde( + rename = "lastViewedTime", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_viewed_time: Option<time::OffsetDateTime>, + #[doc = "Wiki page path."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl WikiPageViewStats { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contract encapsulating parameters for the pages batch."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiPagesBatchRequest { - #[doc = "If the list of page data returned is not complete, a continuation token to query next batch of pages is included in the response header as \"x-ms-continuationtoken\". Omit this parameter to get the first batch of Wiki Page Data."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[doc = "last N days from the current day for which page views is to be returned. It's inclusive of current day."] - #[serde( - rename = "pageViewsForDays", - default, - skip_serializing_if = "Option::is_none" - )] - pub page_views_for_days: Option<i32>, - #[doc = "Total count of pages on a wiki to return."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub top: Option<i32>, + #[doc = "If the list of page data returned is not complete, a continuation token to query next batch of pages is included in the response header as \"x-ms-continuationtoken\". Omit this parameter to get the first batch of Wiki Page Data."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[doc = "last N days from the current day for which page views is to be returned. It's inclusive of current day."] + #[serde( + rename = "pageViewsForDays", + default, + skip_serializing_if = "Option::is_none" + )] + pub page_views_for_days: Option<i32>, + #[doc = "Total count of pages on a wiki to return."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub top: Option<i32>, } impl WikiPagesBatchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Wiki update parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiUpdateParameters { - #[doc = "Name for wiki."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Versions of the wiki."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub versions: Vec<GitVersionDescriptor>, + #[doc = "Name for wiki."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Versions of the wiki."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub versions: Vec<GitVersionDescriptor>, } impl WikiUpdateParameters { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiUpdatedNotificationMessage { - #[doc = "Collection host Id for which the wikis are updated."] - #[serde( - rename = "collectionId", - default, - skip_serializing_if = "Option::is_none" - )] - pub collection_id: Option<String>, - #[doc = "Project Id for which the wikis are updated."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "Repository Id associated with the particular wiki which is added, updated or deleted."] - #[serde( - rename = "repositoryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub repository_id: Option<String>, + #[doc = "Collection host Id for which the wikis are updated."] + #[serde( + rename = "collectionId", + default, + skip_serializing_if = "Option::is_none" + )] + pub collection_id: Option<String>, + #[doc = "Project Id for which the wikis are updated."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "Repository Id associated with the particular wiki which is added, updated or deleted."] + #[serde( + rename = "repositoryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub repository_id: Option<String>, } impl WikiUpdatedNotificationMessage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines a wiki resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiV2 { - #[serde(flatten)] - pub wiki_create_base_parameters: WikiCreateBaseParameters, - #[doc = "ID of the wiki."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Is wiki repository disabled"] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "Properties of the wiki."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Remote web url to the wiki."] - #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] - pub remote_url: Option<String>, - #[doc = "REST url for this wiki."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Versions of the wiki."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub versions: Vec<GitVersionDescriptor>, + #[serde(flatten)] + pub wiki_create_base_parameters: WikiCreateBaseParameters, + #[doc = "ID of the wiki."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Properties of the wiki."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Remote web url to the wiki."] + #[serde(rename = "remoteUrl", default, skip_serializing_if = "Option::is_none")] + pub remote_url: Option<String>, + #[doc = "REST url for this wiki."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Versions of the wiki."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub versions: Vec<GitVersionDescriptor>, } impl WikiV2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WikiV2List { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WikiV2>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WikiV2>, } impl WikiV2List { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/wit/mod.rs b/azure_devops_rust_api/src/wit/mod.rs index 0b429349..e3b21ba8 100644 --- a/azure_devops_rust_api/src/wit/mod.rs +++ b/azure_devops_rust_api/src/wit/mod.rs @@ -9,12203 +9,11700 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self - } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self - } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self - } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self - } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) - } + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } } impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential - } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - 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()) - } + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + 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 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()) + } } pub mod classification_nodes { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `ids`: Comma separated integer classification nodes ids. It's not required, if you want root nodes."] + pub fn get_classification_nodes( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_root_nodes( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `structure_group`: Structure group of the classification node, area or iteration."] + #[doc = "* `path`: Path of the classification node."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + structure_group: impl Into<String>, + path: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Node to create or update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `structure_group`: Structure group of the classification node, area or iteration."] + #[doc = "* `path`: Path of the classification node."] + pub fn create_or_update( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemClassificationNode>, + project: impl Into<String>, + structure_group: impl Into<String>, + path: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Node to create or update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `structure_group`: Structure group of the classification node, area or iteration."] + #[doc = "* `path`: Path of the classification node."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemClassificationNode>, + project: impl Into<String>, + structure_group: impl Into<String>, + path: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `structure_group`: Structure group of the classification node, area or iteration."] + #[doc = "* `path`: Path of the classification node."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + structure_group: impl Into<String>, + path: impl Into<String>, + ) -> 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 get_classification_nodes { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `ids`: Comma separated integer classification nodes ids. It's not required, if you want root nodes."] - pub fn get_classification_nodes( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_root_nodes( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `structure_group`: Structure group of the classification node, area or iteration."] - #[doc = "* `path`: Path of the classification node."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - structure_group: impl Into<String>, - path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Node to create or update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `structure_group`: Structure group of the classification node, area or iteration."] - #[doc = "* `path`: Path of the classification node."] - pub fn create_or_update( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemClassificationNode>, - project: impl Into<String>, - structure_group: impl Into<String>, - path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Node to create or update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `structure_group`: Structure group of the classification node, area or iteration."] - #[doc = "* `path`: Path of the classification node."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemClassificationNode>, - project: impl Into<String>, - structure_group: impl Into<String>, - path: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `structure_group`: Structure group of the classification node, area or iteration."] - #[doc = "* `path`: Path of the classification node."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - structure_group: impl Into<String>, - path: impl Into<String>, - ) -> 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 get_classification_nodes { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::WorkItemClassificationNodeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemClassificationNodeList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) ids: String, - pub(crate) depth: Option<i32>, - pub(crate) error_policy: Option<String>, - } - impl RequestBuilder { - #[doc = "Depth of children to fetch."] - pub fn depth(mut self, depth: i32) -> Self { - self.depth = Some(depth); - self - } - #[doc = "Flag to handle errors in getting some nodes. Possible options are Fail and Omit."] - pub fn error_policy(mut self, error_policy: impl Into<String>) -> Self { - self.error_policy = Some(error_policy.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/classificationnodes?ids={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.ids - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemClassificationNodeList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemClassificationNodeList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_root_nodes { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::WorkItemClassificationNodeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemClassificationNodeList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) depth: Option<i32>, - } - impl RequestBuilder { - #[doc = "Depth of children to fetch."] - pub fn depth(mut self, depth: i32) -> Self { - self.depth = Some(depth); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/classificationnodes", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(depth) = &this.depth { - req.url_mut() - .query_pairs_mut() - .append_pair("$depth", &depth.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemClassificationNodeList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemClassificationNodeList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemClassificationNode> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemClassificationNode = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) structure_group: String, - pub(crate) path: String, - pub(crate) depth: Option<i32>, - } - impl RequestBuilder { - #[doc = "Depth of children to fetch."] - pub fn depth(mut self, depth: i32) -> Self { - self.depth = Some(depth); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.structure_group, - &this.path - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(depth) = &this.depth { - req.url_mut() - .query_pairs_mut() - .append_pair("$depth", &depth.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemClassificationNode>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemClassificationNode>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemClassificationNode> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemClassificationNode = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemClassificationNode, - pub(crate) project: String, - pub(crate) structure_group: String, - pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.structure_group, - &this.path - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemClassificationNode>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemClassificationNode>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemClassificationNode> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemClassificationNode = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemClassificationNode, - pub(crate) project: String, - pub(crate) structure_group: String, - pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.structure_group, - &this.path - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemClassificationNode>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemClassificationNode>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) structure_group: String, - pub(crate) path: String, - pub(crate) reclassify_id: Option<i32>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.structure_group, - &this.path - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(reclassify_id) = &this.reclassify_id { - req.url_mut() - .query_pairs_mut() - .append_pair("$reclassifyId", &reclassify_id.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemClassificationNodeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemClassificationNodeList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) ids: String, + pub(crate) depth: Option<i32>, + pub(crate) error_policy: Option<String>, + } + impl RequestBuilder { + #[doc = "Depth of children to fetch."] + pub fn depth(mut self, depth: i32) -> Self { + self.depth = Some(depth); + self + } + #[doc = "Flag to handle errors in getting some nodes. Possible options are Fail and Omit."] + pub fn error_policy(mut self, error_policy: impl Into<String>) -> Self { + self.error_policy = Some(error_policy.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/classificationnodes?ids={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.ids + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemClassificationNodeList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::WorkItemClassificationNodeList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_root_nodes { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemClassificationNodeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemClassificationNodeList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) depth: Option<i32>, + } + impl RequestBuilder { + #[doc = "Depth of children to fetch."] + pub fn depth(mut self, depth: i32) -> Self { + self.depth = Some(depth); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/classificationnodes", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(depth) = &this.depth { + req + .url_mut() + .query_pairs_mut() + .append_pair("$depth", &depth.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemClassificationNodeList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::WorkItemClassificationNodeList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemClassificationNode> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemClassificationNode = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) structure_group: String, + pub(crate) path: String, + pub(crate) depth: Option<i32>, + } + impl RequestBuilder { + #[doc = "Depth of children to fetch."] + pub fn depth(mut self, depth: i32) -> Self { + self.depth = Some(depth); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.structure_group, + &this.path + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(depth) = &this.depth { + req + .url_mut() + .query_pairs_mut() + .append_pair("$depth", &depth.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemClassificationNode>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemClassificationNode>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemClassificationNode> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemClassificationNode = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WorkItemClassificationNode, + pub(crate) project: String, + pub(crate) structure_group: String, + pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.structure_group, + &this.path + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemClassificationNode>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemClassificationNode>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemClassificationNode> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemClassificationNode = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WorkItemClassificationNode, + pub(crate) project: String, + pub(crate) structure_group: String, + pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.structure_group, + &this.path + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemClassificationNode>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemClassificationNode>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) structure_group: String, + pub(crate) path: String, + pub(crate) reclassify_id: Option<i32>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.structure_group, + &this.path + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(reclassify_id) = &this.reclassify_id { + req + .url_mut() + .query_pairs_mut() + .append_pair("$reclassifyId", &reclassify_id.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod queries { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Searches all queries the user has access to in the current project"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `filter`: The text to filter the queries with."] + pub fn search_queries( + &self, + organization: impl Into<String>, + project: impl Into<String>, + filter: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `query`: ID or path of the query."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + query: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The query to create."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `query`: The parent id or path under which the query is to be created."] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::QueryHierarchyItem>, + project: impl Into<String>, + query: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The query to update."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `query`: The ID or path for the query to update."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::QueryHierarchyItem>, + project: impl Into<String>, + query: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `query`: ID or path of the query or folder to delete."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + query: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_queries_batch( + &self, + organization: impl Into<String>, + body: impl Into<models::QueryBatchGetRequest>, + project: impl Into<String>, + ) -> get_queries_batch::RequestBuilder { + get_queries_batch::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + pub mod search_queries { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Searches all queries the user has access to in the current project"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `filter`: The text to filter the queries with."] - pub fn search_queries( - &self, - organization: impl Into<String>, - project: impl Into<String>, - filter: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `query`: ID or path of the query."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - query: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The query to create."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `query`: The parent id or path under which the query is to be created."] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::QueryHierarchyItem>, - project: impl Into<String>, - query: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The query to update."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `query`: The ID or path for the query to update."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::QueryHierarchyItem>, - project: impl Into<String>, - query: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `query`: ID or path of the query or folder to delete."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - query: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_queries_batch( - &self, - organization: impl Into<String>, - body: impl Into<models::QueryBatchGetRequest>, - project: impl Into<String>, - ) -> get_queries_batch::RequestBuilder { - get_queries_batch::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - } - pub mod search_queries { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::QueryHierarchyItemsResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryHierarchyItemsResult = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) filter: String, - pub(crate) top: Option<i32>, - pub(crate) expand: Option<String>, - pub(crate) include_deleted: Option<bool>, - } - 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); - self - } - pub fn expand(mut self, expand: impl Into<String>) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Include deleted queries and folders"] - pub fn include_deleted(mut self, include_deleted: bool) -> Self { - self.include_deleted = Some(include_deleted); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queries?$filter={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.filter - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::QueryHierarchyItemsResult>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::QueryHierarchyItemsResult>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::QueryHierarchyItemList> { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryHierarchyItemList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) expand: Option<String>, - pub(crate) depth: Option<i32>, - pub(crate) include_deleted: Option<bool>, - } - 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<String>) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "In the folder of queries, return child queries and folders to this depth."] - pub fn depth(mut self, depth: i32) -> Self { - self.depth = Some(depth); - self - } - #[doc = "Include deleted queries and folders"] - pub fn include_deleted(mut self, include_deleted: bool) -> Self { - self.include_deleted = Some(include_deleted); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queries", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::QueryHierarchyItemList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::QueryHierarchyItemList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::QueryHierarchyItem> { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryHierarchyItem = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) query: String, - pub(crate) expand: Option<String>, - pub(crate) depth: Option<i32>, - pub(crate) include_deleted: Option<bool>, - pub(crate) use_iso_date_format: Option<bool>, - } - 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<String>) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "In the folder of queries, return child queries and folders to this depth."] - pub fn depth(mut self, depth: i32) -> Self { - self.depth = Some(depth); - self - } - #[doc = "Include deleted queries and folders"] - pub fn include_deleted(mut self, include_deleted: bool) -> Self { - self.include_deleted = Some(include_deleted); - self - } - #[doc = "DateTime query clauses will be formatted using a ISO 8601 compliant format"] - pub fn use_iso_date_format(mut self, use_iso_date_format: bool) -> Self { - self.use_iso_date_format = Some(use_iso_date_format); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queries/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.query - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::QueryHierarchyItem>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::QueryHierarchyItem>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::QueryHierarchyItem> { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryHierarchyItem = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::QueryHierarchyItem, - pub(crate) project: String, - pub(crate) query: String, - pub(crate) validate_wiql_only: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queries/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.query - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::QueryHierarchyItem>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::QueryHierarchyItem>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::QueryHierarchyItem> { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryHierarchyItem = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::QueryHierarchyItem, - pub(crate) project: String, - pub(crate) query: String, - pub(crate) undelete_descendants: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queries/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.query - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::QueryHierarchyItem>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::QueryHierarchyItem>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) query: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queries/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.query - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_queries_batch { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::QueryHierarchyItemList> { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryHierarchyItemList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::QueryBatchGetRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queriesbatch", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::QueryHierarchyItemList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::QueryHierarchyItemList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::QueryHierarchyItemsResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::QueryHierarchyItemsResult = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) filter: String, + pub(crate) top: Option<i32>, + pub(crate) expand: Option<String>, + pub(crate) include_deleted: Option<bool>, + } + 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); + self + } + pub fn expand(mut self, expand: impl Into<String>) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "Include deleted queries and folders"] + pub fn include_deleted(mut self, include_deleted: bool) -> Self { + self.include_deleted = Some(include_deleted); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queries?$filter={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.filter + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::QueryHierarchyItemsResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::QueryHierarchyItemsResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::QueryHierarchyItemList> { + let bytes = self.0.into_body().collect().await?; + let body: models::QueryHierarchyItemList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) expand: Option<String>, + pub(crate) depth: Option<i32>, + pub(crate) include_deleted: Option<bool>, + } + 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<String>) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "In the folder of queries, return child queries and folders to this depth."] + pub fn depth(mut self, depth: i32) -> Self { + self.depth = Some(depth); + self + } + #[doc = "Include deleted queries and folders"] + pub fn include_deleted(mut self, include_deleted: bool) -> Self { + self.include_deleted = Some(include_deleted); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queries", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::QueryHierarchyItemList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::QueryHierarchyItemList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::QueryHierarchyItem> { + let bytes = self.0.into_body().collect().await?; + let body: models::QueryHierarchyItem = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) query: String, + pub(crate) expand: Option<String>, + pub(crate) depth: Option<i32>, + pub(crate) include_deleted: Option<bool>, + pub(crate) use_iso_date_format: Option<bool>, + } + 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<String>) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "In the folder of queries, return child queries and folders to this depth."] + pub fn depth(mut self, depth: i32) -> Self { + self.depth = Some(depth); + self + } + #[doc = "Include deleted queries and folders"] + pub fn include_deleted(mut self, include_deleted: bool) -> Self { + self.include_deleted = Some(include_deleted); + self + } + #[doc = "DateTime query clauses will be formatted using a ISO 8601 compliant format"] + pub fn use_iso_date_format(mut self, use_iso_date_format: bool) -> Self { + self.use_iso_date_format = Some(use_iso_date_format); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queries/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.query + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::QueryHierarchyItem>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::QueryHierarchyItem>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::QueryHierarchyItem> { + let bytes = self.0.into_body().collect().await?; + let body: models::QueryHierarchyItem = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::QueryHierarchyItem, + pub(crate) project: String, + pub(crate) query: String, + pub(crate) validate_wiql_only: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queries/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.query + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::QueryHierarchyItem>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::QueryHierarchyItem>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::QueryHierarchyItem> { + let bytes = self.0.into_body().collect().await?; + let body: models::QueryHierarchyItem = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::QueryHierarchyItem, + pub(crate) project: String, + pub(crate) query: String, + pub(crate) undelete_descendants: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queries/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.query + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::QueryHierarchyItem>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::QueryHierarchyItem>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) query: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queries/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.query + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_queries_batch { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::QueryHierarchyItemList> { + let bytes = self.0.into_body().collect().await?; + let body: models::QueryHierarchyItemList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::QueryBatchGetRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queriesbatch", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::QueryHierarchyItemList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::QueryHierarchyItemList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod recyclebin { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `ids`: Comma separated list of IDs of the deleted work items to be returned"] + #[doc = "* `project`: Project ID or project name"] + pub fn get_deleted_work_items( + &self, + organization: impl Into<String>, + ids: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_deleted_work_item_shallow_references( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: ID of the work item to be returned"] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Paylod with instructions to update the IsDeleted flag to false"] + #[doc = "* `id`: ID of the work item to be restored"] + #[doc = "* `project`: Project ID or project name"] + pub fn restore_work_item( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemDeleteUpdate>, + id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: ID of the work item to be destroyed permanently"] + #[doc = "* `project`: Project ID or project name"] + pub fn destroy_work_item( + &self, + organization: impl Into<String>, + id: i32, + project: impl Into<String>, + ) -> destroy_work_item::RequestBuilder { + destroy_work_item::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + project: project.into(), + } + } + } + pub mod get_deleted_work_items { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `ids`: Comma separated list of IDs of the deleted work items to be returned"] - #[doc = "* `project`: Project ID or project name"] - pub fn get_deleted_work_items( - &self, - organization: impl Into<String>, - ids: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_deleted_work_item_shallow_references( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: ID of the work item to be returned"] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Paylod with instructions to update the IsDeleted flag to false"] - #[doc = "* `id`: ID of the work item to be restored"] - #[doc = "* `project`: Project ID or project name"] - pub fn restore_work_item( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemDeleteUpdate>, - id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: ID of the work item to be destroyed permanently"] - #[doc = "* `project`: Project ID or project name"] - pub fn destroy_work_item( - &self, - organization: impl Into<String>, - id: i32, - project: impl Into<String>, - ) -> destroy_work_item::RequestBuilder { - destroy_work_item::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - id, - project: project.into(), - } - } - } - pub mod get_deleted_work_items { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::WorkItemDeleteReferenceList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemDeleteReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) ids: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/recyclebin?ids={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.ids - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let ids = &this.ids; - req.url_mut().query_pairs_mut().append_pair("ids", ids); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemDeleteReferenceList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemDeleteReferenceList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_deleted_work_item_shallow_references { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::WorkItemDeleteShallowReferenceList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemDeleteShallowReferenceList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/recyclebin", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemDeleteShallowReferenceList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemDeleteShallowReferenceList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemDelete> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemDelete = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/recyclebin/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemDelete>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemDelete>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod restore_work_item { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemDelete> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemDelete = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemDeleteUpdate, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/recyclebin/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemDelete>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemDelete>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod destroy_work_item { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/recyclebin/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemDeleteReferenceList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemDeleteReferenceList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) ids: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/recyclebin?ids={}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.ids + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let ids = &this.ids; + req.url_mut().query_pairs_mut().append_pair("ids", ids); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemDeleteReferenceList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::WorkItemDeleteReferenceList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_deleted_work_item_shallow_references { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::WorkItemDeleteShallowReferenceList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemDeleteShallowReferenceList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/recyclebin", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemDeleteShallowReferenceList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::WorkItemDeleteShallowReferenceList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemDelete> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemDelete = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/recyclebin/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemDelete>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemDelete>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod restore_work_item { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemDelete> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemDelete = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WorkItemDeleteUpdate, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/recyclebin/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemDelete>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemDelete>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod destroy_work_item { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/recyclebin/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod comments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a list of work item comments, pageable."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `work_item_id`: Id of a work item to get comments for."] + pub fn get_comments( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Returns a list of work item comments by ids."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `work_item_id`: Id of a work item to get comments for."] + #[doc = "* `ids`: Comma-separated list of comment ids to return."] + pub fn get_comments_batch( + &self, + organization: impl Into<String>, + project: impl Into<String>, + work_item_id: i32, + ids: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Comment create request."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `work_item_id`: Id of a work item."] + pub fn add( + &self, + organization: impl Into<String>, + body: impl Into<models::CommentCreate>, + project: impl Into<String>, + work_item_id: i32, + ) -> add::RequestBuilder { + add::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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `work_item_id`: Id of a work item to get the comment."] + #[doc = "* `comment_id`: Id of the comment to return."] + pub fn get_comment( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Comment update request."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `work_item_id`: Id of a work item."] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::CommentUpdate>, + project: impl Into<String>, + work_item_id: i32, + comment_id: i32, + ) -> update::RequestBuilder { + update::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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `work_item_id`: Id of a work item."] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 get_comments { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Add a comment on a work item."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Comment create request."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `work_item_id`: Id of a work item."] - #[doc = "* `format`: Format of a work item comment (Markdown or Html)."] - pub fn add_work_item_comment( - &self, - organization: impl Into<String>, - body: impl Into<models::CommentCreate>, - project: impl Into<String>, - work_item_id: i32, - format: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `work_item_id`: Id of a work item to get comments for."] - pub fn get_comments( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Comment update request."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `work_item_id`: Id of a work item."] - #[doc = "* `format`: Format of a work item comment (Markdown or Html)."] - pub fn update_work_item_comment( - &self, - organization: impl Into<String>, - body: impl Into<models::CommentUpdate>, - project: impl Into<String>, - work_item_id: i32, - comment_id: i32, - format: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `work_item_id`: Id of a work item to get comments for."] - #[doc = "* `ids`: Comma-separated list of comment ids to return."] - pub fn get_comments_batch( - &self, - organization: impl Into<String>, - project: impl Into<String>, - work_item_id: i32, - ids: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Comment create request."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `work_item_id`: Id of a work item."] - pub fn add_comment( - &self, - organization: impl Into<String>, - body: impl Into<models::CommentCreate>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `work_item_id`: Id of a work item to get the comment."] - #[doc = "* `comment_id`: Id of the comment to return."] - pub fn get_comment( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Comment update request."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `work_item_id`: Id of a work item."] - pub fn update_comment( - &self, - organization: impl Into<String>, - body: impl Into<models::CommentUpdate>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `work_item_id`: Id of a work item."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 add_work_item_comment { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Comment> { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CommentCreate, - pub(crate) project: String, - pub(crate) work_item_id: i32, - pub(crate) format: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments?format={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id, - &this.format - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - let format = &this.format; - req.url_mut() - .query_pairs_mut() - .append_pair("format", format); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Comment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_comments { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CommentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) work_item_id: i32, - pub(crate) top: Option<i32>, - pub(crate) continuation_token: Option<String>, - pub(crate) include_deleted: Option<bool>, - pub(crate) expand: Option<String>, - pub(crate) order: Option<String>, - } - impl RequestBuilder { - #[doc = "Max number of comments to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Used to query for the next page of comments."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[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); - self - } - #[doc = "Specifies the additional data retrieval options for work item comments."] - pub fn expand(mut self, expand: impl Into<String>) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Order in which the comments should be returned."] - pub fn order(mut self, order: impl Into<String>) -> Self { - self.order = Some(order.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments?", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - if let Some(order) = &this.order { - req.url_mut().query_pairs_mut().append_pair("order", order); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CommentList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CommentList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_work_item_comment { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Comment> { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CommentUpdate, - pub(crate) project: String, - pub(crate) work_item_id: i32, - pub(crate) comment_id: i32, - pub(crate) format: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}?format={}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id, - &this.comment_id, - &this.format - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - let format = &this.format; - req.url_mut() - .query_pairs_mut() - .append_pair("format", format); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Comment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_comments_batch { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CommentList> { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) work_item_id: i32, - pub(crate) ids: String, - pub(crate) include_deleted: Option<bool>, - pub(crate) expand: Option<String>, - } - 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); - self - } - #[doc = "Specifies the additional data retrieval options for work item comments."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CommentList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CommentList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add_comment { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Comment> { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CommentCreate, - pub(crate) project: String, - pub(crate) work_item_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Comment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_comment { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Comment> { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) work_item_id: i32, - pub(crate) comment_id: i32, - pub(crate) include_deleted: Option<bool>, - pub(crate) expand: Option<String>, - } - 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); - self - } - #[doc = "Specifies the additional data retrieval options for work item comments."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id, - &this.comment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Comment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_comment { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Comment> { - let bytes = self.0.into_body().collect().await?; - let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id, - &this.comment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Comment>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id, - &this.comment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CommentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::CommentList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) work_item_id: i32, + pub(crate) top: Option<i32>, + pub(crate) continuation_token: Option<String>, + pub(crate) include_deleted: Option<bool>, + pub(crate) expand: Option<String>, + pub(crate) order: Option<String>, + } + impl RequestBuilder { + #[doc = "Max number of comments to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Used to query for the next page of comments."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[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); + self + } + #[doc = "Specifies the additional data retrieval options for work item comments."] + pub fn expand(mut self, expand: impl Into<String>) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "Order in which the comments should be returned."] + pub fn order(mut self, order: impl Into<String>) -> Self { + self.order = Some(order.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments?", + this.client.endpoint(), + &this.organization, + &this.project, + &this.work_item_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + if let Some(order) = &this.order { + req.url_mut().query_pairs_mut().append_pair("order", order); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CommentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CommentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_comments_batch { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CommentList> { + let bytes = self.0.into_body().collect().await?; + let body: models::CommentList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) work_item_id: i32, + pub(crate) ids: String, + pub(crate) include_deleted: Option<bool>, + pub(crate) expand: Option<String>, + } + 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); + self + } + #[doc = "Specifies the additional data retrieval options for work item comments."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments", + this.client.endpoint(), + &this.organization, + &this.project, + &this.work_item_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CommentList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CommentList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Comment> { + let bytes = self.0.into_body().collect().await?; + let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CommentCreate, + pub(crate) project: String, + pub(crate) work_item_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments", + this.client.endpoint(), + &this.organization, + &this.project, + &this.work_item_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Comment>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_comment { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Comment> { + let bytes = self.0.into_body().collect().await?; + let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) work_item_id: i32, + pub(crate) comment_id: i32, + pub(crate) include_deleted: Option<bool>, + pub(crate) expand: Option<String>, + } + 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); + self + } + #[doc = "Specifies the additional data retrieval options for work item comments."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.work_item_id, + &this.comment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Comment>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Comment> { + let bytes = self.0.into_body().collect().await?; + let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.work_item_id, + &this.comment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Comment>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Comment>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.work_item_id, + &this.comment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod artifact_link_types { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + } + pub mod list { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkArtifactLinkList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkArtifactLinkList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/wit/artifactlinktypes", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkArtifactLinkList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkArtifactLinkList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkArtifactLinkList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkArtifactLinkList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/wit/artifactlinktypes", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkArtifactLinkList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkArtifactLinkList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod work_item_icons { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of all work item icons."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] + #[doc = "* `icon`: The name of the icon"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn get( + &self, + icon: impl Into<String>, + organization: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + icon: icon.into(), + organization: organization.into(), + color: None, + v: None, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of all work item icons."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> 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 = "Arguments:"] - #[doc = "* `icon`: The name of the icon"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn get( - &self, - icon: impl Into<String>, - organization: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - icon: icon.into(), - organization: organization.into(), - color: None, - v: None, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemIconList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemIconList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/wit/workitemicons", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemIconList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemIconList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemIcon> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemIcon = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) icon: String, - pub(crate) organization: String, - pub(crate) color: Option<String>, - pub(crate) v: Option<i32>, - } - impl RequestBuilder { - #[doc = "The 6-digit hex color for the icon"] - pub fn color(mut self, color: impl Into<String>) -> Self { - self.color = Some(color.into()); - self - } - #[doc = "The version of the icon (used only for cache invalidation)"] - pub fn v(mut self, v: i32) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/wit/workitemicons/{}", - this.client.endpoint(), - &this.organization, - &this.icon - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemIcon>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemIcon>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemIconList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemIconList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/wit/workitemicons", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemIconList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemIconList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemIcon> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemIcon = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) icon: String, + pub(crate) organization: String, + pub(crate) color: Option<String>, + pub(crate) v: Option<i32>, + } + impl RequestBuilder { + #[doc = "The 6-digit hex color for the icon"] + pub fn color(mut self, color: impl Into<String>) -> Self { + self.color = Some(color.into()); + self + } + #[doc = "The version of the icon (used only for cache invalidation)"] + pub fn v(mut self, v: i32) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/wit/workitemicons/{}", + this.client.endpoint(), + &this.organization, + &this.icon + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemIcon>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemIcon>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod work_item_relation_types { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the work item relation types."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Gets the work item relation type definition."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `relation`: The relation name"] + pub fn get( + &self, + organization: impl Into<String>, + relation: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + relation: relation.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the work item relation types."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - #[doc = "Gets the work item relation type definition."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `relation`: The relation name"] - pub fn get( - &self, - organization: impl Into<String>, - relation: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - relation: relation.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemRelationTypeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemRelationTypeList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/wit/workitemrelationtypes", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemRelationTypeList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemRelationTypeList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemRelationType> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemRelationType = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) relation: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/wit/workitemrelationtypes/{}", - this.client.endpoint(), - &this.organization, - &this.relation - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemRelationType>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemRelationType>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemRelationTypeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemRelationTypeList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/wit/workitemrelationtypes", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemRelationTypeList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemRelationTypeList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemRelationType> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemRelationType = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) relation: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/wit/workitemrelationtypes/{}", + this.client.endpoint(), + &this.organization, + &this.relation + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemRelationType>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemRelationType>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod work_item_transitions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns the next state on the given work item IDs."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `ids`: list of work item ids"] + pub fn list( + &self, + organization: impl Into<String>, + ids: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + ids: ids.into(), + action: None, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns the next state on the given work item IDs."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `ids`: list of work item ids"] - pub fn list( - &self, - organization: impl Into<String>, - ids: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - ids: ids.into(), - action: None, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::WorkItemNextStateOnTransitionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemNextStateOnTransitionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) ids: String, - pub(crate) action: Option<String>, - } - impl RequestBuilder { - #[doc = "possible actions. Currently only supports checkin"] - pub fn action(mut self, action: impl Into<String>) -> Self { - self.action = Some(action.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/wit/workitemtransitions", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemNextStateOnTransitionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemNextStateOnTransitionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::WorkItemNextStateOnTransitionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemNextStateOnTransitionList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) ids: String, + pub(crate) action: Option<String>, + } + impl RequestBuilder { + #[doc = "possible actions. Currently only supports checkin"] + pub fn action(mut self, action: impl Into<String>) -> Self { + self.action = Some(action.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/wit/workitemtransitions", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemNextStateOnTransitionList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::WorkItemNextStateOnTransitionList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod account_my_work_recent_activity { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets recent work item activities"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets recent work item activities"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::AccountRecentActivityWorkItemModel2List> { - let bytes = self.0.into_body().collect().await?; - let body: models::AccountRecentActivityWorkItemModel2List = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/_apis/work/accountmyworkrecentactivity", - this.client.endpoint(), - &this.organization - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AccountRecentActivityWorkItemModel2List>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::AccountRecentActivityWorkItemModel2List>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::AccountRecentActivityWorkItemModel2List> { + let bytes = self.0.into_body().collect().await?; + let body: models::AccountRecentActivityWorkItemModel2List = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/_apis/work/accountmyworkrecentactivity", + this.client.endpoint(), + &this.organization + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AccountRecentActivityWorkItemModel2List>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::AccountRecentActivityWorkItemModel2List>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod artifact_uri_query { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Defines a list of artifact URI for querying work items."] + #[doc = "* `project`: Project ID or project name"] + pub fn query( + &self, + organization: impl Into<String>, + body: impl Into<models::ArtifactUriQuery>, + project: impl Into<String>, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + pub mod query { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Defines a list of artifact URI for querying work items."] - #[doc = "* `project`: Project ID or project name"] - pub fn query( - &self, - organization: impl Into<String>, - body: impl Into<models::ArtifactUriQuery>, - project: impl Into<String>, - ) -> query::RequestBuilder { - query::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - } - pub mod query { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ArtifactUriQueryResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::ArtifactUriQueryResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ArtifactUriQuery, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/artifacturiquery", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ArtifactUriQueryResult>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ArtifactUriQueryResult>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ArtifactUriQueryResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::ArtifactUriQueryResult = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ArtifactUriQuery, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/artifacturiquery", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ArtifactUriQueryResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ArtifactUriQueryResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod attachments { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Stream to upload"] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: Attachment ID"] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + id: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Stream to upload"] + #[doc = "* `id`: The id of the attachment"] + #[doc = "* `content_range_header`: starting and ending byte positions for chunked file upload, format is \"Content-Range\": \"bytes 0-10000/50000\""] + #[doc = "* `project`: Project ID or project name"] + pub fn upload_chunk( + &self, + organization: impl Into<String>, + body: impl Into<String>, + id: impl Into<String>, + content_range_header: impl Into<String>, + project: impl Into<String>, + ) -> 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 create { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Stream to upload"] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: Attachment ID"] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - id: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Stream to upload"] - #[doc = "* `id`: The id of the attachment"] - #[doc = "* `content_range_header`: starting and ending byte positions for chunked file upload, format is \"Content-Range\": \"bytes 0-10000/50000\""] - #[doc = "* `project`: Project ID or project name"] - pub fn upload_chunk( - &self, - organization: impl Into<String>, - body: impl Into<String>, - id: impl Into<String>, - content_range_header: impl Into<String>, - project: impl Into<String>, - ) -> 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 create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AttachmentReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::AttachmentReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: String, - pub(crate) project: String, - pub(crate) file_name: Option<String>, - pub(crate) upload_type: Option<String>, - pub(crate) area_path: Option<String>, - } - impl RequestBuilder { - #[doc = "The name of the file"] - pub fn file_name(mut self, file_name: impl Into<String>) -> Self { - self.file_name = Some(file_name.into()); - self - } - #[doc = "Attachment upload type: Simple or Chunked"] - pub fn upload_type(mut self, upload_type: impl Into<String>) -> Self { - self.upload_type = Some(upload_type.into()); - self - } - #[doc = "Target project Area Path"] - pub fn area_path(mut self, area_path: impl Into<String>) -> Self { - self.area_path = Some(area_path.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/attachments", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AttachmentReference>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::AttachmentReference>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) id: String, - pub(crate) project: String, - pub(crate) file_name: Option<String>, - pub(crate) download: Option<bool>, - } - impl RequestBuilder { - #[doc = "Name of the file"] - pub fn file_name(mut self, file_name: impl Into<String>) -> Self { - self.file_name = Some(file_name.into()); - self - } - #[doc = "If set to <c>true</c> always download attachment"] - pub fn download(mut self, download: bool) -> Self { - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/attachments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod upload_chunk { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::AttachmentReference> { - let bytes = self.0.into_body().collect().await?; - let body: models::AttachmentReference = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: String, - pub(crate) id: String, - pub(crate) content_range_header: String, - pub(crate) project: String, - pub(crate) file_name: Option<String>, - } - impl RequestBuilder { - pub fn file_name(mut self, file_name: impl Into<String>) -> Self { - self.file_name = Some(file_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/attachments/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::AttachmentReference>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::AttachmentReference>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AttachmentReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::AttachmentReference = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: String, + pub(crate) project: String, + pub(crate) file_name: Option<String>, + pub(crate) upload_type: Option<String>, + pub(crate) area_path: Option<String>, + } + impl RequestBuilder { + #[doc = "The name of the file"] + pub fn file_name(mut self, file_name: impl Into<String>) -> Self { + self.file_name = Some(file_name.into()); + self + } + #[doc = "Attachment upload type: Simple or Chunked"] + pub fn upload_type(mut self, upload_type: impl Into<String>) -> Self { + self.upload_type = Some(upload_type.into()); + self + } + #[doc = "Target project Area Path"] + pub fn area_path(mut self, area_path: impl Into<String>) -> Self { + self.area_path = Some(area_path.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/attachments", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/octet-stream"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AttachmentReference>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AttachmentReference>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) id: String, + pub(crate) project: String, + pub(crate) file_name: Option<String>, + pub(crate) download: Option<bool>, + } + impl RequestBuilder { + #[doc = "Name of the file"] + pub fn file_name(mut self, file_name: impl Into<String>) -> Self { + self.file_name = Some(file_name.into()); + self + } + #[doc = "If set to <c>true</c> always download attachment"] + pub fn download(mut self, download: bool) -> Self { + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/attachments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod upload_chunk { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::AttachmentReference> { + let bytes = self.0.into_body().collect().await?; + let body: models::AttachmentReference = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: String, + pub(crate) id: String, + pub(crate) content_range_header: String, + pub(crate) project: String, + pub(crate) file_name: Option<String>, + } + impl RequestBuilder { + pub fn file_name(mut self, file_name: impl Into<String>) -> Self { + self.file_name = Some(file_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/attachments/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/octet-stream"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::AttachmentReference>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::AttachmentReference>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod fields { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + expand: None, + } + } + #[doc = "Create a new field."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: New field definition"] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemField>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `field_name_or_ref_name`: Field simple name or reference name"] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + field_name_or_ref_name: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Payload contains desired value of the field's properties"] + #[doc = "* `field_name_or_ref_name`: Name/reference name of the field to be updated"] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::UpdateWorkItemField>, + field_name_or_ref_name: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `field_name_or_ref_name`: Field simple name or reference name"] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + field_name_or_ref_name: impl Into<String>, + project: impl Into<String>, + ) -> 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 list { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - expand: None, - } - } - #[doc = "Create a new field."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: New field definition"] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemField2>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `field_name_or_ref_name`: Field simple name or reference name"] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - field_name_or_ref_name: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Payload contains desired value of the field's properties"] - #[doc = "* `field_name_or_ref_name`: Name/reference name of the field to be updated"] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::FieldUpdate>, - field_name_or_ref_name: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `field_name_or_ref_name`: Field simple name or reference name"] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - field_name_or_ref_name: impl Into<String>, - project: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemField2List> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemField2List = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) expand: Option<String>, - } - 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<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/fields", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemField2List>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemField2List>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemField2> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemField2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemField2, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/fields", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemField2>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemField2>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemField2> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemField2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) field_name_or_ref_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/fields/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.field_name_or_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemField2>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemField2>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemField2> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemField2 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::FieldUpdate, - pub(crate) field_name_or_ref_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/fields/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.field_name_or_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemField2>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemField2>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) field_name_or_ref_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/fields/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.field_name_or_ref_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemFieldList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemFieldList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) expand: Option<String>, + } + 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<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/fields", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemFieldList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemFieldList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemField> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemField = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WorkItemField, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/fields", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemField>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemField>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemField> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemField = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) field_name_or_ref_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/fields/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.field_name_or_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemField>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemField>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemField> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemField = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UpdateWorkItemField, + pub(crate) field_name_or_ref_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/fields/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.field_name_or_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemField>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemField>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) field_name_or_ref_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/fields/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.field_name_or_ref_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod project_process_migration { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn migrate_projects_process( + &self, + organization: impl Into<String>, + body: impl Into<models::ProcessIdModel>, + project: impl Into<String>, + ) -> migrate_projects_process::RequestBuilder { + migrate_projects_process::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + pub mod migrate_projects_process { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn migrate_projects_process( - &self, - organization: impl Into<String>, - body: impl Into<models::ProcessIdModel>, - project: impl Into<String>, - ) -> migrate_projects_process::RequestBuilder { - migrate_projects_process::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - } - pub mod migrate_projects_process { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ProcessMigrationResultModel> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessMigrationResultModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ProcessIdModel, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/projectprocessmigration", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessMigrationResultModel>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessMigrationResultModel>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessMigrationResultModel> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessMigrationResultModel = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ProcessIdModel, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/projectprocessmigration", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessMigrationResultModel>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::ProcessMigrationResultModel>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod reporting_work_item_links { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a batch of work item links"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a batch of work item links"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ReportingWorkItemLinksBatch> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReportingWorkItemLinksBatch = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) link_types: Option<String>, - pub(crate) types: Option<String>, - pub(crate) continuation_token: Option<String>, - pub(crate) start_date_time: Option<time::OffsetDateTime>, - } - 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<String>) -> Self { - self.link_types = Some(link_types.into()); - self - } - #[doc = "A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types."] - pub fn types(mut self, types: impl Into<String>) -> Self { - self.types = Some(types.into()); - self - } - #[doc = "Specifies the continuation token to start the batch from. Omit this parameter to get the first batch of links."] - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter."] - pub fn start_date_time( - mut self, - start_date_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.start_date_time = Some(start_date_time.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/reporting/workitemlinks", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReportingWorkItemLinksBatch>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ReportingWorkItemLinksBatch>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReportingWorkItemLinksBatch> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReportingWorkItemLinksBatch = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) link_types: Option<String>, + pub(crate) types: Option<String>, + pub(crate) continuation_token: Option<String>, + pub(crate) start_date_time: Option<time::OffsetDateTime>, + } + 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<String>) -> Self { + self.link_types = Some(link_types.into()); + self + } + #[doc = "A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types."] + pub fn types(mut self, types: impl Into<String>) -> Self { + self.types = Some(types.into()); + self + } + #[doc = "Specifies the continuation token to start the batch from. Omit this parameter to get the first batch of links."] + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter."] + pub fn start_date_time(mut self, start_date_time: impl Into<time::OffsetDateTime>) -> Self { + self.start_date_time = Some(start_date_time.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/reporting/workitemlinks", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReportingWorkItemLinksBatch>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::ReportingWorkItemLinksBatch>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod reporting_work_item_revisions { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn read_reporting_revisions_get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: An object that contains request settings: field filter, type filter, identity format"] + #[doc = "* `project`: Project ID or project name"] + pub fn read_reporting_revisions_post( + &self, + organization: impl Into<String>, + body: impl Into<models::ReportingWorkItemRevisionsFilter>, + project: impl Into<String>, + ) -> 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 read_reporting_revisions_get { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn read_reporting_revisions_get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: An object that contains request settings: field filter, type filter, identity format"] - #[doc = "* `project`: Project ID or project name"] - pub fn read_reporting_revisions_post( - &self, - organization: impl Into<String>, - body: impl Into<models::ReportingWorkItemRevisionsFilter>, - project: impl Into<String>, - ) -> 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 read_reporting_revisions_get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ReportingWorkItemRevisionsBatch> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReportingWorkItemRevisionsBatch = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) fields: Option<String>, - pub(crate) types: Option<String>, - pub(crate) continuation_token: Option<String>, - pub(crate) start_date_time: Option<time::OffsetDateTime>, - pub(crate) include_identity_ref: Option<bool>, - pub(crate) include_deleted: Option<bool>, - pub(crate) include_tag_ref: Option<bool>, - pub(crate) include_latest_only: Option<bool>, - pub(crate) expand: Option<String>, - pub(crate) include_discussion_changes_only: Option<bool>, - pub(crate) max_page_size: Option<i32>, - } - 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<String>) -> Self { - self.fields = Some(fields.into()); - self - } - #[doc = "A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types."] - pub fn types(mut self, types: impl Into<String>) -> Self { - self.types = Some(types.into()); - self - } - #[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<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter."] - pub fn start_date_time( - mut self, - start_date_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.start_date_time = Some(start_date_time.into()); - self - } - #[doc = "Return an identity reference instead of a string value for identity fields."] - pub fn include_identity_ref(mut self, include_identity_ref: bool) -> Self { - self.include_identity_ref = Some(include_identity_ref); - self - } - #[doc = "Specify if the deleted item should be returned."] - pub fn include_deleted(mut self, include_deleted: bool) -> Self { - self.include_deleted = Some(include_deleted); - self - } - #[doc = "Specify if the tag objects should be returned for System.Tags field."] - pub fn include_tag_ref(mut self, include_tag_ref: bool) -> Self { - self.include_tag_ref = Some(include_tag_ref); - self - } - #[doc = "Return only the latest revisions of work items, skipping all historical revisions"] - pub fn include_latest_only(mut self, include_latest_only: bool) -> Self { - self.include_latest_only = Some(include_latest_only); - self - } - #[doc = "Return all the fields in work item revisions, including long text fields which are not returned by default"] - pub fn expand(mut self, expand: impl Into<String>) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Return only the those revisions of work items, where only history field was changed"] - pub fn include_discussion_changes_only( - mut self, - include_discussion_changes_only: bool, - ) -> Self { - self.include_discussion_changes_only = Some(include_discussion_changes_only); - self - } - #[doc = "The maximum number of results to return in this batch"] - pub fn max_page_size(mut self, max_page_size: i32) -> Self { - self.max_page_size = Some(max_page_size); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/reporting/workitemrevisions", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReportingWorkItemRevisionsBatch>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ReportingWorkItemRevisionsBatch>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod read_reporting_revisions_post { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ReportingWorkItemRevisionsBatch> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReportingWorkItemRevisionsBatch = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ReportingWorkItemRevisionsFilter, - pub(crate) project: String, - pub(crate) continuation_token: Option<String>, - pub(crate) start_date_time: Option<time::OffsetDateTime>, - pub(crate) expand: Option<String>, - } - 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<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - #[doc = "Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter."] - pub fn start_date_time( - mut self, - start_date_time: impl Into<time::OffsetDateTime>, - ) -> Self { - self.start_date_time = Some(start_date_time.into()); - self - } - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/reporting/workitemrevisions", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReportingWorkItemRevisionsBatch>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ReportingWorkItemRevisionsBatch>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReportingWorkItemRevisionsBatch> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReportingWorkItemRevisionsBatch = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) fields: Option<String>, + pub(crate) types: Option<String>, + pub(crate) continuation_token: Option<String>, + pub(crate) start_date_time: Option<time::OffsetDateTime>, + pub(crate) include_identity_ref: Option<bool>, + pub(crate) include_deleted: Option<bool>, + pub(crate) include_tag_ref: Option<bool>, + pub(crate) include_latest_only: Option<bool>, + pub(crate) expand: Option<String>, + pub(crate) include_discussion_changes_only: Option<bool>, + pub(crate) max_page_size: Option<i32>, + } + 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<String>) -> Self { + self.fields = Some(fields.into()); + self + } + #[doc = "A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types."] + pub fn types(mut self, types: impl Into<String>) -> Self { + self.types = Some(types.into()); + self + } + #[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<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter."] + pub fn start_date_time(mut self, start_date_time: impl Into<time::OffsetDateTime>) -> Self { + self.start_date_time = Some(start_date_time.into()); + self + } + #[doc = "Return an identity reference instead of a string value for identity fields."] + pub fn include_identity_ref(mut self, include_identity_ref: bool) -> Self { + self.include_identity_ref = Some(include_identity_ref); + self + } + #[doc = "Specify if the deleted item should be returned."] + pub fn include_deleted(mut self, include_deleted: bool) -> Self { + self.include_deleted = Some(include_deleted); + self + } + #[doc = "Specify if the tag objects should be returned for System.Tags field."] + pub fn include_tag_ref(mut self, include_tag_ref: bool) -> Self { + self.include_tag_ref = Some(include_tag_ref); + self + } + #[doc = "Return only the latest revisions of work items, skipping all historical revisions"] + pub fn include_latest_only(mut self, include_latest_only: bool) -> Self { + self.include_latest_only = Some(include_latest_only); + self + } + #[doc = "Return all the fields in work item revisions, including long text fields which are not returned by default"] + pub fn expand(mut self, expand: impl Into<String>) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "Return only the those revisions of work items, where only history field was changed"] + pub fn include_discussion_changes_only( + mut self, + include_discussion_changes_only: bool, + ) -> Self { + self.include_discussion_changes_only = Some(include_discussion_changes_only); + self + } + #[doc = "The maximum number of results to return in this batch"] + pub fn max_page_size(mut self, max_page_size: i32) -> Self { + self.max_page_size = Some(max_page_size); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/reporting/workitemrevisions", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReportingWorkItemRevisionsBatch>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::ReportingWorkItemRevisionsBatch>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod read_reporting_revisions_post { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReportingWorkItemRevisionsBatch> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReportingWorkItemRevisionsBatch = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ReportingWorkItemRevisionsFilter, + pub(crate) project: String, + pub(crate) continuation_token: Option<String>, + pub(crate) start_date_time: Option<time::OffsetDateTime>, + pub(crate) expand: Option<String>, + } + 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<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + #[doc = "Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter."] + pub fn start_date_time(mut self, start_date_time: impl Into<time::OffsetDateTime>) -> Self { + self.start_date_time = Some(start_date_time.into()); + self + } + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/reporting/workitemrevisions", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReportingWorkItemRevisionsBatch>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::ReportingWorkItemRevisionsBatch>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod work_item_revisions_discussions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn read_reporting_discussions( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 read_reporting_discussions { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn read_reporting_discussions( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 read_reporting_discussions { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::ReportingWorkItemRevisionsBatch> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReportingWorkItemRevisionsBatch = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) continuation_token: Option<String>, - pub(crate) max_page_size: Option<i32>, - } - impl RequestBuilder { - pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { - self.continuation_token = Some(continuation_token.into()); - self - } - pub fn max_page_size(mut self, max_page_size: i32) -> Self { - self.max_page_size = Some(max_page_size); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/reporting/workItemRevisions/discussions", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReportingWorkItemRevisionsBatch>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ReportingWorkItemRevisionsBatch>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReportingWorkItemRevisionsBatch> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReportingWorkItemRevisionsBatch = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) continuation_token: Option<String>, + pub(crate) max_page_size: Option<i32>, + } + impl RequestBuilder { + pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + pub fn max_page_size(mut self, max_page_size: i32) -> Self { + self.max_page_size = Some(max_page_size); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/reporting/workItemRevisions/discussions", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReportingWorkItemRevisionsBatch>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::ReportingWorkItemRevisionsBatch>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod send_mail { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "RESTful method to send mail for selected/queried work items."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn send_mail( + &self, + organization: impl Into<String>, + body: impl Into<models::SendMailBody>, + project: impl Into<String>, + ) -> send_mail::RequestBuilder { + send_mail::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + pub mod send_mail { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "RESTful method to send mail for selected/queried work items."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn send_mail( - &self, - organization: impl Into<String>, - body: impl Into<models::SendMailBody>, - project: impl Into<String>, - ) -> send_mail::RequestBuilder { - send_mail::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - } - pub mod send_mail { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::SendMailBody, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/sendmail", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::SendMailBody, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/sendmail", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod tags { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + tag_id_or_name: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + tag_id_or_name: tag_id_or_name.into(), + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemTagDefinition>, + project: impl Into<String>, + tag_id_or_name: impl Into<String>, + ) -> 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + tag_id_or_name: impl Into<String>, + ) -> 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get all the tags for the project."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - #[doc = "Get the tag for the project."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `tag_id_or_name`: Tag ID or tag name."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - tag_id_or_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `tag_id_or_name`: Tag ID or tag name."] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemTagDefinition>, - project: impl Into<String>, - tag_id_or_name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `tag_id_or_name`: Tag ID or tag name."] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - tag_id_or_name: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTagDefinitionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTagDefinitionList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/tags", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTagDefinitionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemTagDefinitionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTagDefinition> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTagDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/tags/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.tag_id_or_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTagDefinition>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemTagDefinition>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTagDefinition> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTagDefinition = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemTagDefinition, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/tags/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.tag_id_or_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTagDefinition>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemTagDefinition>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/tags/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.tag_id_or_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } -} -pub mod temp_queries { + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTagDefinitionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTagDefinitionList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/tags", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTagDefinitionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTagDefinitionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The temporary query to create"] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::TemporaryQueryRequestModel>, - project: impl Into<String>, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TemporaryQueryResponseModel> { - let bytes = self.0.into_body().collect().await?; - let body: models::TemporaryQueryResponseModel = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TemporaryQueryRequestModel, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/tempqueries", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TemporaryQueryResponseModel>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TemporaryQueryResponseModel>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTagDefinition> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTagDefinition = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/tags/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.tag_id_or_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTagDefinition>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTagDefinition>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTagDefinition> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTagDefinition = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WorkItemTagDefinition, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/tags/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.tag_id_or_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTagDefinition>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTagDefinition>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/tags/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.tag_id_or_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod work_items { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a list of work items (Maximum 200)"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `ids`: The comma-separated list of requested work item ids. (Maximum 200 ids allowed)."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + ids: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `type_`: The work item type name"] + pub fn get_work_item_template( + &self, + organization: impl Into<String>, + project: impl Into<String>, + type_: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A list of operations to perform when creating a Work Item"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `type_`: The work item type of the work item to create"] + pub fn create( + &self, + organization: impl Into<String>, + body: Vec<models::JsonPatchOperation>, + project: impl Into<String>, + type_: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: The work item id"] + #[doc = "* `project`: Project ID or project name"] + pub fn get_work_item( + &self, + organization: impl Into<String>, + id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: A list of operations to perform when updating a Work Item"] + #[doc = "* `id`: The id of the work item to update"] + #[doc = "* `project`: Project ID or project name"] + pub fn update( + &self, + organization: impl Into<String>, + body: Vec<models::JsonPatchOperation>, + id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: ID of the work item to be deleted"] + #[doc = "* `project`: Project ID or project name"] + pub fn delete( + &self, + organization: impl Into<String>, + id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get_work_items_batch( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemBatchGetRequest>, + project: impl Into<String>, + ) -> get_work_items_batch::RequestBuilder { + get_work_items_batch::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns a list of work items (Maximum 200)"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `ids`: The comma-separated list of requested work item ids. (Maximum 200 ids allowed)."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - ids: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `type_`: The work item type name"] - pub fn get_work_item_template( - &self, - organization: impl Into<String>, - project: impl Into<String>, - type_: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A list of operations to perform when creating a Work Item"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `type_`: The work item type of the work item to create"] - pub fn create( - &self, - organization: impl Into<String>, - body: Vec<models::JsonPatchOperation>, - project: impl Into<String>, - type_: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: The work item id"] - #[doc = "* `project`: Project ID or project name"] - pub fn get_work_item( - &self, - organization: impl Into<String>, - id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: A list of operations to perform when updating a Work Item"] - #[doc = "* `id`: The id of the work item to update"] - #[doc = "* `project`: Project ID or project name"] - pub fn update( - &self, - organization: impl Into<String>, - body: Vec<models::JsonPatchOperation>, - id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: ID of the work item to be deleted"] - #[doc = "* `project`: Project ID or project name"] - pub fn delete( - &self, - organization: impl Into<String>, - id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get_work_items_batch( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemBatchGetRequest>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn delete_work_items( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemDeleteBatchRequest>, - project: impl Into<String>, - ) -> delete_work_items::RequestBuilder { - delete_work_items::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) ids: String, - pub(crate) project: String, - pub(crate) fields: Option<String>, - pub(crate) as_of: Option<time::OffsetDateTime>, - pub(crate) expand: Option<String>, - pub(crate) error_policy: Option<String>, - } - impl RequestBuilder { - #[doc = "Comma-separated list of requested fields"] - pub fn fields(mut self, fields: impl Into<String>) -> Self { - self.fields = Some(fields.into()); - self - } - #[doc = "AsOf UTC date time string"] - pub fn as_of(mut self, as_of: impl Into<time::OffsetDateTime>) -> Self { - self.as_of = Some(as_of.into()); - self - } - #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."] - pub fn expand(mut self, expand: impl Into<String>) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}."] - pub fn error_policy(mut self, error_policy: impl Into<String>) -> Self { - self.error_policy = Some(error_policy.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitems", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - if let Some(error_policy) = &this.error_policy { - req.url_mut() - .query_pairs_mut() - .append_pair("errorPolicy", error_policy); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_work_item_template { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItem> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) type_: String, - pub(crate) fields: Option<String>, - pub(crate) as_of: Option<time::OffsetDateTime>, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "Comma-separated list of requested fields"] - pub fn fields(mut self, fields: impl Into<String>) -> Self { - self.fields = Some(fields.into()); - self - } - #[doc = "AsOf UTC date time string"] - pub fn as_of(mut self, as_of: impl Into<time::OffsetDateTime>) -> Self { - self.as_of = Some(as_of.into()); - self - } - #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitems/${}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.type_ - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItem>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItem>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItem> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::JsonPatchOperation>, - pub(crate) project: String, - pub(crate) type_: String, - pub(crate) validate_only: Option<bool>, - pub(crate) bypass_rules: Option<bool>, - pub(crate) suppress_notifications: Option<bool>, - pub(crate) expand: Option<String>, - } - 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); - self - } - #[doc = "Do not enforce the work item type rules on this update"] - pub fn bypass_rules(mut self, bypass_rules: bool) -> Self { - self.bypass_rules = Some(bypass_rules); - self - } - #[doc = "Do not fire any notifications for this change"] - pub fn suppress_notifications(mut self, suppress_notifications: bool) -> Self { - self.suppress_notifications = Some(suppress_notifications); - self - } - #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitems/${}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.type_ - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::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); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItem>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItem>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_work_item { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItem> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) id: i32, - pub(crate) project: String, - pub(crate) fields: Option<String>, - pub(crate) as_of: Option<time::OffsetDateTime>, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - #[doc = "Comma-separated list of requested fields"] - pub fn fields(mut self, fields: impl Into<String>) -> Self { - self.fields = Some(fields.into()); - self - } - #[doc = "AsOf UTC date time string"] - pub fn as_of(mut self, as_of: impl Into<time::OffsetDateTime>) -> Self { - self.as_of = Some(as_of.into()); - self - } - #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitems/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItem>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItem>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItem> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::JsonPatchOperation>, - pub(crate) id: i32, - pub(crate) project: String, - pub(crate) validate_only: Option<bool>, - pub(crate) bypass_rules: Option<bool>, - pub(crate) suppress_notifications: Option<bool>, - pub(crate) expand: Option<String>, - } - 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); - self - } - #[doc = "Do not enforce the work item type rules on this update"] - pub fn bypass_rules(mut self, bypass_rules: bool) -> Self { - self.bypass_rules = Some(bypass_rules); - self - } - #[doc = "Do not fire any notifications for this change"] - pub fn suppress_notifications(mut self, suppress_notifications: bool) -> Self { - self.suppress_notifications = Some(suppress_notifications); - self - } - #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."] - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitems/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::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); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItem>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItem>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemDelete> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemDelete = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) id: i32, - pub(crate) project: String, - pub(crate) destroy: Option<bool>, - } - 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 - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitems/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(destroy) = &this.destroy { - req.url_mut() - .query_pairs_mut() - .append_pair("destroy", &destroy.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemDelete>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemDelete>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_work_items_batch { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemBatchGetRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemsbatch", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_work_items { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemDeleteBatch> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemDeleteBatch = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemDeleteBatchRequest, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemsdelete", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemDeleteBatch>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemDeleteBatch>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) ids: String, + pub(crate) project: String, + pub(crate) fields: Option<String>, + pub(crate) as_of: Option<time::OffsetDateTime>, + pub(crate) expand: Option<String>, + pub(crate) error_policy: Option<String>, + } + impl RequestBuilder { + #[doc = "Comma-separated list of requested fields"] + pub fn fields(mut self, fields: impl Into<String>) -> Self { + self.fields = Some(fields.into()); + self + } + #[doc = "AsOf UTC date time string"] + pub fn as_of(mut self, as_of: impl Into<time::OffsetDateTime>) -> Self { + self.as_of = Some(as_of.into()); + self + } + #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."] + pub fn expand(mut self, expand: impl Into<String>) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}."] + pub fn error_policy(mut self, error_policy: impl Into<String>) -> Self { + self.error_policy = Some(error_policy.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitems", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + if let Some(error_policy) = &this.error_policy { + req + .url_mut() + .query_pairs_mut() + .append_pair("errorPolicy", error_policy); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_work_item_template { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItem> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) type_: String, + pub(crate) fields: Option<String>, + pub(crate) as_of: Option<time::OffsetDateTime>, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "Comma-separated list of requested fields"] + pub fn fields(mut self, fields: impl Into<String>) -> Self { + self.fields = Some(fields.into()); + self + } + #[doc = "AsOf UTC date time string"] + pub fn as_of(mut self, as_of: impl Into<time::OffsetDateTime>) -> Self { + self.as_of = Some(as_of.into()); + self + } + #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitems/${}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.type_ + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItem>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WorkItem>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItem> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::JsonPatchOperation>, + pub(crate) project: String, + pub(crate) type_: String, + pub(crate) validate_only: Option<bool>, + pub(crate) bypass_rules: Option<bool>, + pub(crate) suppress_notifications: Option<bool>, + pub(crate) expand: Option<String>, + } + 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); + self + } + #[doc = "Do not enforce the work item type rules on this update"] + pub fn bypass_rules(mut self, bypass_rules: bool) -> Self { + self.bypass_rules = Some(bypass_rules); + self + } + #[doc = "Do not fire any notifications for this change"] + pub fn suppress_notifications(mut self, suppress_notifications: bool) -> Self { + self.suppress_notifications = Some(suppress_notifications); + self + } + #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitems/${}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.type_ + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::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); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItem>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WorkItem>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_work_item { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItem> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) id: i32, + pub(crate) project: String, + pub(crate) fields: Option<String>, + pub(crate) as_of: Option<time::OffsetDateTime>, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + #[doc = "Comma-separated list of requested fields"] + pub fn fields(mut self, fields: impl Into<String>) -> Self { + self.fields = Some(fields.into()); + self + } + #[doc = "AsOf UTC date time string"] + pub fn as_of(mut self, as_of: impl Into<time::OffsetDateTime>) -> Self { + self.as_of = Some(as_of.into()); + self + } + #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitems/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItem>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WorkItem>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItem> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::JsonPatchOperation>, + pub(crate) id: i32, + pub(crate) project: String, + pub(crate) validate_only: Option<bool>, + pub(crate) bypass_rules: Option<bool>, + pub(crate) suppress_notifications: Option<bool>, + pub(crate) expand: Option<String>, + } + 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); + self + } + #[doc = "Do not enforce the work item type rules on this update"] + pub fn bypass_rules(mut self, bypass_rules: bool) -> Self { + self.bypass_rules = Some(bypass_rules); + self + } + #[doc = "Do not fire any notifications for this change"] + pub fn suppress_notifications(mut self, suppress_notifications: bool) -> Self { + self.suppress_notifications = Some(suppress_notifications); + self + } + #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."] + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitems/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::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); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItem>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WorkItem>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemDelete> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemDelete = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) id: i32, + pub(crate) project: String, + pub(crate) destroy: Option<bool>, + } + 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 + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitems/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(destroy) = &this.destroy { + req + .url_mut() + .query_pairs_mut() + .append_pair("destroy", &destroy.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemDelete>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemDelete>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_work_items_batch { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WorkItemBatchGetRequest, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemsbatch", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod revisions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns the list of fully hydrated work item revisions, paged."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + id: i32, + revision_number: i32, + project: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + revision_number, + project: project.into(), + expand: None, + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns the list of fully hydrated work item revisions, paged."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - id: i32, - revision_number: i32, - project: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - id, - revision_number, - project: project.into(), - expand: None, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) id: i32, - pub(crate) project: String, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/revisions", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItem> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) id: i32, - pub(crate) revision_number: i32, - pub(crate) project: String, - pub(crate) expand: Option<String>, - } - impl RequestBuilder { - pub fn expand(mut self, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/revisions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id, - &this.revision_number - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItem>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItem>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) id: i32, + pub(crate) project: String, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/revisions", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItem> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) id: i32, + pub(crate) revision_number: i32, + pub(crate) project: String, + pub(crate) expand: Option<String>, + } + impl RequestBuilder { + pub fn expand(mut self, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/revisions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id, + &this.revision_number + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItem>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::WorkItem>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod updates { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a the deltas between work item revisions"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + id: i32, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + id: i32, + update_number: i32, + project: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + update_number, + project: project.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns a the deltas between work item revisions"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - id: i32, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - id: i32, - update_number: i32, - project: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - id, - update_number, - project: project.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemUpdateList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemUpdateList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) id: i32, - pub(crate) project: String, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - } - impl RequestBuilder { - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/updates", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemUpdateList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemUpdateList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemUpdate> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemUpdate = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) id: i32, - pub(crate) update_number: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/updates/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id, - &this.update_number - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemUpdate>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemUpdate>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemUpdateList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemUpdateList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) id: i32, + pub(crate) project: String, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + } + impl RequestBuilder { + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/updates", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemUpdateList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemUpdateList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemUpdate> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemUpdate = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) id: i32, + pub(crate) update_number: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/updates/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id, + &this.update_number + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemUpdate>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemUpdate>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod comments_reactions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets reactions of a comment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `work_item_id`: WorkItem ID"] + #[doc = "* `comment_id`: Comment ID"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `work_item_id`: WorkItem ID"] + #[doc = "* `comment_id`: Comment ID"] + #[doc = "* `reaction_type`: Type of the reaction"] + pub fn create( + &self, + organization: impl Into<String>, + project: impl Into<String>, + work_item_id: i32, + comment_id: i32, + reaction_type: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `work_item_id`: WorkItem ID"] + #[doc = "* `comment_id`: Comment ID"] + #[doc = "* `reaction_type`: Type of the reaction"] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + work_item_id: i32, + comment_id: i32, + reaction_type: impl Into<String>, + ) -> 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets reactions of a comment."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `work_item_id`: WorkItem ID"] - #[doc = "* `comment_id`: Comment ID"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `work_item_id`: WorkItem ID"] - #[doc = "* `comment_id`: Comment ID"] - #[doc = "* `reaction_type`: Type of the reaction"] - pub fn create( - &self, - organization: impl Into<String>, - project: impl Into<String>, - work_item_id: i32, - comment_id: i32, - reaction_type: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `work_item_id`: WorkItem ID"] - #[doc = "* `comment_id`: Comment ID"] - #[doc = "* `reaction_type`: Type of the reaction"] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - work_item_id: i32, - comment_id: i32, - reaction_type: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CommentReactionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentReactionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id, - &this.comment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CommentReactionList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::CommentReactionList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CommentReaction> { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentReaction = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) work_item_id: i32, - pub(crate) comment_id: i32, - pub(crate) reaction_type: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id, - &this.comment_id, - &this.reaction_type - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CommentReaction>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CommentReaction>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CommentReaction> { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentReaction = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) work_item_id: i32, - pub(crate) comment_id: i32, - pub(crate) reaction_type: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id, - &this.comment_id, - &this.reaction_type - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CommentReaction>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CommentReaction>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CommentReactionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::CommentReactionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions", + this.client.endpoint(), + &this.organization, + &this.project, + &this.work_item_id, + &this.comment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CommentReactionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CommentReactionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CommentReaction> { + let bytes = self.0.into_body().collect().await?; + let body: models::CommentReaction = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) work_item_id: i32, + pub(crate) comment_id: i32, + pub(crate) reaction_type: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.work_item_id, + &this.comment_id, + &this.reaction_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CommentReaction>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CommentReaction>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CommentReaction> { + let bytes = self.0.into_body().collect().await?; + let body: models::CommentReaction = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) work_item_id: i32, + pub(crate) comment_id: i32, + pub(crate) reaction_type: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.work_item_id, + &this.comment_id, + &this.reaction_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CommentReaction>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CommentReaction>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod comment_reactions_engaged_users { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get users who reacted on the comment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `work_item_id`: WorkItem ID."] + #[doc = "* `comment_id`: Comment ID."] + #[doc = "* `reaction_type`: Type of the reaction."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + work_item_id: i32, + comment_id: i32, + reaction_type: impl Into<String>, + ) -> 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get users who reacted on the comment."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `work_item_id`: WorkItem ID."] - #[doc = "* `comment_id`: Comment ID."] - #[doc = "* `reaction_type`: Type of the reaction."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - work_item_id: i32, - comment_id: i32, - reaction_type: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::IdentityRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::IdentityRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) work_item_id: i32, - pub(crate) comment_id: i32, - pub(crate) reaction_type: String, - pub(crate) top: Option<i32>, - pub(crate) skip: Option<i32>, - } - impl RequestBuilder { - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}/users", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id, - &this.comment_id, - &this.reaction_type - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::IdentityRefList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::IdentityRefList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::IdentityRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::IdentityRefList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) work_item_id: i32, + pub(crate) comment_id: i32, + pub(crate) reaction_type: String, + pub(crate) top: Option<i32>, + pub(crate) skip: Option<i32>, + } + impl RequestBuilder { + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}/users", + this.client.endpoint(), + &this.organization, + &this.project, + &this.work_item_id, + &this.comment_id, + &this.reaction_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::IdentityRefList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::IdentityRefList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod comments_versions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CommentVersionList> { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentVersionList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/versions", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id, - &this.comment_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CommentVersionList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CommentVersionList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::CommentVersion> { - let bytes = self.0.into_body().collect().await?; - let body: models::CommentVersion = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/versions/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.work_item_id, - &this.comment_id, - &this.version - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::CommentVersion>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::CommentVersion>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CommentVersionList> { + let bytes = self.0.into_body().collect().await?; + let body: models::CommentVersionList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/versions", + this.client.endpoint(), + &this.organization, + &this.project, + &this.work_item_id, + &this.comment_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CommentVersionList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CommentVersionList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::CommentVersion> { + let bytes = self.0.into_body().collect().await?; + let body: models::CommentVersion = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/versions/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.work_item_id, + &this.comment_id, + &this.version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::CommentVersion>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::CommentVersion>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod work_item_type_categories { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all work item type categories."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `category`: The category name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + category: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + category: category.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get all work item type categories."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `category`: The category name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - category: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - category: category.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeCategoryList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeCategoryList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypecategories", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTypeCategoryList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemTypeCategoryList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeCategory> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeCategory = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) category: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypecategories/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.category - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTypeCategory>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemTypeCategory>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeCategoryList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTypeCategoryList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypecategories", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTypeCategoryList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTypeCategoryList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeCategory> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTypeCategory = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) category: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypecategories/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.category + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTypeCategory>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTypeCategory>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod work_item_types { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns the list of work item types"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Returns a work item type definition."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `type_`: Work item type name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + type_: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_: type_.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns the list of work item types"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - #[doc = "Returns a work item type definition."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `type_`: Work item type name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - type_: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - type_: type_.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypes", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTypeList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTypeList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemType> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemType = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypes/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.type_ - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemType>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemType>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTypeList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypes", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTypeList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTypeList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemType> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemType = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypes/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.type_ + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemType>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemType>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod work_item_types_field { + use super::models; + 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `type_`: Work item type."] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + type_: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `type_`: Work item type."] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + type_: impl Into<String>, + field: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_: type_.into(), + field: field.into(), + expand: None, + } + } + } + pub mod list { use super::models; - 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `type_`: Work item type."] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - type_: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `type_`: Work item type."] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - type_: impl Into<String>, - field: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - type_: type_.into(), - field: field.into(), - expand: None, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::WorkItemTypeFieldWithReferencesList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeFieldWithReferencesList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) type_: String, - pub(crate) expand: Option<String>, - } - 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, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypes/{}/fields", - this.client.endpoint(), - &this.organization, - &this.project, - &this.type_ - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTypeFieldWithReferencesList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemTypeFieldWithReferencesList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::WorkItemTypeFieldWithReferences> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTypeFieldWithReferences = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) type_: String, - pub(crate) field: String, - pub(crate) expand: Option<String>, - } - 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, expand: impl Into<String>) -> 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypes/{}/fields/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.type_, - &this.field - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTypeFieldWithReferences>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemTypeFieldWithReferences>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::WorkItemTypeFieldWithReferencesList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTypeFieldWithReferencesList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) type_: String, + pub(crate) expand: Option<String>, + } + 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, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypes/{}/fields", + this.client.endpoint(), + &this.organization, + &this.project, + &this.type_ + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTypeFieldWithReferencesList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::WorkItemTypeFieldWithReferencesList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTypeFieldWithReferences> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTypeFieldWithReferences = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) type_: String, + pub(crate) field: String, + pub(crate) expand: Option<String>, + } + 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, expand: impl Into<String>) -> 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypes/{}/fields/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.type_, + &this.field + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(expand) = &this.expand { + req + .url_mut() + .query_pairs_mut() + .append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTypeFieldWithReferences>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::WorkItemTypeFieldWithReferences>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod work_item_type_states { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns the state names and colors for a work item type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `type_`: The state name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + type_: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_: type_.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns the state names and colors for a work item type."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `type_`: The state name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - type_: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - type_: type_.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemStateColorList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemStateColorList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypes/{}/states", - this.client.endpoint(), - &this.organization, - &this.project, - &this.type_ - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemStateColorList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemStateColorList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemStateColorList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemStateColorList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypes/{}/states", + this.client.endpoint(), + &this.organization, + &this.project, + &this.type_ + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemStateColorList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemStateColorList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod templates { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets template"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Template contents"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemTemplate>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + #[doc = "* `template_id`: Template Id"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + template_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Template contents to replace with"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + #[doc = "* `template_id`: Template id"] + pub fn replace_template( + &self, + organization: impl Into<String>, + body: impl Into<models::WorkItemTemplate>, + project: impl Into<String>, + team: impl Into<String>, + template_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + #[doc = "* `template_id`: Template id"] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + template_id: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + template_id: template_id.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets template"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Template contents"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemTemplate>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - #[doc = "* `template_id`: Template Id"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - template_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Template contents to replace with"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - #[doc = "* `template_id`: Template id"] - pub fn replace_template( - &self, - organization: impl Into<String>, - body: impl Into<models::WorkItemTemplate>, - project: impl Into<String>, - team: impl Into<String>, - template_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - #[doc = "* `template_id`: Template id"] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - template_id: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - team: team.into(), - template_id: template_id.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::WorkItemTemplateReferenceList> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTemplateReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) workitemtypename: Option<String>, - } - impl RequestBuilder { - #[doc = "Optional, When specified returns templates for given Work item type."] - pub fn workitemtypename(mut self, workitemtypename: impl Into<String>) -> Self { - self.workitemtypename = Some(workitemtypename.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/templates", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(workitemtypename) = &this.workitemtypename { - req.url_mut() - .query_pairs_mut() - .append_pair("workitemtypename", workitemtypename); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTemplateReferenceList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemTemplateReferenceList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTemplate> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTemplate = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemTemplate, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/templates", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTemplate>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTemplate>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTemplate> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTemplate = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) template_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/templates/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.template_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTemplate>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTemplate>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod replace_template { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemTemplate> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemTemplate = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::WorkItemTemplate, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) template_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/templates/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.template_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemTemplate>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTemplate>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) template_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/templates/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.template_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTemplateReferenceList> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTemplateReferenceList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) workitemtypename: Option<String>, + } + impl RequestBuilder { + #[doc = "Optional, When specified returns templates for given Work item type."] + pub fn workitemtypename(mut self, workitemtypename: impl Into<String>) -> Self { + self.workitemtypename = Some(workitemtypename.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/templates", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(workitemtypename) = &this.workitemtypename { + req + .url_mut() + .query_pairs_mut() + .append_pair("workitemtypename", workitemtypename); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTemplateReferenceList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::WorkItemTemplateReferenceList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTemplate> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTemplate = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WorkItemTemplate, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/templates", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTemplate>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTemplate>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTemplate> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTemplate = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) template_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/templates/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.template_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTemplate>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTemplate>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod replace_template { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemTemplate> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemTemplate = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::WorkItemTemplate, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) template_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/templates/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.template_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemTemplate>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemTemplate>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) template_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/templates/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.template_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod wiql { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the results of the query given its WIQL."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: The query containing the WIQL."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn query_by_wiql( + &self, + organization: impl Into<String>, + body: impl Into<models::Wiql>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: The query ID."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn query_by_id( + &self, + organization: impl Into<String>, + id: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `id`: The query ID."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + id: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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, + } + } + } + pub mod query_by_wiql { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the results of the query given its WIQL."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: The query containing the WIQL."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn query_by_wiql( - &self, - organization: impl Into<String>, - body: impl Into<models::Wiql>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: The query ID."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn query_by_id( - &self, - organization: impl Into<String>, - id: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `id`: The query ID."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - id: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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, - } - } - } - pub mod query_by_wiql { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemQueryResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemQueryResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::Wiql, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) time_precision: Option<bool>, - pub(crate) top: Option<i32>, - } - 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); - self - } - #[doc = "The max number of results to return."] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/wiql", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::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?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemQueryResult>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemQueryResult>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod query_by_id { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::WorkItemQueryResult> { - let bytes = self.0.into_body().collect().await?; - let body: models::WorkItemQueryResult = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) id: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) time_precision: Option<bool>, - pub(crate) top: Option<i32>, - } - 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); - self - } - #[doc = "The max number of results to return."] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/wiql/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::WorkItemQueryResult>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::WorkItemQueryResult>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<i32> { - let bytes = self.0.into_body().collect().await?; - let body: i32 = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) id: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) time_precision: Option<bool>, - pub(crate) top: Option<i32>, - } - 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); - self - } - #[doc = "The max number of results to return."] - pub fn top(mut self, top: i32) -> Self { - 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/wiql/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<i32>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<i32>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemQueryResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemQueryResult = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::Wiql, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) time_precision: Option<bool>, + pub(crate) top: Option<i32>, + } + 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); + self + } + #[doc = "The max number of results to return."] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/wiql", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::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?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemQueryResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemQueryResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod query_by_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::WorkItemQueryResult> { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkItemQueryResult = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) id: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) time_precision: Option<bool>, + pub(crate) top: Option<i32>, + } + 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); + self + } + #[doc = "The max number of results to return."] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/wiql/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::WorkItemQueryResult>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::WorkItemQueryResult>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<i32> { + let bytes = self.0.into_body().collect().await?; + let body: i32 = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) id: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) time_precision: Option<bool>, + pub(crate) top: Option<i32>, + } + 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); + self + } + #[doc = "The max number of results to return."] + pub fn top(mut self, top: i32) -> Self { + 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/wiql/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<i32>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<i32>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } diff --git a/azure_devops_rust_api/src/wit/models.rs b/azure_devops_rust_api/src/wit/models.rs index 34ceb6d5..71b73562 100644 --- a/azure_devops_rust_api/src/wit/models.rs +++ b/azure_devops_rust_api/src/wit/models.rs @@ -8,3692 +8,3428 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccountMyWorkResult { - #[doc = "True, when length of WorkItemDetails is same as the limit"] - #[serde( - rename = "querySizeLimitExceeded", - default, - skip_serializing_if = "Option::is_none" - )] - pub query_size_limit_exceeded: Option<bool>, - #[doc = "WorkItem Details"] - #[serde( - rename = "workItemDetails", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_details: Vec<AccountWorkWorkItemModel>, + #[doc = "True, when length of WorkItemDetails is same as the limit"] + #[serde( + rename = "querySizeLimitExceeded", + default, + skip_serializing_if = "Option::is_none" + )] + pub query_size_limit_exceeded: Option<bool>, + #[doc = "WorkItem Details"] + #[serde( + rename = "workItemDetails", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_details: Vec<AccountWorkWorkItemModel>, } impl AccountMyWorkResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents Work Item Recent Activity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccountRecentActivityWorkItemModel { - #[serde(flatten)] - pub account_recent_activity_work_item_model_base: AccountRecentActivityWorkItemModelBase, - #[doc = "Assigned To"] - #[serde( - rename = "assignedTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_to: Option<String>, + #[serde(flatten)] + pub account_recent_activity_work_item_model_base: AccountRecentActivityWorkItemModelBase, + #[doc = "Assigned To"] + #[serde( + rename = "assignedTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_to: Option<String>, } impl AccountRecentActivityWorkItemModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents Work Item Recent Activity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccountRecentActivityWorkItemModel2 { - #[serde(flatten)] - pub account_recent_activity_work_item_model_base: AccountRecentActivityWorkItemModelBase, - #[doc = ""] - #[serde( - rename = "assignedTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_to: Option<IdentityRef>, + #[serde(flatten)] + pub account_recent_activity_work_item_model_base: AccountRecentActivityWorkItemModelBase, + #[doc = ""] + #[serde( + rename = "assignedTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_to: Option<IdentityRef>, } impl AccountRecentActivityWorkItemModel2 { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccountRecentActivityWorkItemModel2List { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<AccountRecentActivityWorkItemModel2>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<AccountRecentActivityWorkItemModel2>, } impl AccountRecentActivityWorkItemModel2List { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents Work Item Recent Activity"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccountRecentActivityWorkItemModelBase { - #[doc = "Date of the last Activity by the user"] - #[serde( - rename = "activityDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub activity_date: Option<time::OffsetDateTime>, - #[doc = "Type of the activity"] - #[serde( - rename = "activityType", - default, - skip_serializing_if = "Option::is_none" - )] - pub activity_type: Option<account_recent_activity_work_item_model_base::ActivityType>, - #[doc = "Last changed date of the work item"] - #[serde( - rename = "changedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub changed_date: Option<time::OffsetDateTime>, - #[doc = "Work Item Id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "TeamFoundationId of the user this activity belongs to"] - #[serde( - rename = "identityId", - default, - skip_serializing_if = "Option::is_none" - )] - pub identity_id: Option<String>, - #[doc = "State of the work item"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "Team project the work item belongs to"] - #[serde( - rename = "teamProject", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project: Option<String>, - #[doc = "Title of the work item"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[doc = "Type of Work Item"] - #[serde( - rename = "workItemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type: Option<String>, + #[doc = "Date of the last Activity by the user"] + #[serde( + rename = "activityDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub activity_date: Option<time::OffsetDateTime>, + #[doc = "Type of the activity"] + #[serde( + rename = "activityType", + default, + skip_serializing_if = "Option::is_none" + )] + pub activity_type: Option<account_recent_activity_work_item_model_base::ActivityType>, + #[doc = "Last changed date of the work item"] + #[serde( + rename = "changedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub changed_date: Option<time::OffsetDateTime>, + #[doc = "Work Item Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "TeamFoundationId of the user this activity belongs to"] + #[serde( + rename = "identityId", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_id: Option<String>, + #[doc = "State of the work item"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "Team project the work item belongs to"] + #[serde( + rename = "teamProject", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project: Option<String>, + #[doc = "Title of the work item"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[doc = "Type of Work Item"] + #[serde( + rename = "workItemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type: Option<String>, } impl AccountRecentActivityWorkItemModelBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod account_recent_activity_work_item_model_base { - use super::*; - #[doc = "Type of the activity"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ActivityType { - #[serde(rename = "visited")] - Visited, - #[serde(rename = "edited")] - Edited, - #[serde(rename = "deleted")] - Deleted, - #[serde(rename = "restored")] - Restored, - } + use super::*; + #[doc = "Type of the activity"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ActivityType { + #[serde(rename = "visited")] + Visited, + #[serde(rename = "edited")] + Edited, + #[serde(rename = "deleted")] + Deleted, + #[serde(rename = "restored")] + Restored, + } } #[doc = "Represents Recent Mention Work Item"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccountRecentMentionWorkItemModel { - #[doc = "Assigned To"] - #[serde( - rename = "assignedTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_to: Option<String>, - #[doc = "Work Item Id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Latest date that the user were mentioned"] - #[serde( - rename = "mentionedDateField", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub mentioned_date_field: Option<time::OffsetDateTime>, - #[doc = "State of the work item"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "Team project the work item belongs to"] - #[serde( - rename = "teamProject", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project: Option<String>, - #[doc = "Title of the work item"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[doc = "Type of Work Item"] - #[serde( - rename = "workItemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type: Option<String>, + #[doc = "Assigned To"] + #[serde( + rename = "assignedTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_to: Option<String>, + #[doc = "Work Item Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Latest date that the user were mentioned"] + #[serde( + rename = "mentionedDateField", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub mentioned_date_field: Option<time::OffsetDateTime>, + #[doc = "State of the work item"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "Team project the work item belongs to"] + #[serde( + rename = "teamProject", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project: Option<String>, + #[doc = "Title of the work item"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[doc = "Type of Work Item"] + #[serde( + rename = "workItemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type: Option<String>, } impl AccountRecentMentionWorkItemModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccountWorkWorkItemModel { - #[serde( - rename = "assignedTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_to: Option<String>, - #[serde( - rename = "changedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub changed_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde( - rename = "teamProject", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_project: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[serde( - rename = "workItemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type: Option<String>, + #[serde( + rename = "assignedTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_to: Option<String>, + #[serde( + rename = "changedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub changed_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde( + rename = "teamProject", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_project: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[serde( + rename = "workItemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type: Option<String>, } impl AccountWorkWorkItemModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contains criteria for querying work items based on artifact URI."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactUriQuery { - #[doc = "List of artifact URIs to use for querying work items."] - #[serde( - rename = "artifactUris", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub artifact_uris: Vec<String>, + #[doc = "List of artifact URIs to use for querying work items."] + #[serde( + rename = "artifactUris", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub artifact_uris: Vec<String>, } impl ArtifactUriQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Defines result of artifact URI query on work items. Contains mapping of work item IDs to artifact URI."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ArtifactUriQueryResult { - #[doc = "A Dictionary that maps a list of work item references to the given list of artifact URI."] - #[serde( - rename = "artifactUrisQueryResult", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_uris_query_result: Option<serde_json::Value>, + #[doc = "A Dictionary that maps a list of work item references to the given list of artifact URI."] + #[serde( + rename = "artifactUrisQueryResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_uris_query_result: Option<serde_json::Value>, } impl ArtifactUriQueryResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AttachmentReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl AttachmentReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Comment on a Work Item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Comment { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "The creation date of the comment."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Effective Date/time value for adding the comment. Can be optionally different from CreatedDate."] - #[serde( - rename = "createdOnBehalfDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on_behalf_date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "createdOnBehalfOf", - default, - skip_serializing_if = "Option::is_none" - )] - pub created_on_behalf_of: Option<IdentityRef>, - #[doc = "Represents the possible types for the comment format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option<comment::Format>, - #[doc = "The id assigned to the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Indicates if the comment has been deleted."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "The mentions of the comment."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mentions: Vec<CommentMention>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "The last modification date of the comment."] - #[serde( - rename = "modifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_date: Option<time::OffsetDateTime>, - #[doc = "The reactions of the comment."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub reactions: Vec<CommentReaction>, - #[doc = "The text of the comment in HTML format."] - #[serde( - rename = "renderedText", - default, - skip_serializing_if = "Option::is_none" - )] - pub rendered_text: Option<String>, - #[doc = "The text of the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, - #[doc = "The current version of the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i32>, - #[doc = "The id of the work item this comment belongs to."] - #[serde( - rename = "workItemId", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_id: Option<i32>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "The creation date of the comment."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Effective Date/time value for adding the comment. Can be optionally different from CreatedDate."] + #[serde( + rename = "createdOnBehalfDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on_behalf_date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "createdOnBehalfOf", + default, + skip_serializing_if = "Option::is_none" + )] + pub created_on_behalf_of: Option<IdentityRef>, + #[doc = "The id assigned to the comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Indicates if the comment has been deleted."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "The mentions of the comment."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mentions: Vec<CommentMention>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "The last modification date of the comment."] + #[serde( + rename = "modifiedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_date: Option<time::OffsetDateTime>, + #[doc = "The reactions of the comment."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub reactions: Vec<CommentReaction>, + #[doc = "The text of the comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, + #[doc = "The current version of the comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i32>, + #[doc = "The id of the work item this comment belongs to."] + #[serde( + rename = "workItemId", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_id: Option<i32>, } impl Comment { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - created_by: None, - created_date: None, - created_on_behalf_date: None, - created_on_behalf_of: None, - format: None, - id: None, - is_deleted: None, - mentions: Vec::new(), - modified_by: None, - modified_date: None, - reactions: Vec::new(), - rendered_text: None, - text: None, - version: None, - work_item_id: None, - } - } -} -pub mod comment { - use super::*; - #[doc = "Represents the possible types for the comment format."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Format { - #[serde(rename = "markdown")] - Markdown, - #[serde(rename = "html")] - Html, - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + created_by: None, + created_date: None, + created_on_behalf_date: None, + created_on_behalf_of: None, + id: None, + is_deleted: None, + mentions: Vec::new(), + modified_by: None, + modified_date: None, + reactions: Vec::new(), + text: None, + version: None, + work_item_id: None, + } + } } #[doc = "Represents a request to create a work item comment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentCreate { - #[doc = "The text of the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, + #[doc = "The text of the comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, } impl CommentCreate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a list of work item comments."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CommentList { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "List of comments in the current batch."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub comments: Vec<Comment>, - #[doc = "A string token that can be used to retrieving next page of comments if available. Otherwise null."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[doc = "The count of comments in the current batch."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Uri to the next page of comments if it is available. Otherwise null."] - #[serde(rename = "nextPage", default, skip_serializing_if = "Option::is_none")] - pub next_page: Option<String>, - #[doc = "Total count of comments on a work item."] - #[serde( - rename = "totalCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_count: Option<i32>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "List of comments in the current batch."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub comments: Vec<Comment>, + #[doc = "A string token that can be used to retrieving next page of comments if available. Otherwise null."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[doc = "The count of comments in the current batch."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Uri to the next page of comments if it is available. Otherwise null."] + #[serde(rename = "nextPage", default, skip_serializing_if = "Option::is_none")] + pub next_page: Option<String>, + #[doc = "Total count of comments on a work item."] + #[serde( + rename = "totalCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_count: Option<i32>, } impl CommentList { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - comments: Vec::new(), - continuation_token: None, - count: None, - next_page: None, - total_count: None, - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + comments: Vec::new(), + continuation_token: None, + count: None, + next_page: None, + total_count: None, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CommentMention { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "The artifact portion of the parsed text. (i.e. the work item's id)"] - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<String>, - #[doc = "The type the parser assigned to the mention. (i.e. person, work item, etc)"] - #[serde( - rename = "artifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type: Option<String>, - #[doc = "The comment id of the mention."] - #[serde(rename = "commentId", default, skip_serializing_if = "Option::is_none")] - pub comment_id: Option<i32>, - #[doc = "The resolved target of the mention. An example of this could be a user's tfid"] - #[serde(rename = "targetId", default, skip_serializing_if = "Option::is_none")] - pub target_id: Option<String>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "The artifact portion of the parsed text. (i.e. the work item's id)"] + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<String>, + #[doc = "The type the parser assigned to the mention. (i.e. person, work item, etc)"] + #[serde( + rename = "artifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type: Option<String>, + #[doc = "The comment id of the mention."] + #[serde(rename = "commentId", default, skip_serializing_if = "Option::is_none")] + pub comment_id: Option<i32>, + #[doc = "The resolved target of the mention. An example of this could be a user's tfid"] + #[serde(rename = "targetId", default, skip_serializing_if = "Option::is_none")] + pub target_id: Option<String>, } impl CommentMention { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - artifact_id: None, - artifact_type: None, - comment_id: None, - target_id: None, - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + artifact_id: None, + artifact_type: None, + comment_id: None, + target_id: None, } + } } #[doc = "Contains information about work item comment reaction for a particular reaction type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CommentReaction { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "The id of the comment this reaction belongs to."] - #[serde(rename = "commentId", default, skip_serializing_if = "Option::is_none")] - pub comment_id: Option<i32>, - #[doc = "Total number of reactions for the CommentReactionType."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Flag to indicate if the current user has engaged on this particular EngagementType (e.g. if they liked the associated comment)."] - #[serde( - rename = "isCurrentUserEngaged", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_current_user_engaged: Option<bool>, - #[doc = "Type of the reaction."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<comment_reaction::Type>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "The id of the comment this reaction belongs to."] + #[serde(rename = "commentId", default, skip_serializing_if = "Option::is_none")] + pub comment_id: Option<i32>, + #[doc = "Total number of reactions for the CommentReactionType."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Flag to indicate if the current user has engaged on this particular EngagementType (e.g. if they liked the associated comment)."] + #[serde( + rename = "isCurrentUserEngaged", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_current_user_engaged: Option<bool>, + #[doc = "Type of the reaction."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<comment_reaction::Type>, } impl CommentReaction { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - comment_id: None, - count: None, - is_current_user_engaged: None, - type_: None, - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + comment_id: None, + count: None, + is_current_user_engaged: None, + type_: None, } + } } pub mod comment_reaction { - use super::*; - #[doc = "Type of the reaction."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "like")] - Like, - #[serde(rename = "dislike")] - Dislike, - #[serde(rename = "heart")] - Heart, - #[serde(rename = "hooray")] - Hooray, - #[serde(rename = "smile")] - Smile, - #[serde(rename = "confused")] - Confused, - } + use super::*; + #[doc = "Type of the reaction."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "like")] + Like, + #[serde(rename = "dislike")] + Dislike, + #[serde(rename = "heart")] + Heart, + #[serde(rename = "hooray")] + Hooray, + #[serde(rename = "smile")] + Smile, + #[serde(rename = "confused")] + Confused, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentReactionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<CommentReaction>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<CommentReaction>, } impl CommentReactionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a request to update a work item comment."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentUpdate { - #[doc = "The updated text of the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, + #[doc = "The updated text of the comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, } impl CommentUpdate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a specific version of a comment on a work item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CommentVersion { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "The creation date of the comment."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Effective Date/time value for adding the comment. Can be optionally different from CreatedDate."] - #[serde( - rename = "createdOnBehalfDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_on_behalf_date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "createdOnBehalfOf", - default, - skip_serializing_if = "Option::is_none" - )] - pub created_on_behalf_of: Option<IdentityRef>, - #[doc = "The id assigned to the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Indicates if the comment has been deleted at this version."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = ""] - #[serde( - rename = "modifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by: Option<IdentityRef>, - #[doc = "The modification date of the comment for this version."] - #[serde( - rename = "modifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_date: Option<time::OffsetDateTime>, - #[doc = "The rendered content of the comment at this version."] - #[serde( - rename = "renderedText", - default, - skip_serializing_if = "Option::is_none" - )] - pub rendered_text: Option<String>, - #[doc = "The text of the comment at this version."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, - #[doc = "The version number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i32>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityRef>, + #[doc = "The creation date of the comment."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Effective Date/time value for adding the comment. Can be optionally different from CreatedDate."] + #[serde( + rename = "createdOnBehalfDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_on_behalf_date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "createdOnBehalfOf", + default, + skip_serializing_if = "Option::is_none" + )] + pub created_on_behalf_of: Option<IdentityRef>, + #[doc = "The id assigned to the comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Indicates if the comment has been deleted at this version."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = ""] + #[serde( + rename = "modifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by: Option<IdentityRef>, + #[doc = "The modification date of the comment for this version."] + #[serde( + rename = "modifiedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_date: Option<time::OffsetDateTime>, + #[doc = "The rendered content of the comment at this version."] + #[serde( + rename = "renderedText", + default, + skip_serializing_if = "Option::is_none" + )] + pub rendered_text: Option<String>, + #[doc = "The text of the comment at this version."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, + #[doc = "The version number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i32>, } impl CommentVersion { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - created_by: None, - created_date: None, - created_on_behalf_date: None, - created_on_behalf_of: None, - id: None, - is_deleted: None, - modified_by: None, - modified_date: None, - rendered_text: None, - text: None, - version: None, - } - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + created_by: None, + created_date: None, + created_on_behalf_date: None, + created_on_behalf_of: None, + id: None, + is_deleted: None, + modified_by: None, + modified_date: None, + rendered_text: None, + text: None, + version: None, + } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CommentVersionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<CommentVersion>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<CommentVersion>, } impl CommentVersionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EmailRecipients { - #[doc = "Plaintext email addresses."] - #[serde( - rename = "emailAddresses", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub email_addresses: Vec<String>, - #[doc = "TfIds"] - #[serde( - rename = "tfIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tf_ids: Vec<String>, - #[doc = "Unresolved entity ids"] - #[serde( - rename = "unresolvedEntityIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub unresolved_entity_ids: Vec<String>, + #[doc = "Plaintext email addresses."] + #[serde( + rename = "emailAddresses", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub email_addresses: Vec<String>, + #[doc = "TfIds"] + #[serde( + rename = "tfIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tf_ids: Vec<String>, + #[doc = "Unresolved entity ids"] + #[serde( + rename = "unresolvedEntityIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub unresolved_entity_ids: Vec<String>, } impl EmailRecipients { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalDeployment { - #[serde( - rename = "artifactId", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_id: Option<String>, - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option<ExternalEnvironment>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub group: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pipeline: Option<ExternalPipeline>, - #[serde( - rename = "relatedWorkItemIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub related_work_item_ids: Vec<i32>, - #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] - pub run_id: Option<i32>, - #[serde( - rename = "sequenceNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub sequence_number: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<String>, - #[serde( - rename = "statusDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub status_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde( + rename = "artifactId", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_id: Option<String>, + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option<ExternalEnvironment>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pipeline: Option<ExternalPipeline>, + #[serde( + rename = "relatedWorkItemIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub related_work_item_ids: Vec<i32>, + #[serde(rename = "runId", default, skip_serializing_if = "Option::is_none")] + pub run_id: Option<i32>, + #[serde( + rename = "sequenceNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub sequence_number: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<String>, + #[serde( + rename = "statusDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub status_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ExternalDeployment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalEnvironment { - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, } impl ExternalEnvironment { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ExternalPipeline { - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ExternalPipeline { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a list of dependent fields for a rule."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FieldDependentRule { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "The dependent fields."] - #[serde( - rename = "dependentFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dependent_fields: Vec<WorkItemFieldReference>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "The dependent fields."] + #[serde( + rename = "dependentFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dependent_fields: Vec<WorkItemFieldReference>, } impl FieldDependentRule { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - dependent_fields: Vec::new(), - } - } -} -#[doc = "Describes an update request for a work item field."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FieldUpdate { - #[doc = "Indicates whether the user wants to restore the field."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "Indicates whether the user wants to lock the field."] - #[serde(rename = "isLocked", default, skip_serializing_if = "Option::is_none")] - pub is_locked: Option<bool>, -} -impl FieldUpdate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes Github connection."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GitHubConnectionModel { - #[doc = "Github connection authorization type (f. e. PAT, OAuth)"] - #[serde( - rename = "authorizationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub authorization_type: Option<String>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityRef>, - #[doc = "Github connection id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Whether current Github connection is valid or not"] - #[serde( - rename = "isConnectionValid", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_connection_valid: Option<bool>, - #[doc = "Github connection name (should contain organization/user name)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, -} -impl GitHubConnectionModel { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes Github connection's repo."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GitHubConnectionRepoModel { - #[doc = "Error message"] - #[serde( - rename = "errorMessage", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_message: Option<String>, - #[doc = "Repository web url"] - #[serde( - rename = "gitHubRepositoryUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub git_hub_repository_url: Option<String>, -} -impl GitHubConnectionRepoModel { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes Github connection's repo bulk request"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GitHubConnectionReposBatchRequest { - #[doc = "Requested repos urls"] - #[serde( - rename = "gitHubRepositoryUrls", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub git_hub_repository_urls: Vec<GitHubConnectionRepoModel>, - #[doc = "Operation type (f. e. add, remove)"] - #[serde( - rename = "operationType", - default, - skip_serializing_if = "Option::is_none" - )] - pub operation_type: Option<String>, -} -impl GitHubConnectionReposBatchRequest { - pub fn new() -> Self { - Self::default() + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + dependent_fields: Vec::new(), } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, + } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityRefList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<IdentityRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<IdentityRef>, } impl IdentityRefList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityReference { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde( - rename = "uniqueName", - default, - skip_serializing_if = "Option::is_none" - )] - pub unique_name: Option<String>, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde( + rename = "uniqueName", + default, + skip_serializing_if = "Option::is_none" + )] + pub unique_name: Option<String>, } impl IdentityReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for JSON Patch Operations"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchDocument {} impl JsonPatchDocument { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The JSON model for a JSON Patch operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JsonPatchOperation { - #[doc = "The path to copy from for the Move/Copy operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub from: Option<String>, - #[doc = "The patch operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub op: Option<json_patch_operation::Op>, - #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "The value for the operation. This is either a primitive or a JToken."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<serde_json::Value>, + #[doc = "The path to copy from for the Move/Copy operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub from: Option<String>, + #[doc = "The patch operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub op: Option<json_patch_operation::Op>, + #[doc = "The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The \"-\" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "The value for the operation. This is either a primitive or a JToken."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<serde_json::Value>, } impl JsonPatchOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod json_patch_operation { - use super::*; - #[doc = "The patch operation"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Op { - #[serde(rename = "add")] - Add, - #[serde(rename = "remove")] - Remove, - #[serde(rename = "replace")] - Replace, - #[serde(rename = "move")] - Move, - #[serde(rename = "copy")] - Copy, - #[serde(rename = "test")] - Test, - } + use super::*; + #[doc = "The patch operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Op { + #[serde(rename = "add")] + Add, + #[serde(rename = "remove")] + Remove, + #[serde(rename = "replace")] + Replace, + #[serde(rename = "move")] + Move, + #[serde(rename = "copy")] + Copy, + #[serde(rename = "test")] + Test, + } } #[doc = "Link description."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Link { - #[doc = "Collection of link attributes."] - pub attributes: serde_json::Value, - #[doc = "Relation type."] - pub rel: String, - #[doc = "Link url."] - pub url: String, + #[doc = "Collection of link attributes."] + pub attributes: serde_json::Value, + #[doc = "Relation type."] + pub rel: String, + #[doc = "Link url."] + pub url: String, } impl Link { - pub fn new(attributes: serde_json::Value, rel: String, url: String) -> Self { - Self { - attributes, - rel, - url, - } + pub fn new(attributes: serde_json::Value, rel: String, url: String) -> Self { + Self { + attributes, + rel, + url, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MailMessage { - #[doc = "The mail body in HTML format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub body: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cc: Option<EmailRecipients>, - #[doc = "The in-reply-to header value"] - #[serde(rename = "inReplyTo", default, skip_serializing_if = "Option::is_none")] - pub in_reply_to: Option<String>, - #[doc = "The Message Id value"] - #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")] - pub message_id: Option<String>, - #[doc = ""] - #[serde(rename = "replyTo", default, skip_serializing_if = "Option::is_none")] - pub reply_to: Option<EmailRecipients>, - #[doc = "The mail subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subject: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub to: Option<EmailRecipients>, + #[doc = "The mail body in HTML format."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub body: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cc: Option<EmailRecipients>, + #[doc = "The in-reply-to header value"] + #[serde(rename = "inReplyTo", default, skip_serializing_if = "Option::is_none")] + pub in_reply_to: Option<String>, + #[doc = "The Message Id value"] + #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")] + pub message_id: Option<String>, + #[doc = ""] + #[serde(rename = "replyTo", default, skip_serializing_if = "Option::is_none")] + pub reply_to: Option<EmailRecipients>, + #[doc = "The mail subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subject: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub to: Option<EmailRecipients>, } impl MailMessage { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Stores process ID."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessIdModel { - #[doc = "The ID of the process."] - #[serde(rename = "typeId", default, skip_serializing_if = "Option::is_none")] - pub type_id: Option<String>, + #[doc = "The ID of the process."] + #[serde(rename = "typeId", default, skip_serializing_if = "Option::is_none")] + pub type_id: Option<String>, } impl ProcessIdModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Stores project ID and its process ID."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessMigrationResultModel { - #[doc = "The ID of the process."] - #[serde(rename = "processId", default, skip_serializing_if = "Option::is_none")] - pub process_id: Option<String>, - #[doc = "The ID of the project."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, + #[doc = "The ID of the process."] + #[serde(rename = "processId", default, skip_serializing_if = "Option::is_none")] + pub process_id: Option<String>, + #[doc = "The ID of the project."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, } impl ProcessMigrationResultModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Project work item type state colors"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProjectWorkItemStateColors { - #[doc = "Project name"] - #[serde( - rename = "projectName", - default, - skip_serializing_if = "Option::is_none" - )] - pub project_name: Option<String>, - #[doc = "State colors for all work item type in a project"] - #[serde( - rename = "workItemTypeStateColors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_type_state_colors: Vec<WorkItemTypeStateColors>, + #[doc = "Project name"] + #[serde( + rename = "projectName", + default, + skip_serializing_if = "Option::is_none" + )] + pub project_name: Option<String>, + #[doc = "State colors for all work item type in a project"] + #[serde( + rename = "workItemTypeStateColors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_type_state_colors: Vec<WorkItemTypeStateColors>, } impl ProjectWorkItemStateColors { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Result of an update work item type XML update operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProvisioningResult { - #[doc = "Details about of the provisioning import events."] - #[serde( - rename = "provisioningImportEvents", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub provisioning_import_events: Vec<String>, + #[doc = "Details about of the provisioning import events."] + #[serde( + rename = "provisioningImportEvents", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub provisioning_import_events: Vec<String>, } impl ProvisioningResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a request to get a list of queries"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryBatchGetRequest { - #[doc = "The expand parameters for queries. Possible options are { None, Wiql, Clauses, All, Minimal }"] - #[serde(rename = "$expand", default, skip_serializing_if = "Option::is_none")] - pub expand: Option<query_batch_get_request::Expand>, - #[doc = "The flag to control error policy in a query batch request. Possible options are { Fail, Omit }."] - #[serde( - rename = "errorPolicy", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_policy: Option<query_batch_get_request::ErrorPolicy>, - #[doc = "The requested query ids"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ids: Vec<String>, + #[doc = "The expand parameters for queries. Possible options are { None, Wiql, Clauses, All, Minimal }"] + #[serde(rename = "$expand", default, skip_serializing_if = "Option::is_none")] + pub expand: Option<query_batch_get_request::Expand>, + #[doc = "The flag to control error policy in a query batch request. Possible options are { Fail, Omit }."] + #[serde( + rename = "errorPolicy", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_policy: Option<query_batch_get_request::ErrorPolicy>, + #[doc = "The requested query ids"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ids: Vec<String>, } impl QueryBatchGetRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod query_batch_get_request { - use super::*; - #[doc = "The expand parameters for queries. Possible options are { None, Wiql, Clauses, All, Minimal }"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Expand { - #[serde(rename = "none")] - None, - #[serde(rename = "wiql")] - Wiql, - #[serde(rename = "clauses")] - Clauses, - #[serde(rename = "all")] - All, - #[serde(rename = "minimal")] - Minimal, - } - #[doc = "The flag to control error policy in a query batch request. Possible options are { Fail, Omit }."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ErrorPolicy { - #[serde(rename = "fail")] - Fail, - #[serde(rename = "omit")] - Omit, - } + use super::*; + #[doc = "The expand parameters for queries. Possible options are { None, Wiql, Clauses, All, Minimal }"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Expand { + #[serde(rename = "none")] + None, + #[serde(rename = "wiql")] + Wiql, + #[serde(rename = "clauses")] + Clauses, + #[serde(rename = "all")] + All, + #[serde(rename = "minimal")] + Minimal, + } + #[doc = "The flag to control error policy in a query batch request. Possible options are { Fail, Omit }."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ErrorPolicy { + #[serde(rename = "fail")] + Fail, + #[serde(rename = "omit")] + Omit, + } } #[doc = "Represents an item in the work item query hierarchy. This can be either a query or a folder."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct QueryHierarchyItem { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "The child query items inside a query folder."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub children: Vec<QueryHierarchyItem>, - #[doc = "Represents a clause in a work item query. This shows the structure of a work item query."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub clauses: Option<WorkItemQueryClause>, - #[doc = "The columns of the query."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub columns: Vec<WorkItemFieldReference>, - #[doc = ""] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option<IdentityReference>, - #[doc = "When the query item was created."] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "The link query mode."] - #[serde( - rename = "filterOptions", - default, - skip_serializing_if = "Option::is_none" - )] - pub filter_options: Option<query_hierarchy_item::FilterOptions>, - #[doc = "If this is a query folder, indicates if it contains any children."] - #[serde( - rename = "hasChildren", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_children: Option<bool>, - #[doc = "The id of the query item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Indicates if this query item is deleted. Setting this to false on a deleted query item will undelete it. Undeleting a query or folder will not bring back the permission changes that were previously applied to it."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "Indicates if this is a query folder or a query."] - #[serde(rename = "isFolder", default, skip_serializing_if = "Option::is_none")] - pub is_folder: Option<bool>, - #[doc = "Indicates if the WIQL of this query is invalid. This could be due to invalid syntax or a no longer valid area/iteration path."] - #[serde( - rename = "isInvalidSyntax", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_invalid_syntax: Option<bool>, - #[doc = "Indicates if this query item is public or private."] - #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] - pub is_public: Option<bool>, - #[doc = ""] - #[serde( - rename = "lastExecutedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_executed_by: Option<IdentityReference>, - #[doc = "When the query was last run."] - #[serde( - rename = "lastExecutedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_executed_date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "lastModifiedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub last_modified_by: Option<IdentityReference>, - #[doc = "When the query item was last modified."] - #[serde( - rename = "lastModifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_modified_date: Option<time::OffsetDateTime>, - #[doc = "Represents a clause in a work item query. This shows the structure of a work item query."] - #[serde( - rename = "linkClauses", - default, - skip_serializing_if = "Option::is_none" - )] - pub link_clauses: Option<WorkItemQueryClause>, - #[doc = "The name of the query item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The path of the query item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "The recursion option for use in a tree query."] - #[serde( - rename = "queryRecursionOption", - default, - skip_serializing_if = "Option::is_none" - )] - pub query_recursion_option: Option<query_hierarchy_item::QueryRecursionOption>, - #[doc = "The type of query."] - #[serde(rename = "queryType", default, skip_serializing_if = "Option::is_none")] - pub query_type: Option<query_hierarchy_item::QueryType>, - #[doc = "The sort columns of the query."] - #[serde( - rename = "sortColumns", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub sort_columns: Vec<WorkItemQuerySortColumn>, - #[doc = "Represents a clause in a work item query. This shows the structure of a work item query."] - #[serde( - rename = "sourceClauses", - default, - skip_serializing_if = "Option::is_none" - )] - pub source_clauses: Option<WorkItemQueryClause>, - #[doc = "Represents a clause in a work item query. This shows the structure of a work item query."] - #[serde( - rename = "targetClauses", - default, - skip_serializing_if = "Option::is_none" - )] - pub target_clauses: Option<WorkItemQueryClause>, - #[doc = "The WIQL text of the query"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub wiql: Option<String>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "The child query items inside a query folder."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub children: Vec<QueryHierarchyItem>, + #[doc = "Represents a clause in a work item query. This shows the structure of a work item query."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub clauses: Option<WorkItemQueryClause>, + #[doc = "The columns of the query."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub columns: Vec<WorkItemFieldReference>, + #[doc = ""] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option<IdentityReference>, + #[doc = "When the query item was created."] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "The link query mode."] + #[serde( + rename = "filterOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub filter_options: Option<query_hierarchy_item::FilterOptions>, + #[doc = "If this is a query folder, indicates if it contains any children."] + #[serde( + rename = "hasChildren", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_children: Option<bool>, + #[doc = "The id of the query item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Indicates if this query item is deleted. Setting this to false on a deleted query item will undelete it. Undeleting a query or folder will not bring back the permission changes that were previously applied to it."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "Indicates if this is a query folder or a query."] + #[serde(rename = "isFolder", default, skip_serializing_if = "Option::is_none")] + pub is_folder: Option<bool>, + #[doc = "Indicates if the WIQL of this query is invalid. This could be due to invalid syntax or a no longer valid area/iteration path."] + #[serde( + rename = "isInvalidSyntax", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_invalid_syntax: Option<bool>, + #[doc = "Indicates if this query item is public or private."] + #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")] + pub is_public: Option<bool>, + #[doc = ""] + #[serde( + rename = "lastExecutedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_executed_by: Option<IdentityReference>, + #[doc = "When the query was last run."] + #[serde( + rename = "lastExecutedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_executed_date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde( + rename = "lastModifiedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub last_modified_by: Option<IdentityReference>, + #[doc = "When the query item was last modified."] + #[serde( + rename = "lastModifiedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub last_modified_date: Option<time::OffsetDateTime>, + #[doc = "Represents a clause in a work item query. This shows the structure of a work item query."] + #[serde( + rename = "linkClauses", + default, + skip_serializing_if = "Option::is_none" + )] + pub link_clauses: Option<WorkItemQueryClause>, + #[doc = "The name of the query item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The path of the query item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "The recursion option for use in a tree query."] + #[serde( + rename = "queryRecursionOption", + default, + skip_serializing_if = "Option::is_none" + )] + pub query_recursion_option: Option<query_hierarchy_item::QueryRecursionOption>, + #[doc = "The type of query."] + #[serde(rename = "queryType", default, skip_serializing_if = "Option::is_none")] + pub query_type: Option<query_hierarchy_item::QueryType>, + #[doc = "The sort columns of the query."] + #[serde( + rename = "sortColumns", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub sort_columns: Vec<WorkItemQuerySortColumn>, + #[doc = "Represents a clause in a work item query. This shows the structure of a work item query."] + #[serde( + rename = "sourceClauses", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_clauses: Option<WorkItemQueryClause>, + #[doc = "Represents a clause in a work item query. This shows the structure of a work item query."] + #[serde( + rename = "targetClauses", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_clauses: Option<WorkItemQueryClause>, + #[doc = "The WIQL text of the query"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wiql: Option<String>, } impl QueryHierarchyItem { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - children: Vec::new(), - clauses: None, - columns: Vec::new(), - created_by: None, - created_date: None, - filter_options: None, - has_children: None, - id: None, - is_deleted: None, - is_folder: None, - is_invalid_syntax: None, - is_public: None, - last_executed_by: None, - last_executed_date: None, - last_modified_by: None, - last_modified_date: None, - link_clauses: None, - name: None, - path: None, - query_recursion_option: None, - query_type: None, - sort_columns: Vec::new(), - source_clauses: None, - target_clauses: None, - wiql: None, - } - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + children: Vec::new(), + clauses: None, + columns: Vec::new(), + created_by: None, + created_date: None, + filter_options: None, + has_children: None, + id: None, + is_deleted: None, + is_folder: None, + is_invalid_syntax: None, + is_public: None, + last_executed_by: None, + last_executed_date: None, + last_modified_by: None, + last_modified_date: None, + link_clauses: None, + name: None, + path: None, + query_recursion_option: None, + query_type: None, + sort_columns: Vec::new(), + source_clauses: None, + target_clauses: None, + wiql: None, + } + } } pub mod query_hierarchy_item { - use super::*; - #[doc = "The link query mode."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum FilterOptions { - #[serde(rename = "workItems")] - WorkItems, - #[serde(rename = "linksOneHopMustContain")] - LinksOneHopMustContain, - #[serde(rename = "linksOneHopMayContain")] - LinksOneHopMayContain, - #[serde(rename = "linksOneHopDoesNotContain")] - LinksOneHopDoesNotContain, - #[serde(rename = "linksRecursiveMustContain")] - LinksRecursiveMustContain, - #[serde(rename = "linksRecursiveMayContain")] - LinksRecursiveMayContain, - #[serde(rename = "linksRecursiveDoesNotContain")] - LinksRecursiveDoesNotContain, - } - #[doc = "The recursion option for use in a tree query."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum QueryRecursionOption { - #[serde(rename = "parentFirst")] - ParentFirst, - #[serde(rename = "childFirst")] - ChildFirst, - } - #[doc = "The type of query."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum QueryType { - #[serde(rename = "flat")] - Flat, - #[serde(rename = "tree")] - Tree, - #[serde(rename = "oneHop")] - OneHop, - } + use super::*; + #[doc = "The link query mode."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum FilterOptions { + #[serde(rename = "workItems")] + WorkItems, + #[serde(rename = "linksOneHopMustContain")] + LinksOneHopMustContain, + #[serde(rename = "linksOneHopMayContain")] + LinksOneHopMayContain, + #[serde(rename = "linksOneHopDoesNotContain")] + LinksOneHopDoesNotContain, + #[serde(rename = "linksRecursiveMustContain")] + LinksRecursiveMustContain, + #[serde(rename = "linksRecursiveMayContain")] + LinksRecursiveMayContain, + #[serde(rename = "linksRecursiveDoesNotContain")] + LinksRecursiveDoesNotContain, + } + #[doc = "The recursion option for use in a tree query."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum QueryRecursionOption { + #[serde(rename = "parentFirst")] + ParentFirst, + #[serde(rename = "childFirst")] + ChildFirst, + } + #[doc = "The type of query."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum QueryType { + #[serde(rename = "flat")] + Flat, + #[serde(rename = "tree")] + Tree, + #[serde(rename = "oneHop")] + OneHop, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryHierarchyItemList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<QueryHierarchyItem>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<QueryHierarchyItem>, } impl QueryHierarchyItemList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QueryHierarchyItemsResult { - #[doc = "The count of items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Indicates if the max return limit was hit but there are still more items"] - #[serde(rename = "hasMore", default, skip_serializing_if = "Option::is_none")] - pub has_more: Option<bool>, - #[doc = "The list of items"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<QueryHierarchyItem>, + #[doc = "The count of items."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Indicates if the max return limit was hit but there are still more items"] + #[serde(rename = "hasMore", default, skip_serializing_if = "Option::is_none")] + pub has_more: Option<bool>, + #[doc = "The list of items"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<QueryHierarchyItem>, } impl QueryHierarchyItemsResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReportingWorkItemLinksBatch { - #[serde(flatten)] - pub streamed_batch: StreamedBatch, + #[serde(flatten)] + pub streamed_batch: StreamedBatch, } impl ReportingWorkItemLinksBatch { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReportingWorkItemRevisionsBatch { - #[serde(flatten)] - pub streamed_batch: StreamedBatch, + #[serde(flatten)] + pub streamed_batch: StreamedBatch, } impl ReportingWorkItemRevisionsBatch { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class represents the reporting work item revision filer."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReportingWorkItemRevisionsFilter { - #[doc = "A list of fields to return in work item revisions. Omit this parameter to get all reportable fields."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub fields: Vec<String>, - #[doc = "Include deleted work item in the result."] - #[serde( - rename = "includeDeleted", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_deleted: Option<bool>, - #[doc = "Return an identity reference instead of a string value for identity fields."] - #[serde( - rename = "includeIdentityRef", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_identity_ref: Option<bool>, - #[doc = "Include only the latest version of a work item, skipping over all previous revisions of the work item."] - #[serde( - rename = "includeLatestOnly", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_latest_only: Option<bool>, - #[doc = "Include tag reference instead of string value for System.Tags field"] - #[serde( - rename = "includeTagRef", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_tag_ref: Option<bool>, - #[doc = "A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub types: Vec<String>, + #[doc = "A list of fields to return in work item revisions. Omit this parameter to get all reportable fields."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub fields: Vec<String>, + #[doc = "Include deleted work item in the result."] + #[serde( + rename = "includeDeleted", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_deleted: Option<bool>, + #[doc = "Return an identity reference instead of a string value for identity fields."] + #[serde( + rename = "includeIdentityRef", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_identity_ref: Option<bool>, + #[doc = "Include only the latest version of a work item, skipping over all previous revisions of the work item."] + #[serde( + rename = "includeLatestOnly", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_latest_only: Option<bool>, + #[doc = "Include tag reference instead of string value for System.Tags field"] + #[serde( + rename = "includeTagRef", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_tag_ref: Option<bool>, + #[doc = "A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub types: Vec<String>, } impl ReportingWorkItemRevisionsFilter { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SendMailBody { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub fields: Vec<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ids: Vec<i32>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<MailMessage>, - #[serde( - rename = "persistenceId", - default, - skip_serializing_if = "Option::is_none" - )] - pub persistence_id: Option<String>, - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[serde( - rename = "sortFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub sort_fields: Vec<String>, - #[serde( - rename = "tempQueryId", - default, - skip_serializing_if = "Option::is_none" - )] - pub temp_query_id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub wiql: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub fields: Vec<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ids: Vec<i32>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<MailMessage>, + #[serde( + rename = "persistenceId", + default, + skip_serializing_if = "Option::is_none" + )] + pub persistence_id: Option<String>, + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[serde( + rename = "sortFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub sort_fields: Vec<String>, + #[serde( + rename = "tempQueryId", + default, + skip_serializing_if = "Option::is_none" + )] + pub temp_query_id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wiql: Option<String>, } impl SendMailBody { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class describes reporting work item revision batch."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct StreamedBatch { - #[doc = "ContinuationToken acts as a waterMark. Used while querying large results."] - #[serde( - rename = "continuationToken", - default, - skip_serializing_if = "Option::is_none" - )] - pub continuation_token: Option<String>, - #[doc = "Returns 'true' if it's last batch, 'false' otherwise."] - #[serde( - rename = "isLastBatch", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_last_batch: Option<bool>, - #[doc = "The next link for the work item."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option<String>, - #[doc = "Values such as rel, sourceId, TargetId, ChangedDate, isActive."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<String>, + #[doc = "ContinuationToken acts as a waterMark. Used while querying large results."] + #[serde( + rename = "continuationToken", + default, + skip_serializing_if = "Option::is_none" + )] + pub continuation_token: Option<String>, + #[doc = "Returns 'true' if it's last batch, 'false' otherwise."] + #[serde( + rename = "isLastBatch", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_last_batch: Option<bool>, + #[doc = "The next link for the work item."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option<String>, + #[doc = "Values such as rel, sourceId, TargetId, ChangedDate, isActive."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<String>, } impl StreamedBatch { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The Team Context for an operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamContext { - #[doc = "The team project Id or name. Ignored if ProjectId is set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<String>, - #[doc = "The Team Project ID. Required if Project is not set."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "The Team Id or name. Ignored if TeamId is set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub team: Option<String>, - #[doc = "The Team Id"] - #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] - pub team_id: Option<String>, + #[doc = "The team project Id or name. Ignored if ProjectId is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<String>, + #[doc = "The Team Project ID. Required if Project is not set."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "The Team Id or name. Ignored if TeamId is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub team: Option<String>, + #[doc = "The Team Id"] + #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] + pub team_id: Option<String>, } impl TeamContext { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes a request to create a temporary query"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TemporaryQueryRequestModel { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "The WIQL text of the temporary query"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub wiql: Option<String>, -} -impl TemporaryQueryRequestModel { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - wiql: None, - } - } -} -#[doc = "The result of a temporary query creation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TemporaryQueryResponseModel { - #[doc = "The id of the temporary query item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, -} -impl TemporaryQueryResponseModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes an update request for a work item field."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateWorkItemField { - #[doc = "Indicates whether the user wants to restore the field."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, + #[doc = "Indicates whether the user wants to restore the field."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, } impl UpdateWorkItemField { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A WIQL query"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Wiql { - #[doc = "The text of the WIQL query"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option<String>, + #[doc = "The text of the WIQL query"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option<String>, } impl Wiql { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A work artifact link describes an outbound artifact link type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkArtifactLink { - #[doc = "Target artifact type."] - #[serde( - rename = "artifactType", - default, - skip_serializing_if = "Option::is_none" - )] - pub artifact_type: Option<String>, - #[doc = "Outbound link type."] - #[serde(rename = "linkType", default, skip_serializing_if = "Option::is_none")] - pub link_type: Option<String>, - #[doc = "Target tool type."] - #[serde(rename = "toolType", default, skip_serializing_if = "Option::is_none")] - pub tool_type: Option<String>, + #[doc = "Target artifact type."] + #[serde( + rename = "artifactType", + default, + skip_serializing_if = "Option::is_none" + )] + pub artifact_type: Option<String>, + #[doc = "Outbound link type."] + #[serde(rename = "linkType", default, skip_serializing_if = "Option::is_none")] + pub link_type: Option<String>, + #[doc = "Target tool type."] + #[serde(rename = "toolType", default, skip_serializing_if = "Option::is_none")] + pub tool_type: Option<String>, } impl WorkArtifactLink { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkArtifactLinkList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkArtifactLink>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkArtifactLink>, } impl WorkArtifactLinkList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a work item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItem { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "Represents the reference to a specific version of a comment on a Work Item."] - #[serde( - rename = "commentVersionRef", - default, - skip_serializing_if = "Option::is_none" - )] - pub comment_version_ref: Option<WorkItemCommentVersionRef>, - #[doc = "Map of field and values for the work item."] - pub fields: serde_json::Value, - #[doc = "The work item ID."] - pub id: i32, - #[doc = "Relations of the work item."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub relations: Vec<WorkItemRelation>, - #[doc = "Revision number of the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rev: Option<i32>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "Represents the reference to a specific version of a comment on a Work Item."] + #[serde( + rename = "commentVersionRef", + default, + skip_serializing_if = "Option::is_none" + )] + pub comment_version_ref: Option<WorkItemCommentVersionRef>, + #[doc = "Map of field and values for the work item."] + pub fields: serde_json::Value, + #[doc = "The work item ID."] + pub id: i32, + #[doc = "Relations of the work item."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub relations: Vec<WorkItemRelation>, + #[doc = "Revision number of the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rev: Option<i32>, } impl WorkItem { - pub fn new( - work_item_tracking_resource: WorkItemTrackingResource, - fields: serde_json::Value, - id: i32, - ) -> Self { - Self { - work_item_tracking_resource, - comment_version_ref: None, - fields, - id, - relations: Vec::new(), - rev: None, - } - } + pub fn new( + work_item_tracking_resource: WorkItemTrackingResource, + fields: serde_json::Value, + id: i32, + ) -> Self { + Self { + work_item_tracking_resource, + comment_version_ref: None, + fields, + id, + relations: Vec::new(), + rev: None, + } + } } #[doc = "Describes a request to get a set of work items"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemBatchGetRequest { - #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }"] - #[serde(rename = "$expand", default, skip_serializing_if = "Option::is_none")] - pub expand: Option<work_item_batch_get_request::Expand>, - #[doc = "AsOf UTC date time string"] - #[serde( - rename = "asOf", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub as_of: Option<time::OffsetDateTime>, - #[doc = "The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}."] - #[serde( - rename = "errorPolicy", - default, - skip_serializing_if = "Option::is_none" - )] - pub error_policy: Option<work_item_batch_get_request::ErrorPolicy>, - #[doc = "The requested fields"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub fields: Vec<String>, - #[doc = "The requested work item ids"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ids: Vec<i32>, + #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }"] + #[serde(rename = "$expand", default, skip_serializing_if = "Option::is_none")] + pub expand: Option<work_item_batch_get_request::Expand>, + #[doc = "AsOf UTC date time string"] + #[serde( + rename = "asOf", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub as_of: Option<time::OffsetDateTime>, + #[doc = "The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}."] + #[serde( + rename = "errorPolicy", + default, + skip_serializing_if = "Option::is_none" + )] + pub error_policy: Option<work_item_batch_get_request::ErrorPolicy>, + #[doc = "The requested fields"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub fields: Vec<String>, + #[doc = "The requested work item ids"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ids: Vec<i32>, } impl WorkItemBatchGetRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod work_item_batch_get_request { - use super::*; - #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Expand { - #[serde(rename = "none")] - None, - #[serde(rename = "relations")] - Relations, - #[serde(rename = "fields")] - Fields, - #[serde(rename = "links")] - Links, - #[serde(rename = "all")] - All, - } - #[doc = "The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ErrorPolicy { - #[serde(rename = "fail")] - Fail, - #[serde(rename = "omit")] - Omit, - } + use super::*; + #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Expand { + #[serde(rename = "none")] + None, + #[serde(rename = "relations")] + Relations, + #[serde(rename = "fields")] + Fields, + #[serde(rename = "links")] + Links, + #[serde(rename = "all")] + All, + } + #[doc = "The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ErrorPolicy { + #[serde(rename = "fail")] + Fail, + #[serde(rename = "omit")] + Omit, + } } #[doc = "Defines a classification node for work item tracking."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemClassificationNode { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "Dictionary that has node attributes like start/finish date for iteration nodes."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attributes: Option<serde_json::Value>, - #[doc = "List of child nodes fetched."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub children: Vec<WorkItemClassificationNode>, - #[doc = "Flag that indicates if the classification node has any child nodes."] - #[serde( - rename = "hasChildren", - default, - skip_serializing_if = "Option::is_none" - )] - pub has_children: Option<bool>, - #[doc = "Integer ID of the classification node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "GUID ID of the classification node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identifier: Option<String>, - #[doc = "Name of the classification node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Path of the classification node."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "Node structure type."] - #[serde( - rename = "structureType", - default, - skip_serializing_if = "Option::is_none" - )] - pub structure_type: Option<work_item_classification_node::StructureType>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "Dictionary that has node attributes like start/finish date for iteration nodes."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attributes: Option<serde_json::Value>, + #[doc = "List of child nodes fetched."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub children: Vec<WorkItemClassificationNode>, + #[doc = "Flag that indicates if the classification node has any child nodes."] + #[serde( + rename = "hasChildren", + default, + skip_serializing_if = "Option::is_none" + )] + pub has_children: Option<bool>, + #[doc = "Integer ID of the classification node."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "GUID ID of the classification node."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identifier: Option<String>, + #[doc = "Name of the classification node."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Path of the classification node."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "Node structure type."] + #[serde( + rename = "structureType", + default, + skip_serializing_if = "Option::is_none" + )] + pub structure_type: Option<work_item_classification_node::StructureType>, } impl WorkItemClassificationNode { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - attributes: None, - children: Vec::new(), - has_children: None, - id: None, - identifier: None, - name: None, - path: None, - structure_type: None, - } - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + attributes: None, + children: Vec::new(), + has_children: None, + id: None, + identifier: None, + name: None, + path: None, + structure_type: None, + } + } } pub mod work_item_classification_node { - use super::*; - #[doc = "Node structure type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum StructureType { - #[serde(rename = "area")] - Area, - #[serde(rename = "iteration")] - Iteration, - } + use super::*; + #[doc = "Node structure type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum StructureType { + #[serde(rename = "area")] + Area, + #[serde(rename = "iteration")] + Iteration, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemClassificationNodeList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemClassificationNode>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemClassificationNode>, } impl WorkItemClassificationNodeList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Comment on Work Item"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemComment { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "Represents the possible types for the comment format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option<work_item_comment::Format>, - #[doc = "The text of the comment in HTML format."] - #[serde( - rename = "renderedText", - default, - skip_serializing_if = "Option::is_none" - )] - pub rendered_text: Option<String>, - #[doc = ""] - #[serde(rename = "revisedBy", default, skip_serializing_if = "Option::is_none")] - pub revised_by: Option<IdentityReference>, - #[doc = "The date of comment."] - #[serde( - rename = "revisedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub revised_date: Option<time::OffsetDateTime>, - #[doc = "The work item revision number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "The text of the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = ""] + #[serde(rename = "revisedBy", default, skip_serializing_if = "Option::is_none")] + pub revised_by: Option<IdentityReference>, + #[doc = "The date of comment."] + #[serde( + rename = "revisedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub revised_date: Option<time::OffsetDateTime>, + #[doc = "The work item revision number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "The text of the comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, } impl WorkItemComment { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - format: None, - rendered_text: None, - revised_by: None, - revised_date: None, - revision: None, - text: None, - } - } -} -pub mod work_item_comment { - use super::*; - #[doc = "Represents the possible types for the comment format."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Format { - #[serde(rename = "markdown")] - Markdown, - #[serde(rename = "html")] - Html, + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + revised_by: None, + revised_date: None, + revision: None, + text: None, } + } } #[doc = "Represents the reference to a specific version of a comment on a Work Item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemCommentVersionRef { - #[serde(flatten)] - pub work_item_tracking_resource_reference: WorkItemTrackingResourceReference, - #[doc = "The id assigned to the comment."] - #[serde(rename = "commentId", default, skip_serializing_if = "Option::is_none")] - pub comment_id: Option<i32>, - #[doc = "\\[Internal\\] The work item revision where this comment was originally added."] - #[serde( - rename = "createdInRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub created_in_revision: Option<i32>, - #[doc = "\\[Internal\\] Specifies whether comment was deleted."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "\\[Internal\\] The text of the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, - #[doc = "The version number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i32>, + #[serde(flatten)] + pub work_item_tracking_resource_reference: WorkItemTrackingResourceReference, + #[doc = "The id assigned to the comment."] + #[serde(rename = "commentId", default, skip_serializing_if = "Option::is_none")] + pub comment_id: Option<i32>, + #[doc = "\\[Internal\\] The work item revision where this comment was originally added."] + #[serde( + rename = "createdInRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub created_in_revision: Option<i32>, + #[doc = "\\[Internal\\] Specifies whether comment was deleted."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "\\[Internal\\] The text of the comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, + #[doc = "The version number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i32>, } impl WorkItemCommentVersionRef { - pub fn new(work_item_tracking_resource_reference: WorkItemTrackingResourceReference) -> Self { - Self { - work_item_tracking_resource_reference, - comment_id: None, - created_in_revision: None, - is_deleted: None, - text: None, - version: None, - } + pub fn new(work_item_tracking_resource_reference: WorkItemTrackingResourceReference) -> Self { + Self { + work_item_tracking_resource_reference, + comment_id: None, + created_in_revision: None, + is_deleted: None, + text: None, + version: None, } + } } #[doc = "Collection of comments."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemComments { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "Comments collection."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub comments: Vec<WorkItemComment>, - #[doc = "The count of comments."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[doc = "Count of comments from the revision."] - #[serde( - rename = "fromRevisionCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub from_revision_count: Option<i32>, - #[doc = "Total count of comments."] - #[serde( - rename = "totalCount", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_count: Option<i32>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "Comments collection."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub comments: Vec<WorkItemComment>, + #[doc = "The count of comments."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[doc = "Count of comments from the revision."] + #[serde( + rename = "fromRevisionCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub from_revision_count: Option<i32>, + #[doc = "Total count of comments."] + #[serde( + rename = "totalCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_count: Option<i32>, } impl WorkItemComments { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - comments: Vec::new(), - count: None, - from_revision_count: None, - total_count: None, - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + comments: Vec::new(), + count: None, + from_revision_count: None, + total_count: None, } + } } #[doc = "Full deleted work item object. Includes the work item itself."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemDelete { - #[serde(flatten)] - pub work_item_delete_reference: WorkItemDeleteReference, - #[doc = "Describes a work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option<WorkItem>, + #[serde(flatten)] + pub work_item_delete_reference: WorkItemDeleteReference, + #[doc = "Describes a work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option<WorkItem>, } impl WorkItemDelete { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes response to delete a set of work items."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkItemDeleteBatch { - #[doc = "List of results for each work item"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<WorkItemDelete>, -} -impl WorkItemDeleteBatch { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes a request to delete a set of work items"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkItemDeleteBatchRequest { - #[doc = "Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub destroy: Option<bool>, - #[doc = "The requested work item ids"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ids: Vec<i32>, - #[doc = "Optional parameter, if set to true, notifications will be disabled."] - #[serde( - rename = "skipNotifications", - default, - skip_serializing_if = "Option::is_none" - )] - pub skip_notifications: Option<bool>, -} -impl WorkItemDeleteBatchRequest { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to a deleted work item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemDeleteReference { - #[doc = "The HTTP status code for work item operation in a batch request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option<i32>, - #[doc = "The user who deleted the work item type."] - #[serde(rename = "deletedBy", default, skip_serializing_if = "Option::is_none")] - pub deleted_by: Option<String>, - #[doc = "The work item deletion date."] - #[serde( - rename = "deletedDate", - default, - skip_serializing_if = "Option::is_none" - )] - pub deleted_date: Option<String>, - #[doc = "Work item ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "The exception message for work item operation in a batch request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "Name or title of the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Parent project of the deleted work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<String>, - #[doc = "Type of work item."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<String>, - #[doc = "REST API URL of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The HTTP status code for work item operation in a batch request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option<i32>, + #[doc = "The user who deleted the work item type."] + #[serde(rename = "deletedBy", default, skip_serializing_if = "Option::is_none")] + pub deleted_by: Option<String>, + #[doc = "The work item deletion date."] + #[serde( + rename = "deletedDate", + default, + skip_serializing_if = "Option::is_none" + )] + pub deleted_date: Option<String>, + #[doc = "Work item ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "The exception message for work item operation in a batch request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "Name or title of the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Parent project of the deleted work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<String>, + #[doc = "Type of work item."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<String>, + #[doc = "REST API URL of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemDeleteReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemDeleteReferenceList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemDeleteReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemDeleteReference>, } impl WorkItemDeleteReferenceList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Shallow Reference to a deleted work item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemDeleteShallowReference { - #[doc = "Work item ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "REST API URL of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Work item ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "REST API URL of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemDeleteShallowReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemDeleteShallowReferenceList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemDeleteShallowReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemDeleteShallowReference>, } impl WorkItemDeleteShallowReferenceList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes an update request for a deleted work item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemDeleteUpdate { - #[doc = "Sets a value indicating whether this work item is deleted."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, + #[doc = "Sets a value indicating whether this work item is deleted."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, } impl WorkItemDeleteUpdate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a field on a work item and it's properties specific to that work item type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemField { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "Indicates whether the field is sortable in server queries."] - #[serde(rename = "canSortBy", default, skip_serializing_if = "Option::is_none")] - pub can_sort_by: Option<bool>, - #[doc = "The description of the field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Indicates whether this field is deleted."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "Indicates whether this field is an identity field."] - #[serde( - rename = "isIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_identity: Option<bool>, - #[doc = "Indicates whether this instance is picklist."] - #[serde( - rename = "isPicklist", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_picklist: Option<bool>, - #[doc = "Indicates whether this instance is a suggested picklist ."] - #[serde( - rename = "isPicklistSuggested", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_picklist_suggested: Option<bool>, - #[doc = "Indicates whether the field can be queried in the server."] - #[serde( - rename = "isQueryable", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_queryable: Option<bool>, - #[doc = "The name of the field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "If this field is picklist, the identifier of the picklist associated, otherwise null"] - #[serde( - rename = "picklistId", - default, - skip_serializing_if = "Option::is_none" - )] - pub picklist_id: Option<String>, - #[doc = "Indicates whether the field is [read only]."] - #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] - pub read_only: Option<bool>, - #[doc = "The reference name of the field."] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "The supported operations on this field."] - #[serde( - rename = "supportedOperations", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub supported_operations: Vec<WorkItemFieldOperation>, - #[doc = "The type of the field."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<work_item_field::Type>, - #[doc = "The usage of the field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub usage: Option<work_item_field::Usage>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "Indicates whether the field is sortable in server queries."] + #[serde(rename = "canSortBy", default, skip_serializing_if = "Option::is_none")] + pub can_sort_by: Option<bool>, + #[doc = "The description of the field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Indicates whether this field is deleted."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "Indicates whether this field is an identity field."] + #[serde( + rename = "isIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_identity: Option<bool>, + #[doc = "Indicates whether this instance is picklist."] + #[serde( + rename = "isPicklist", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_picklist: Option<bool>, + #[doc = "Indicates whether this instance is a suggested picklist ."] + #[serde( + rename = "isPicklistSuggested", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_picklist_suggested: Option<bool>, + #[doc = "Indicates whether the field can be queried in the server."] + #[serde( + rename = "isQueryable", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_queryable: Option<bool>, + #[doc = "The name of the field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "If this field is picklist, the identifier of the picklist associated, otherwise null"] + #[serde( + rename = "picklistId", + default, + skip_serializing_if = "Option::is_none" + )] + pub picklist_id: Option<String>, + #[doc = "Indicates whether the field is [read only]."] + #[serde(rename = "readOnly", default, skip_serializing_if = "Option::is_none")] + pub read_only: Option<bool>, + #[doc = "The reference name of the field."] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "The supported operations on this field."] + #[serde( + rename = "supportedOperations", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub supported_operations: Vec<WorkItemFieldOperation>, + #[doc = "The type of the field."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<work_item_field::Type>, + #[doc = "The usage of the field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option<work_item_field::Usage>, } impl WorkItemField { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - can_sort_by: None, - description: None, - is_deleted: None, - is_identity: None, - is_picklist: None, - is_picklist_suggested: None, - is_queryable: None, - name: None, - picklist_id: None, - read_only: None, - reference_name: None, - supported_operations: Vec::new(), - type_: None, - usage: None, - } - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + can_sort_by: None, + description: None, + is_deleted: None, + is_identity: None, + is_picklist: None, + is_picklist_suggested: None, + is_queryable: None, + name: None, + picklist_id: None, + read_only: None, + reference_name: None, + supported_operations: Vec::new(), + type_: None, + usage: None, + } + } } pub mod work_item_field { - use super::*; - #[doc = "The type of the field."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "string")] - String, - #[serde(rename = "integer")] - Integer, - #[serde(rename = "dateTime")] - DateTime, - #[serde(rename = "plainText")] - PlainText, - #[serde(rename = "html")] - Html, - #[serde(rename = "treePath")] - TreePath, - #[serde(rename = "history")] - History, - #[serde(rename = "double")] - Double, - #[serde(rename = "guid")] - Guid, - #[serde(rename = "boolean")] - Boolean, - #[serde(rename = "identity")] - Identity, - #[serde(rename = "picklistString")] - PicklistString, - #[serde(rename = "picklistInteger")] - PicklistInteger, - #[serde(rename = "picklistDouble")] - PicklistDouble, - } - #[doc = "The usage of the field."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Usage { - #[serde(rename = "none")] - None, - #[serde(rename = "workItem")] - WorkItem, - #[serde(rename = "workItemLink")] - WorkItemLink, - #[serde(rename = "tree")] - Tree, - #[serde(rename = "workItemTypeExtension")] - WorkItemTypeExtension, - } -} -#[doc = "Describes a field on a work item and it's properties specific to that work item type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WorkItemField2 { - #[serde(flatten)] - pub work_item_field: WorkItemField, - #[doc = "Indicates whether this field is marked as locked for editing."] - #[serde(rename = "isLocked", default, skip_serializing_if = "Option::is_none")] - pub is_locked: Option<bool>, -} -impl WorkItemField2 { - pub fn new(work_item_field: WorkItemField) -> Self { - Self { - work_item_field, - is_locked: None, - } - } + use super::*; + #[doc = "The type of the field."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "string")] + String, + #[serde(rename = "integer")] + Integer, + #[serde(rename = "dateTime")] + DateTime, + #[serde(rename = "plainText")] + PlainText, + #[serde(rename = "html")] + Html, + #[serde(rename = "treePath")] + TreePath, + #[serde(rename = "history")] + History, + #[serde(rename = "double")] + Double, + #[serde(rename = "guid")] + Guid, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "identity")] + Identity, + #[serde(rename = "picklistString")] + PicklistString, + #[serde(rename = "picklistInteger")] + PicklistInteger, + #[serde(rename = "picklistDouble")] + PicklistDouble, + } + #[doc = "The usage of the field."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Usage { + #[serde(rename = "none")] + None, + #[serde(rename = "workItem")] + WorkItem, + #[serde(rename = "workItemLink")] + WorkItemLink, + #[serde(rename = "tree")] + Tree, + #[serde(rename = "workItemTypeExtension")] + WorkItemTypeExtension, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkItemField2List { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemField2>, -} -impl WorkItemField2List { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes the list of allowed values of the field."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WorkItemFieldAllowedValues { - #[doc = "The list of field allowed values."] - #[serde( - rename = "allowedValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub allowed_values: Vec<String>, - #[doc = "Name of the field."] - #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] - pub field_name: Option<String>, -} -impl WorkItemFieldAllowedValues { - pub fn new() -> Self { - Self::default() - } +pub struct WorkItemFieldList { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemField>, +} +impl WorkItemFieldList { + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a work item field operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemFieldOperation { - #[doc = "Friendly name of the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Reference name of the operation."] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, + #[doc = "Friendly name of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Reference name of the operation."] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, } impl WorkItemFieldOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to a field in a work item"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemFieldReference { - #[doc = "The friendly name of the field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The reference name of the field."] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "The REST URL of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The friendly name of the field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The reference name of the field."] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "The REST URL of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemFieldReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes an update to a work item field."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemFieldUpdate { - #[doc = "The new value of the field."] - #[serde(rename = "newValue", default, skip_serializing_if = "Option::is_none")] - pub new_value: Option<serde_json::Value>, - #[doc = "The old value of the field."] - #[serde(rename = "oldValue", default, skip_serializing_if = "Option::is_none")] - pub old_value: Option<serde_json::Value>, + #[doc = "The new value of the field."] + #[serde(rename = "newValue", default, skip_serializing_if = "Option::is_none")] + pub new_value: Option<serde_json::Value>, + #[doc = "The old value of the field."] + #[serde(rename = "oldValue", default, skip_serializing_if = "Option::is_none")] + pub old_value: Option<serde_json::Value>, } impl WorkItemFieldUpdate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemHistory { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rev: Option<i32>, - #[doc = ""] - #[serde(rename = "revisedBy", default, skip_serializing_if = "Option::is_none")] - pub revised_by: Option<IdentityReference>, - #[serde( - rename = "revisedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub revised_date: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rev: Option<i32>, + #[doc = ""] + #[serde(rename = "revisedBy", default, skip_serializing_if = "Option::is_none")] + pub revised_by: Option<IdentityReference>, + #[serde( + rename = "revisedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub revised_date: Option<time::OffsetDateTime>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl WorkItemHistory { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - rev: None, - revised_by: None, - revised_date: None, - value: None, - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + rev: None, + revised_by: None, + revised_date: None, + value: None, } + } } #[doc = "Reference to a work item icon."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemIcon { - #[doc = "The identifier of the icon."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The REST URL of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The identifier of the icon."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The REST URL of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemIcon { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemIconList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemIcon>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemIcon>, } impl WorkItemIconList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A link between two work items."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemLink { - #[doc = "The type of link."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rel: Option<String>, - #[doc = "Contains reference to a work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<WorkItemReference>, - #[doc = "Contains reference to a work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<WorkItemReference>, + #[doc = "The type of link."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rel: Option<String>, + #[doc = "Contains reference to a work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<WorkItemReference>, + #[doc = "Contains reference to a work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<WorkItemReference>, } impl WorkItemLink { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItem>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItem>, } impl WorkItemList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes the next state for a work item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemNextStateOnTransition { - #[doc = "Error code if there is no next state transition possible."] - #[serde(rename = "errorCode", default, skip_serializing_if = "Option::is_none")] - pub error_code: Option<String>, - #[doc = "Work item ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Error message if there is no next state transition possible."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[doc = "Name of the next state on transition."] - #[serde( - rename = "stateOnTransition", - default, - skip_serializing_if = "Option::is_none" - )] - pub state_on_transition: Option<String>, + #[doc = "Error code if there is no next state transition possible."] + #[serde(rename = "errorCode", default, skip_serializing_if = "Option::is_none")] + pub error_code: Option<String>, + #[doc = "Work item ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Error message if there is no next state transition possible."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[doc = "Name of the next state on transition."] + #[serde( + rename = "stateOnTransition", + default, + skip_serializing_if = "Option::is_none" + )] + pub state_on_transition: Option<String>, } impl WorkItemNextStateOnTransition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemNextStateOnTransitionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemNextStateOnTransition>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemNextStateOnTransition>, } impl WorkItemNextStateOnTransitionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a clause in a work item query. This shows the structure of a work item query."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemQueryClause { - #[doc = "Child clauses if the current clause is a logical operator"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub clauses: Vec<WorkItemQueryClause>, - #[doc = "Reference to a field in a work item"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub field: Option<WorkItemFieldReference>, - #[doc = "Reference to a field in a work item"] - #[serde( - rename = "fieldValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub field_value: Option<WorkItemFieldReference>, - #[doc = "Determines if this is a field to field comparison"] - #[serde( - rename = "isFieldValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_field_value: Option<bool>, - #[doc = "Logical operator separating the condition clause"] - #[serde( - rename = "logicalOperator", - default, - skip_serializing_if = "Option::is_none" - )] - pub logical_operator: Option<work_item_query_clause::LogicalOperator>, - #[doc = "Describes a work item field operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operator: Option<WorkItemFieldOperation>, - #[doc = "Right side of the condition when a field to value comparison"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[doc = "Child clauses if the current clause is a logical operator"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub clauses: Vec<WorkItemQueryClause>, + #[doc = "Reference to a field in a work item"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub field: Option<WorkItemFieldReference>, + #[doc = "Reference to a field in a work item"] + #[serde( + rename = "fieldValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub field_value: Option<WorkItemFieldReference>, + #[doc = "Determines if this is a field to field comparison"] + #[serde( + rename = "isFieldValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_field_value: Option<bool>, + #[doc = "Logical operator separating the condition clause"] + #[serde( + rename = "logicalOperator", + default, + skip_serializing_if = "Option::is_none" + )] + pub logical_operator: Option<work_item_query_clause::LogicalOperator>, + #[doc = "Describes a work item field operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option<WorkItemFieldOperation>, + #[doc = "Right side of the condition when a field to value comparison"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl WorkItemQueryClause { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod work_item_query_clause { - use super::*; - #[doc = "Logical operator separating the condition clause"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum LogicalOperator { - #[serde(rename = "none")] - None, - #[serde(rename = "and")] - And, - #[serde(rename = "or")] - Or, - } + use super::*; + #[doc = "Logical operator separating the condition clause"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum LogicalOperator { + #[serde(rename = "none")] + None, + #[serde(rename = "and")] + And, + #[serde(rename = "or")] + Or, + } } #[doc = "The result of a work item query."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemQueryResult { - #[doc = "The date the query was run in the context of."] - #[serde( - rename = "asOf", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub as_of: Option<time::OffsetDateTime>, - #[doc = "The columns of the query."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub columns: Vec<WorkItemFieldReference>, - #[doc = "The result type"] - #[serde( - rename = "queryResultType", - default, - skip_serializing_if = "Option::is_none" - )] - pub query_result_type: Option<work_item_query_result::QueryResultType>, - #[doc = "The type of the query"] - #[serde(rename = "queryType", default, skip_serializing_if = "Option::is_none")] - pub query_type: Option<work_item_query_result::QueryType>, - #[doc = "The sort columns of the query."] - #[serde( - rename = "sortColumns", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub sort_columns: Vec<WorkItemQuerySortColumn>, - #[doc = "The work item links returned by the query."] - #[serde( - rename = "workItemRelations", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_relations: Vec<WorkItemLink>, - #[doc = "The work items returned by the query."] - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<WorkItemReference>, + #[doc = "The date the query was run in the context of."] + #[serde( + rename = "asOf", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub as_of: Option<time::OffsetDateTime>, + #[doc = "The columns of the query."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub columns: Vec<WorkItemFieldReference>, + #[doc = "The result type"] + #[serde( + rename = "queryResultType", + default, + skip_serializing_if = "Option::is_none" + )] + pub query_result_type: Option<work_item_query_result::QueryResultType>, + #[doc = "The type of the query"] + #[serde(rename = "queryType", default, skip_serializing_if = "Option::is_none")] + pub query_type: Option<work_item_query_result::QueryType>, + #[doc = "The sort columns of the query."] + #[serde( + rename = "sortColumns", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub sort_columns: Vec<WorkItemQuerySortColumn>, + #[doc = "The work item links returned by the query."] + #[serde( + rename = "workItemRelations", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_relations: Vec<WorkItemLink>, + #[doc = "The work items returned by the query."] + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<WorkItemReference>, } impl WorkItemQueryResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod work_item_query_result { - use super::*; - #[doc = "The result type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum QueryResultType { - #[serde(rename = "workItem")] - WorkItem, - #[serde(rename = "workItemLink")] - WorkItemLink, - } - #[doc = "The type of the query"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum QueryType { - #[serde(rename = "flat")] - Flat, - #[serde(rename = "tree")] - Tree, - #[serde(rename = "oneHop")] - OneHop, - } + use super::*; + #[doc = "The result type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum QueryResultType { + #[serde(rename = "workItem")] + WorkItem, + #[serde(rename = "workItemLink")] + WorkItemLink, + } + #[doc = "The type of the query"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum QueryType { + #[serde(rename = "flat")] + Flat, + #[serde(rename = "tree")] + Tree, + #[serde(rename = "oneHop")] + OneHop, + } } #[doc = "A sort column."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemQuerySortColumn { - #[doc = "The direction to sort by."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descending: Option<bool>, - #[doc = "Reference to a field in a work item"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub field: Option<WorkItemFieldReference>, + #[doc = "The direction to sort by."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descending: Option<bool>, + #[doc = "Reference to a field in a work item"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub field: Option<WorkItemFieldReference>, } impl WorkItemQuerySortColumn { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contains reference to a work item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemReference { - #[doc = "Work item ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "REST API URL of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Work item ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "REST API URL of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemRelation { - #[serde(flatten)] - pub link: Link, + #[serde(flatten)] + pub link: Link, } impl WorkItemRelation { - pub fn new(link: Link) -> Self { - Self { link } - } + pub fn new(link: Link) -> Self { + Self { link } + } } #[doc = "Represents the work item type relation type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemRelationType { - #[serde(flatten)] - pub work_item_tracking_reference: WorkItemTrackingReference, - #[doc = "The collection of relation type attributes."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attributes: Option<serde_json::Value>, + #[serde(flatten)] + pub work_item_tracking_reference: WorkItemTrackingReference, + #[doc = "The collection of relation type attributes."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attributes: Option<serde_json::Value>, } impl WorkItemRelationType { - pub fn new(work_item_tracking_reference: WorkItemTrackingReference) -> Self { - Self { - work_item_tracking_reference, - attributes: None, - } + pub fn new(work_item_tracking_reference: WorkItemTrackingReference) -> Self { + Self { + work_item_tracking_reference, + attributes: None, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemRelationTypeList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemRelationType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemRelationType>, } impl WorkItemRelationTypeList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes updates to a work item's relations."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemRelationUpdates { - #[doc = "List of newly added relations."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub added: Vec<WorkItemRelation>, - #[doc = "List of removed relations."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub removed: Vec<WorkItemRelation>, - #[doc = "List of updated relations."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub updated: Vec<WorkItemRelation>, + #[doc = "List of newly added relations."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub added: Vec<WorkItemRelation>, + #[doc = "List of removed relations."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub removed: Vec<WorkItemRelation>, + #[doc = "List of updated relations."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub updated: Vec<WorkItemRelation>, } impl WorkItemRelationUpdates { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Work item type state name, color and state category"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemStateColor { - #[doc = "Category of state"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option<String>, - #[doc = "Color value"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "Work item type state name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[doc = "Category of state"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option<String>, + #[doc = "Color value"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "Work item type state name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl WorkItemStateColor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemStateColorList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemStateColor>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemStateColor>, } impl WorkItemStateColorList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a state transition in a work item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemStateTransition { - #[doc = "Gets a list of actions needed to transition to that state."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub actions: Vec<String>, - #[doc = "Name of the next state."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub to: Option<String>, + #[doc = "Gets a list of actions needed to transition to that state."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub actions: Vec<String>, + #[doc = "Name of the next state."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub to: Option<String>, } impl WorkItemStateTransition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTagDefinition { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde( - rename = "lastUpdated", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_updated: Option<time::OffsetDateTime>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemTagDefinition { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTagDefinitionList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemTagDefinition>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemTagDefinition>, } impl WorkItemTagDefinitionList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a work item template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemTemplate { - #[serde(flatten)] - pub work_item_template_reference: WorkItemTemplateReference, - #[doc = "Mapping of field and its templated value."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fields: Option<serde_json::Value>, + #[serde(flatten)] + pub work_item_template_reference: WorkItemTemplateReference, + #[doc = "Mapping of field and its templated value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fields: Option<serde_json::Value>, } impl WorkItemTemplate { - pub fn new(work_item_template_reference: WorkItemTemplateReference) -> Self { - Self { - work_item_template_reference, - fields: None, - } + pub fn new(work_item_template_reference: WorkItemTemplateReference) -> Self { + Self { + work_item_template_reference, + fields: None, } + } } #[doc = "Describes a shallow reference to a work item template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemTemplateReference { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "The description of the work item template."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The identifier of the work item template."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "The name of the work item template."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The name of the work item type."] - #[serde( - rename = "workItemTypeName", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type_name: Option<String>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "The description of the work item template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The identifier of the work item template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "The name of the work item template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The name of the work item type."] + #[serde( + rename = "workItemTypeName", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type_name: Option<String>, } impl WorkItemTemplateReference { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - description: None, - id: None, - name: None, - work_item_type_name: None, - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + description: None, + id: None, + name: None, + work_item_type_name: None, } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTemplateReferenceList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemTemplateReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemTemplateReference>, } impl WorkItemTemplateReferenceList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemTrackingReference { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "The name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The reference name."] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "The name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The reference name."] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, } impl WorkItemTrackingReference { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - name: None, - reference_name: None, - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + name: None, + reference_name: None, } + } } #[doc = "Base class for WIT REST resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemTrackingResource { - #[serde(flatten)] - pub work_item_tracking_resource_reference: WorkItemTrackingResourceReference, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[serde(flatten)] + pub work_item_tracking_resource_reference: WorkItemTrackingResourceReference, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl WorkItemTrackingResource { - pub fn new(work_item_tracking_resource_reference: WorkItemTrackingResourceReference) -> Self { - Self { - work_item_tracking_resource_reference, - links: None, - } + pub fn new(work_item_tracking_resource_reference: WorkItemTrackingResourceReference) -> Self { + Self { + work_item_tracking_resource_reference, + links: None, } + } } #[doc = "Base class for work item tracking resource references."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemTrackingResourceReference { - pub url: String, + pub url: String, } impl WorkItemTrackingResourceReference { - pub fn new(url: String) -> Self { - Self { url } - } + pub fn new(url: String) -> Self { + Self { url } + } } #[doc = "Describes a work item type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemType { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "The color."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "The description of the work item type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "The fields that exist on the work item type."] - #[serde( - rename = "fieldInstances", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub field_instances: Vec<WorkItemTypeFieldInstance>, - #[doc = "The fields that exist on the work item type."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub fields: Vec<WorkItemTypeFieldInstance>, - #[doc = "Reference to a work item icon."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub icon: Option<WorkItemIcon>, - #[doc = "True if work item type is disabled"] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "Gets the name of the work item type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The reference name of the work item type."] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "Gets state information for the work item type."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub states: Vec<WorkItemStateColor>, - #[doc = "Gets the various state transition mappings in the work item type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub transitions: Option<serde_json::Value>, - #[doc = "The XML form."] - #[serde(rename = "xmlForm", default, skip_serializing_if = "Option::is_none")] - pub xml_form: Option<String>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "The color."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "The description of the work item type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "The fields that exist on the work item type."] + #[serde( + rename = "fieldInstances", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub field_instances: Vec<WorkItemTypeFieldInstance>, + #[doc = "The fields that exist on the work item type."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub fields: Vec<WorkItemTypeFieldInstance>, + #[doc = "Reference to a work item icon."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icon: Option<WorkItemIcon>, + #[doc = "True if work item type is disabled"] + #[serde( + rename = "isDisabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_disabled: Option<bool>, + #[doc = "Gets the name of the work item type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The reference name of the work item type."] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "Gets state information for the work item type."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub states: Vec<WorkItemStateColor>, + #[doc = "Gets the various state transition mappings in the work item type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub transitions: Option<serde_json::Value>, + #[doc = "The XML form."] + #[serde(rename = "xmlForm", default, skip_serializing_if = "Option::is_none")] + pub xml_form: Option<String>, } impl WorkItemType { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - color: None, - description: None, - field_instances: Vec::new(), - fields: Vec::new(), - icon: None, - is_disabled: None, - name: None, - reference_name: None, - states: Vec::new(), - transitions: None, - xml_form: None, - } - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + color: None, + description: None, + field_instances: Vec::new(), + fields: Vec::new(), + icon: None, + is_disabled: None, + name: None, + reference_name: None, + states: Vec::new(), + transitions: None, + xml_form: None, + } + } } #[doc = "Describes a work item type category."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemTypeCategory { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "Reference to a work item type."] - #[serde( - rename = "defaultWorkItemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_work_item_type: Option<WorkItemTypeReference>, - #[doc = "The name of the category."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The reference name of the category."] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "The work item types that belong to the category."] - #[serde( - rename = "workItemTypes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_types: Vec<WorkItemTypeReference>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "Reference to a work item type."] + #[serde( + rename = "defaultWorkItemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_work_item_type: Option<WorkItemTypeReference>, + #[doc = "The name of the category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The reference name of the category."] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "The work item types that belong to the category."] + #[serde( + rename = "workItemTypes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_types: Vec<WorkItemTypeReference>, } impl WorkItemTypeCategory { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - default_work_item_type: None, - name: None, - reference_name: None, - work_item_types: Vec::new(), - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + default_work_item_type: None, + name: None, + reference_name: None, + work_item_types: Vec::new(), } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeCategoryList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemTypeCategory>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemTypeCategory>, } impl WorkItemTypeCategoryList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a work item type's colors."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeColor { - #[doc = "Gets or sets the color of the primary."] - #[serde( - rename = "primaryColor", - default, - skip_serializing_if = "Option::is_none" - )] - pub primary_color: Option<String>, - #[doc = "Gets or sets the color of the secondary."] - #[serde( - rename = "secondaryColor", - default, - skip_serializing_if = "Option::is_none" - )] - pub secondary_color: Option<String>, - #[doc = "The name of the work item type."] - #[serde( - rename = "workItemTypeName", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type_name: Option<String>, + #[doc = "Gets or sets the color of the primary."] + #[serde( + rename = "primaryColor", + default, + skip_serializing_if = "Option::is_none" + )] + pub primary_color: Option<String>, + #[doc = "Gets or sets the color of the secondary."] + #[serde( + rename = "secondaryColor", + default, + skip_serializing_if = "Option::is_none" + )] + pub secondary_color: Option<String>, + #[doc = "The name of the work item type."] + #[serde( + rename = "workItemTypeName", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type_name: Option<String>, } impl WorkItemTypeColor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "Describes work item type name, its icon and color."] +#[doc = "Describes work item type nam, its icon and color."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeColorAndIcon { - #[doc = "The color of the work item type in hex format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "The work item type icon."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub icon: Option<String>, - #[doc = "Indicates if the work item is disabled in the process."] - #[serde( - rename = "isDisabled", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_disabled: Option<bool>, - #[doc = "The name of the work item type."] - #[serde( - rename = "workItemTypeName", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type_name: Option<String>, + #[doc = "The color of the work item type in hex format."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "The work item type icon."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icon: Option<String>, + #[doc = "The name of the work item type."] + #[serde( + rename = "workItemTypeName", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type_name: Option<String>, } impl WorkItemTypeColorAndIcon { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Field instance of a work item type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeFieldInstance { - #[serde(flatten)] - pub work_item_type_field_instance_base: WorkItemTypeFieldInstanceBase, - #[doc = "The list of field allowed values."] - #[serde( - rename = "allowedValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub allowed_values: Vec<String>, - #[doc = "Represents the default value of the field."] - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<String>, + #[serde(flatten)] + pub work_item_type_field_instance_base: WorkItemTypeFieldInstanceBase, + #[doc = "The list of field allowed values."] + #[serde( + rename = "allowedValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub allowed_values: Vec<String>, + #[doc = "Represents the default value of the field."] + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<String>, } impl WorkItemTypeFieldInstance { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Base field instance for workItemType fields."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeFieldInstanceBase { - #[serde(flatten)] - pub work_item_field_reference: WorkItemFieldReference, - #[doc = "Indicates whether field value is always required."] - #[serde( - rename = "alwaysRequired", - default, - skip_serializing_if = "Option::is_none" - )] - pub always_required: Option<bool>, - #[doc = "The list of dependent fields."] - #[serde( - rename = "dependentFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub dependent_fields: Vec<WorkItemFieldReference>, - #[doc = "Gets the help text for the field."] - #[serde(rename = "helpText", default, skip_serializing_if = "Option::is_none")] - pub help_text: Option<String>, + #[serde(flatten)] + pub work_item_field_reference: WorkItemFieldReference, + #[doc = "Indicates whether field value is always required."] + #[serde( + rename = "alwaysRequired", + default, + skip_serializing_if = "Option::is_none" + )] + pub always_required: Option<bool>, + #[doc = "The list of dependent fields."] + #[serde( + rename = "dependentFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub dependent_fields: Vec<WorkItemFieldReference>, + #[doc = "Gets the help text for the field."] + #[serde(rename = "helpText", default, skip_serializing_if = "Option::is_none")] + pub help_text: Option<String>, } impl WorkItemTypeFieldInstanceBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Field Instance of a workItemype with detailed references."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeFieldWithReferences { - #[serde(flatten)] - pub work_item_type_field_instance_base: WorkItemTypeFieldInstanceBase, - #[doc = "The list of field allowed values."] - #[serde( - rename = "allowedValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub allowed_values: Vec<serde_json::Value>, - #[doc = "Represents the default value of the field."] - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<serde_json::Value>, + #[serde(flatten)] + pub work_item_type_field_instance_base: WorkItemTypeFieldInstanceBase, + #[doc = "The list of field allowed values."] + #[serde( + rename = "allowedValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub allowed_values: Vec<serde_json::Value>, + #[doc = "Represents the default value of the field."] + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<serde_json::Value>, } impl WorkItemTypeFieldWithReferences { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeFieldWithReferencesList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemTypeFieldWithReferences>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemTypeFieldWithReferences>, } impl WorkItemTypeFieldWithReferencesList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemType>, } impl WorkItemTypeList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to a work item type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemTypeReference { - #[serde(flatten)] - pub work_item_tracking_resource_reference: WorkItemTrackingResourceReference, - #[doc = "Name of the work item type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(flatten)] + pub work_item_tracking_resource_reference: WorkItemTrackingResourceReference, + #[doc = "Name of the work item type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl WorkItemTypeReference { - pub fn new(work_item_tracking_resource_reference: WorkItemTrackingResourceReference) -> Self { - Self { - work_item_tracking_resource_reference, - name: None, - } + pub fn new(work_item_tracking_resource_reference: WorkItemTrackingResourceReference) -> Self { + Self { + work_item_tracking_resource_reference, + name: None, } + } } #[doc = "State colors for a work item type"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeStateColors { - #[doc = "Work item type state colors"] - #[serde( - rename = "stateColors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub state_colors: Vec<WorkItemStateColor>, - #[doc = "Work item type name"] - #[serde( - rename = "workItemTypeName", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type_name: Option<String>, + #[doc = "Work item type state colors"] + #[serde( + rename = "stateColors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub state_colors: Vec<WorkItemStateColor>, + #[doc = "Work item type name"] + #[serde( + rename = "workItemTypeName", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type_name: Option<String>, } impl WorkItemTypeStateColors { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a work item type template."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeTemplate { - #[doc = "XML template in string format."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub template: Option<String>, + #[doc = "XML template in string format."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub template: Option<String>, } impl WorkItemTypeTemplate { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a update work item type template request body."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeTemplateUpdateModel { - #[doc = "Describes the type of the action for the update request."] - #[serde( - rename = "actionType", - default, - skip_serializing_if = "Option::is_none" - )] - pub action_type: Option<work_item_type_template_update_model::ActionType>, - #[doc = "Methodology to which the template belongs, eg. Agile, Scrum, CMMI."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub methodology: Option<String>, - #[doc = "String representation of the work item type template."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub template: Option<String>, - #[doc = "The type of the template described in the request body."] - #[serde( - rename = "templateType", - default, - skip_serializing_if = "Option::is_none" - )] - pub template_type: Option<work_item_type_template_update_model::TemplateType>, + #[doc = "Describes the type of the action for the update request."] + #[serde( + rename = "actionType", + default, + skip_serializing_if = "Option::is_none" + )] + pub action_type: Option<work_item_type_template_update_model::ActionType>, + #[doc = "Methodology to which the template belongs, eg. Agile, Scrum, CMMI."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub methodology: Option<String>, + #[doc = "String representation of the work item type template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub template: Option<String>, + #[doc = "The type of the template described in the request body."] + #[serde( + rename = "templateType", + default, + skip_serializing_if = "Option::is_none" + )] + pub template_type: Option<work_item_type_template_update_model::TemplateType>, } impl WorkItemTypeTemplateUpdateModel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod work_item_type_template_update_model { - use super::*; - #[doc = "Describes the type of the action for the update request."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ActionType { - #[serde(rename = "import")] - Import, - #[serde(rename = "validate")] - Validate, - } - #[doc = "The type of the template described in the request body."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TemplateType { - #[serde(rename = "workItemType")] - WorkItemType, - #[serde(rename = "globalWorkflow")] - GlobalWorkflow, - } + use super::*; + #[doc = "Describes the type of the action for the update request."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ActionType { + #[serde(rename = "import")] + Import, + #[serde(rename = "validate")] + Validate, + } + #[doc = "The type of the template described in the request body."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum TemplateType { + #[serde(rename = "workItemType")] + WorkItemType, + #[serde(rename = "globalWorkflow")] + GlobalWorkflow, + } } #[doc = "Describes an update to a work item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WorkItemUpdate { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "List of updates to fields."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fields: Option<serde_json::Value>, - #[doc = "ID of update."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Describes updates to a work item's relations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub relations: Option<WorkItemRelationUpdates>, - #[doc = "The revision number of work item update."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rev: Option<i32>, - #[doc = ""] - #[serde(rename = "revisedBy", default, skip_serializing_if = "Option::is_none")] - pub revised_by: Option<IdentityReference>, - #[doc = "The work item updates revision date."] - #[serde( - rename = "revisedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub revised_date: Option<time::OffsetDateTime>, - #[doc = "The work item ID."] - #[serde( - rename = "workItemId", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_id: Option<i32>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "List of updates to fields."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fields: Option<serde_json::Value>, + #[doc = "ID of update."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Describes updates to a work item's relations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub relations: Option<WorkItemRelationUpdates>, + #[doc = "The revision number of work item update."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rev: Option<i32>, + #[doc = ""] + #[serde(rename = "revisedBy", default, skip_serializing_if = "Option::is_none")] + pub revised_by: Option<IdentityReference>, + #[doc = "The work item updates revision date."] + #[serde( + rename = "revisedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub revised_date: Option<time::OffsetDateTime>, + #[doc = "The work item ID."] + #[serde( + rename = "workItemId", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_id: Option<i32>, } impl WorkItemUpdate { - pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { - Self { - work_item_tracking_resource, - fields: None, - id: None, - relations: None, - rev: None, - revised_by: None, - revised_date: None, - work_item_id: None, - } - } + pub fn new(work_item_tracking_resource: WorkItemTrackingResource) -> Self { + Self { + work_item_tracking_resource, + fields: None, + id: None, + relations: None, + rev: None, + revised_by: None, + revised_date: None, + work_item_id: None, + } + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemUpdateList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<WorkItemUpdate>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<WorkItemUpdate>, } impl WorkItemUpdateList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } diff --git a/azure_devops_rust_api/src/work/mod.rs b/azure_devops_rust_api/src/work/mod.rs index 392586a3..cf37885b 100644 --- a/azure_devops_rust_api/src/work/mod.rs +++ b/azure_devops_rust_api/src/work/mod.rs @@ -9,7809 +9,7810 @@ pub mod models; #[derive(Clone)] pub struct Client { - endpoint: String, - credential: crate::Credential, - scopes: Vec<String>, - pipeline: azure_core::Pipeline, + endpoint: String, + credential: crate::Credential, + scopes: Vec<String>, + pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { - credential: crate::Credential, - endpoint: Option<String>, - scopes: Option<Vec<String>>, - options: azure_core::ClientOptions, + credential: crate::Credential, + endpoint: Option<String>, + scopes: Option<Vec<String>>, + options: azure_core::ClientOptions, } pub const DEFAULT_ENDPOINT: &str = "https://dev.azure.com/"; impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: crate::Credential) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { - self.endpoint = Some(endpoint.into()); - self + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: crate::Credential) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Set per-call policies."] + #[must_use] + pub fn per_call_policies( + mut self, + policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, + ) -> Self { + self.options = self.options.per_call_policies(policies); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self + .scopes + .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + #[allow(dead_code)] + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send( + &self, + request: &mut azure_core::Request, + ) -> azure_core::Result<azure_core::Response> { + let context = azure_core::Context::default(); + self.pipeline.send(&context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: crate::Credential) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into<String>, + credential: crate::Credential, + scopes: Vec<String>, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self { - self.options = self.options.retry(retry); - self + } + 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()) + } +} +pub mod boardcolumns { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get available board columns in a project"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self { - self.options = self.options.transport(transport); - self + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardSuggestedValueList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardSuggestedValueList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[doc = "Set per-call policies."] - #[must_use] - pub fn per_call_policies( - mut self, - policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>, - ) -> Self { - self.options = self.options.per_call_policies(policies); - self + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/work/boardcolumns", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self - .scopes - .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]); - Client::new(endpoint, self.credential, scopes, self.options) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardSuggestedValueList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardSuggestedValueList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() +pub mod boardrows { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get available board rows in a project"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } } - pub(crate) fn token_credential(&self) -> &crate::Credential { - &self.credential + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardSuggestedValueList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardSuggestedValueList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - #[allow(dead_code)] - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub(crate) async fn send( - &self, - request: &mut azure_core::Request, - ) -> azure_core::Result<azure_core::Response> { - let context = azure_core::Context::default(); - self.pipeline.send(&context, request).await + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: crate::Credential) -> ClientBuilder { - ClientBuilder::new(credential) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into<String>, - credential: crate::Credential, - scopes: Vec<String>, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/work/boardrows", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub fn backlogconfiguration_client(&self) -> backlogconfiguration::Client { - backlogconfiguration::Client(self.clone()) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardSuggestedValueList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardSuggestedValueList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - pub fn backlogs_client(&self) -> backlogs::Client { - backlogs::Client(self.clone()) + } +} +pub mod iterationcapacities { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get an iteration's capacity for all teams in iteration"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `iteration_id`: ID of the iteration"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + iteration_id: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + iteration_id: iteration_id.into(), + } } - pub fn boardcolumns_client(&self) -> boardcolumns::Client { - boardcolumns::Client(self.clone()) + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::IterationCapacity> { + let bytes = self.0.into_body().collect().await?; + let body: models::IterationCapacity = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub fn boardparents_client(&self) -> boardparents::Client { - boardparents::Client(self.clone()) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn boardrows_client(&self) -> boardrows::Client { - boardrows::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub fn boards_client(&self) -> boards::Client { - boards::Client(self.clone()) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) iteration_id: String, } - pub fn boardusersettings_client(&self) -> boardusersettings::Client { - boardusersettings::Client(self.clone()) + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/work/iterations/{}/iterationcapacities", + this.client.endpoint(), + &this.organization, + &this.project, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub fn capacities_client(&self) -> capacities::Client { - capacities::Client(self.clone()) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::IterationCapacity>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::IterationCapacity>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - pub fn cardrulesettings_client(&self) -> cardrulesettings::Client { - cardrulesettings::Client(self.clone()) + } +} +pub mod plans { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the information for all the plans configured for the given team"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } } - pub fn cardsettings_client(&self) -> cardsettings::Client { - cardsettings::Client(self.clone()) + #[doc = "Add a new plan for the team"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Plan definition"] + #[doc = "* `project`: Project ID or project name"] + pub fn create( + &self, + organization: impl Into<String>, + body: impl Into<models::CreatePlan>, + project: impl Into<String>, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } } - pub fn chartimages_client(&self) -> chartimages::Client { - chartimages::Client(self.clone()) + #[doc = "Get the information for the specified plan"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `id`: Identifier of the plan"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + id: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + id: id.into(), + } } - pub fn charts_client(&self) -> charts::Client { - charts::Client(self.clone()) + #[doc = "Update the information for the specified plan"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Plan definition to be updated"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `id`: Identifier of the plan"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::UpdatePlan>, + project: impl Into<String>, + id: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + id: id.into(), + } } - pub fn columns_client(&self) -> columns::Client { - columns::Client(self.clone()) + #[doc = "Delete the specified plan"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `id`: Identifier of the plan"] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + id: impl Into<String>, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + id: id.into(), + } } - pub fn deliverytimeline_client(&self) -> deliverytimeline::Client { - deliverytimeline::Client(self.clone()) + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::PlanList> { + let bytes = self.0.into_body().collect().await?; + let body: models::PlanList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub fn iterationcapacities_client(&self) -> iterationcapacities::Client { - iterationcapacities::Client(self.clone()) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn iterations_client(&self) -> iterations::Client { - iterations::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub fn plans_client(&self) -> plans::Client { - plans::Client(self.clone()) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, } - pub fn processconfiguration_client(&self) -> processconfiguration::Client { - processconfiguration::Client(self.clone()) + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/work/plans", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub fn rows_client(&self) -> rows::Client { - rows::Client(self.clone()) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::PlanList>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::PlanList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } - pub fn taskboard_columns_client(&self) -> taskboard_columns::Client { - taskboard_columns::Client(self.clone()) + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Plan> { + let bytes = self.0.into_body().collect().await?; + let body: models::Plan = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - pub fn taskboard_work_items_client(&self) -> taskboard_work_items::Client { - taskboard_work_items::Client(self.clone()) + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } - pub fn teamdaysoff_client(&self) -> teamdaysoff::Client { - teamdaysoff::Client(self.clone()) + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } - pub fn teamfieldvalues_client(&self) -> teamfieldvalues::Client { - teamfieldvalues::Client(self.clone()) + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CreatePlan, + pub(crate) project: String, } - pub fn teamsettings_client(&self) -> teamsettings::Client { - teamsettings::Client(self.clone()) + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/work/plans", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } - pub fn workitemsorder_client(&self) -> workitemsorder::Client { - workitemsorder::Client(self.clone()) + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Plan>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Plan>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } -} -pub mod boardcolumns { + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get available board columns in a project"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardSuggestedValueList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardSuggestedValueList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/work/boardcolumns", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardSuggestedValueList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BoardSuggestedValueList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Plan> { + let bytes = self.0.into_body().collect().await?; + let body: models::Plan = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod boardrows { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get available board rows in a project"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardSuggestedValueList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardSuggestedValueList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/work/boardrows", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardSuggestedValueList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BoardSuggestedValueList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } -} -pub mod iterationcapacities { + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/work/plans/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Plan>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Plan>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get an iteration's capacity for all teams in iteration"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `iteration_id`: ID of the iteration"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - iteration_id: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - iteration_id: iteration_id.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::IterationCapacity> { - let bytes = self.0.into_body().collect().await?; - let body: models::IterationCapacity = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) iteration_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/work/iterations/{}/iterationcapacities", - this.client.endpoint(), - &this.organization, - &this.project, - &this.iteration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::IterationCapacity>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::IterationCapacity>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Plan> { + let bytes = self.0.into_body().collect().await?; + let body: models::Plan = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } -} -pub mod plans { + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UpdatePlan, + pub(crate) project: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/work/plans/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Plan>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Plan>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get the information for all the plans configured for the given team"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - #[doc = "Add a new plan for the team"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Plan definition"] - #[doc = "* `project`: Project ID or project name"] - pub fn create( - &self, - organization: impl Into<String>, - body: impl Into<models::CreatePlan>, - project: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `id`: Identifier of the plan"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Plan definition to be updated"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `id`: Identifier of the plan"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::UpdatePlan>, - project: impl Into<String>, - id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `id`: Identifier of the plan"] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - id: impl Into<String>, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - id: id.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::PlanList> { - let bytes = self.0.into_body().collect().await?; - let body: models::PlanList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/work/plans", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::PlanList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::PlanList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Plan> { - let bytes = self.0.into_body().collect().await?; - let body: models::Plan = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CreatePlan, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/work/plans", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Plan>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Plan>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Plan> { - let bytes = self.0.into_body().collect().await?; - let body: models::Plan = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/work/plans/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Plan>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Plan>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Plan> { - let bytes = self.0.into_body().collect().await?; - let body: models::Plan = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::UpdatePlan, - pub(crate) project: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/work/plans/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Plan>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Plan>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/work/plans/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/work/plans/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod deliverytimeline { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get Delivery View Data"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `id`: Identifier for delivery view"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + id: impl Into<String>, + ) -> 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 get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get Delivery View Data"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `id`: Identifier for delivery view"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - id: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::DeliveryViewData> { - let bytes = self.0.into_body().collect().await?; - let body: models::DeliveryViewData = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) id: String, - pub(crate) revision: Option<i32>, - pub(crate) start_date: Option<time::OffsetDateTime>, - pub(crate) end_date: Option<time::OffsetDateTime>, - } - 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); - self - } - #[doc = "The start date of timeline"] - pub fn start_date(mut self, start_date: impl Into<time::OffsetDateTime>) -> Self { - self.start_date = Some(start_date.into()); - self - } - #[doc = "The end date of timeline"] - pub fn end_date(mut self, end_date: impl Into<time::OffsetDateTime>) -> Self { - self.end_date = Some(end_date.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/work/plans/{}/deliverytimeline", - this.client.endpoint(), - &this.organization, - &this.project, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::DeliveryViewData>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::DeliveryViewData>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::DeliveryViewData> { + let bytes = self.0.into_body().collect().await?; + let body: models::DeliveryViewData = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) id: String, + pub(crate) revision: Option<i32>, + pub(crate) start_date: Option<time::OffsetDateTime>, + pub(crate) end_date: Option<time::OffsetDateTime>, + } + 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); + self + } + #[doc = "The start date of timeline"] + pub fn start_date(mut self, start_date: impl Into<time::OffsetDateTime>) -> Self { + self.start_date = Some(start_date.into()); + self + } + #[doc = "The end date of timeline"] + pub fn end_date(mut self, end_date: impl Into<time::OffsetDateTime>) -> Self { + self.end_date = Some(end_date.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/work/plans/{}/deliverytimeline", + this.client.endpoint(), + &this.organization, + &this.project, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::DeliveryViewData>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::DeliveryViewData>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod processconfiguration { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get process configuration"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get process configuration"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ProcessConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::ProcessConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/_apis/work/processconfiguration", - this.client.endpoint(), - &this.organization, - &this.project - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ProcessConfiguration>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ProcessConfiguration>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ProcessConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::ProcessConfiguration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/_apis/work/processconfiguration", + this.client.endpoint(), + &this.organization, + &this.project + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ProcessConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ProcessConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod backlogconfiguration { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets backlog configuration for a team"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets backlog configuration for a team"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - team: team.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BacklogConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::BacklogConfiguration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/backlogconfiguration", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BacklogConfiguration>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BacklogConfiguration>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BacklogConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::BacklogConfiguration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/backlogconfiguration", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BacklogConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BacklogConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod backlogs { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all backlog levels"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn get_backlog_level_work_items( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + backlog_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + #[doc = "* `id`: The id of the backlog level"] + pub fn get_backlog( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + id: impl Into<String>, + ) -> get_backlog::RequestBuilder { + get_backlog::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + id: id.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List all backlog levels"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn get_backlog_level_work_items( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - backlog_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - #[doc = "* `id`: The id of the backlog level"] - pub fn get_backlog( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - id: impl Into<String>, - ) -> get_backlog::RequestBuilder { - get_backlog::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - team: team.into(), - id: id.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::BacklogLevelConfigurationList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BacklogLevelConfigurationList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/backlogs", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BacklogLevelConfigurationList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BacklogLevelConfigurationList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_backlog_level_work_items { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BacklogLevelWorkItems> { - let bytes = self.0.into_body().collect().await?; - let body: models::BacklogLevelWorkItems = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) backlog_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/backlogs/{}/workItems", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.backlog_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BacklogLevelWorkItems>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BacklogLevelWorkItems>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_backlog { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BacklogLevelConfiguration> { - let bytes = self.0.into_body().collect().await?; - let body: models::BacklogLevelConfiguration = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/backlogs/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BacklogLevelConfiguration>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BacklogLevelConfiguration>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BacklogLevelConfigurationList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BacklogLevelConfigurationList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/backlogs", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BacklogLevelConfigurationList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::BacklogLevelConfigurationList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_backlog_level_work_items { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BacklogLevelWorkItems> { + let bytes = self.0.into_body().collect().await?; + let body: models::BacklogLevelWorkItems = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) backlog_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/backlogs/{}/workItems", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.backlog_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BacklogLevelWorkItems>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BacklogLevelWorkItems>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_backlog { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BacklogLevelConfiguration> { + let bytes = self.0.into_body().collect().await?; + let body: models::BacklogLevelConfiguration = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/backlogs/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BacklogLevelConfiguration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BacklogLevelConfiguration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod boards { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get boards"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Get board"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `id`: identifier for board, either board's backlog level name (Eg:\"Stories\") or Id"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: options to updated"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `id`: identifier for board, either category plural name (Eg:\"Stories\") or guid"] + #[doc = "* `team`: Team ID or team name"] + pub fn set_board_options( + &self, + organization: impl Into<String>, + body: impl Into<serde_json::Value>, + project: impl Into<String>, + id: impl Into<String>, + team: impl Into<String>, + ) -> 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get boards"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - team: team.into(), - } - } - #[doc = "Get board"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `id`: identifier for board, either board's backlog level name (Eg:\"Stories\") or Id"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: options to updated"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `id`: identifier for board, either category plural name (Eg:\"Stories\") or guid"] - #[doc = "* `team`: Team ID or team name"] - pub fn set_board_options( - &self, - organization: impl Into<String>, - body: impl Into<serde_json::Value>, - project: impl Into<String>, - id: impl Into<String>, - team: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardReferenceList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardReferenceList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardReferenceList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BoardReferenceList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::Board> { - let bytes = self.0.into_body().collect().await?; - let body: models::Board = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::Board>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::Board>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod set_board_options { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<serde_json::Value> { - let bytes = self.0.into_body().collect().await?; - let body: serde_json::Value = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: serde_json::Value, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<serde_json::Value>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<serde_json::Value>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardReferenceList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardReferenceList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardReferenceList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardReferenceList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::Board> { + let bytes = self.0.into_body().collect().await?; + let body: models::Board = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::Board>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::Board>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod set_board_options { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<serde_json::Value> { + let bytes = self.0.into_body().collect().await?; + let body: serde_json::Value = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: serde_json::Value, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<serde_json::Value>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<serde_json::Value>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod boardusersettings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get board user settings for a board id"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `board`: Board ID or Name"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + board: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<serde_json::Value>, + project: impl Into<String>, + board: impl Into<String>, + team: impl Into<String>, + ) -> 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 get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get board user settings for a board id"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `board`: Board ID or Name"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - board: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<serde_json::Value>, - project: impl Into<String>, - board: impl Into<String>, - team: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardUserSettings> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardUserSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/boardusersettings", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardUserSettings>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BoardUserSettings>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardUserSettings> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardUserSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: serde_json::Value, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/boardusersettings", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardUserSettings>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BoardUserSettings>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardUserSettings> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardUserSettings = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/boardusersettings", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardUserSettings>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardUserSettings>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardUserSettings> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardUserSettings = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: serde_json::Value, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/boardusersettings", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardUserSettings>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardUserSettings>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod cardrulesettings { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + board: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn update_board_card_rule_settings( + &self, + organization: impl Into<String>, + body: impl Into<models::BoardCardRuleSettings>, + project: impl Into<String>, + board: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn update_taskboard_card_rule_settings( + &self, + organization: impl Into<String>, + body: impl Into<models::BoardCardRuleSettings>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 get { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - board: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn update_board_card_rule_settings( - &self, - organization: impl Into<String>, - body: impl Into<models::BoardCardRuleSettings>, - project: impl Into<String>, - board: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn update_taskboard_card_rule_settings( - &self, - organization: impl Into<String>, - body: impl Into<models::BoardCardRuleSettings>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardCardRuleSettings> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardCardRuleSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/cardrulesettings", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardCardRuleSettings>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BoardCardRuleSettings>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_board_card_rule_settings { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardCardRuleSettings> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardCardRuleSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::BoardCardRuleSettings, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/cardrulesettings", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardCardRuleSettings>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BoardCardRuleSettings>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_taskboard_card_rule_settings { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::BoardCardRuleSettings, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/taskboard/cardrulesettings", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardCardRuleSettings> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardCardRuleSettings = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/cardrulesettings", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardCardRuleSettings>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardCardRuleSettings>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_board_card_rule_settings { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardCardRuleSettings> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardCardRuleSettings = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::BoardCardRuleSettings, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/cardrulesettings", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardCardRuleSettings>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardCardRuleSettings>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_taskboard_card_rule_settings { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::BoardCardRuleSettings, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/taskboard/cardrulesettings", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod cardsettings { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + board: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn update_board_card_settings( + &self, + organization: impl Into<String>, + body: impl Into<models::BoardCardSettings>, + project: impl Into<String>, + board: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn update_taskboard_card_settings( + &self, + organization: impl Into<String>, + body: impl Into<models::BoardCardSettings>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 get { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - board: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn update_board_card_settings( - &self, - organization: impl Into<String>, - body: impl Into<models::BoardCardSettings>, - project: impl Into<String>, - board: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn update_taskboard_card_settings( - &self, - organization: impl Into<String>, - body: impl Into<models::BoardCardSettings>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardCardSettings> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardCardSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/cardsettings", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardCardSettings>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BoardCardSettings>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_board_card_settings { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardCardSettings> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardCardSettings = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::BoardCardSettings, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/cardsettings", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardCardSettings>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BoardCardSettings>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update_taskboard_card_settings { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::BoardCardSettings, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/taskboard/cardsettings", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardCardSettings> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardCardSettings = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/cardsettings", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardCardSettings>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardCardSettings>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_board_card_settings { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardCardSettings> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardCardSettings = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::BoardCardSettings, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/cardsettings", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardCardSettings>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardCardSettings>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_taskboard_card_settings { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::BoardCardSettings, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/taskboard/cardsettings", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } } pub mod chartimages { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a board chart image."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + #[doc = "* `board`: Identifier for board, either board's backlog level name (e.g. \"Issues\") or Id."] + #[doc = "* `name`: The chart name. e.g. CumulativeFlow."] + pub fn get_board_chart_image( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + board: impl Into<String>, + name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + #[doc = "* `iteration_id`: ID of the iteration."] + #[doc = "* `name`: The chart name. e.g. Burndown."] + pub fn get_iteration_chart_image( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + iteration_id: impl Into<String>, + name: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + #[doc = "* `name`: The chart name. e.g. Velocity."] + pub fn get_iterations_chart_image( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + name: impl Into<String>, + ) -> 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 get_board_chart_image { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a board chart image."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - #[doc = "* `board`: Identifier for board, either board's backlog level name (e.g. \"Issues\") or Id."] - #[doc = "* `name`: The chart name. e.g. CumulativeFlow."] - pub fn get_board_chart_image( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - board: impl Into<String>, - name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - #[doc = "* `iteration_id`: ID of the iteration."] - #[doc = "* `name`: The chart name. e.g. Burndown."] - pub fn get_iteration_chart_image( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - iteration_id: impl Into<String>, - name: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - #[doc = "* `name`: The chart name. e.g. Velocity."] - pub fn get_iterations_chart_image( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - name: impl Into<String>, - ) -> 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 get_board_chart_image { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) board: String, - pub(crate) name: String, - pub(crate) width: Option<i32>, - pub(crate) height: Option<i32>, - pub(crate) show_details: Option<bool>, - pub(crate) title: Option<String>, - } - 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); - self - } - #[doc = "The height of the chart in pixels. Must be greater than 0."] - pub fn height(mut self, height: i32) -> Self { - self.height = Some(height); - self - } - #[doc = "Whether or not the chart should include detailed information (e.g. axis labels, titles, trend lines, etc.)."] - pub fn show_details(mut self, show_details: bool) -> Self { - self.show_details = Some(show_details); - self - } - #[doc = "The title of the chart. Can only be displayed if ShowLabels is true."] - pub fn title(mut self, title: impl Into<String>) -> Self { - self.title = Some(title.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/chartimages/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board, - &this.name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_iteration_chart_image { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) iteration_id: String, - pub(crate) name: String, - pub(crate) width: Option<i32>, - pub(crate) height: Option<i32>, - pub(crate) show_details: Option<bool>, - pub(crate) title: Option<String>, - } - 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); - self - } - #[doc = "The height of the chart in pixels. Must be greater than 0."] - pub fn height(mut self, height: i32) -> Self { - self.height = Some(height); - self - } - #[doc = "Whether or not the chart should include detailed information (e.g. axis labels, titles, trend lines, etc.)"] - pub fn show_details(mut self, show_details: bool) -> Self { - self.show_details = Some(show_details); - self - } - #[doc = "The title of the chart. Can only be displayed if ShowLabels is true."] - pub fn title(mut self, title: impl Into<String>) -> Self { - self.title = Some(title.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/iterations/{}/chartimages/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.iteration_id, - &this.name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_iterations_chart_image { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<String> { - let bytes = self.0.into_body().collect().await?; - let body: String = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) name: String, - pub(crate) iterations_number: Option<i32>, - pub(crate) width: Option<i32>, - pub(crate) height: Option<i32>, - pub(crate) show_details: Option<bool>, - pub(crate) title: Option<String>, - } - 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); - self - } - #[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); - self - } - #[doc = "The height of the chart in pixels. Must be greater than 0."] - pub fn height(mut self, height: i32) -> Self { - self.height = Some(height); - self - } - #[doc = "Whether or not the chart should include detailed information (e.g. axis labels, titles, trend lines, etc.)"] - pub fn show_details(mut self, show_details: bool) -> Self { - self.show_details = Some(show_details); - self - } - #[doc = "The title of the chart. Can only be displayed if ShowLabels is true."] - pub fn title(mut self, title: impl Into<String>) -> Self { - self.title = Some(title.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/iterations/chartimages/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<String>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) board: String, + pub(crate) name: String, + pub(crate) width: Option<i32>, + pub(crate) height: Option<i32>, + pub(crate) show_details: Option<bool>, + pub(crate) title: Option<String>, + } + 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); + self + } + #[doc = "The height of the chart in pixels. Must be greater than 0."] + pub fn height(mut self, height: i32) -> Self { + self.height = Some(height); + self + } + #[doc = "Whether or not the chart should include detailed information (e.g. axis labels, titles, trend lines, etc.)."] + pub fn show_details(mut self, show_details: bool) -> Self { + self.show_details = Some(show_details); + self + } + #[doc = "The title of the chart. Can only be displayed if ShowLabels is true."] + pub fn title(mut self, title: impl Into<String>) -> Self { + self.title = Some(title.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/chartimages/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_iteration_chart_image { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) iteration_id: String, + pub(crate) name: String, + pub(crate) width: Option<i32>, + pub(crate) height: Option<i32>, + pub(crate) show_details: Option<bool>, + pub(crate) title: Option<String>, + } + 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); + self + } + #[doc = "The height of the chart in pixels. Must be greater than 0."] + pub fn height(mut self, height: i32) -> Self { + self.height = Some(height); + self + } + #[doc = "Whether or not the chart should include detailed information (e.g. axis labels, titles, trend lines, etc.)"] + pub fn show_details(mut self, show_details: bool) -> Self { + self.show_details = Some(show_details); + self + } + #[doc = "The title of the chart. Can only be displayed if ShowLabels is true."] + pub fn title(mut self, title: impl Into<String>) -> Self { + self.title = Some(title.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/iterations/{}/chartimages/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.iteration_id, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_iterations_chart_image { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<String> { + let bytes = self.0.into_body().collect().await?; + let body: String = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) name: String, + pub(crate) iterations_number: Option<i32>, + pub(crate) width: Option<i32>, + pub(crate) height: Option<i32>, + pub(crate) show_details: Option<bool>, + pub(crate) title: Option<String>, + } + 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); + self + } + #[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); + self + } + #[doc = "The height of the chart in pixels. Must be greater than 0."] + pub fn height(mut self, height: i32) -> Self { + self.height = Some(height); + self + } + #[doc = "Whether or not the chart should include detailed information (e.g. axis labels, titles, trend lines, etc.)"] + pub fn show_details(mut self, show_details: bool) -> Self { + self.show_details = Some(show_details); + self + } + #[doc = "The title of the chart. Can only be displayed if ShowLabels is true."] + pub fn title(mut self, title: impl Into<String>) -> Self { + self.title = Some(title.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/iterations/chartimages/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<String>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } pub mod charts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get board charts"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `board`: Identifier for board, either board's backlog level name (Eg:\"Stories\") or Id"] + #[doc = "* `team`: Team ID or team name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + board: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `board`: Identifier for board, either board's backlog level name (Eg:\"Stories\") or Id"] + #[doc = "* `name`: The chart name"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + board: impl Into<String>, + name: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `board`: Identifier for board, either board's backlog level name (Eg:\"Stories\") or Id"] + #[doc = "* `name`: The chart name"] + #[doc = "* `team`: Team ID or team name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::BoardChart>, + project: impl Into<String>, + board: impl Into<String>, + name: impl Into<String>, + team: impl Into<String>, + ) -> 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get board charts"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `board`: Identifier for board, either board's backlog level name (Eg:\"Stories\") or Id"] - #[doc = "* `team`: Team ID or team name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - board: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `board`: Identifier for board, either board's backlog level name (Eg:\"Stories\") or Id"] - #[doc = "* `name`: The chart name"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - board: impl Into<String>, - name: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `board`: Identifier for board, either board's backlog level name (Eg:\"Stories\") or Id"] - #[doc = "* `name`: The chart name"] - #[doc = "* `team`: Team ID or team name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::BoardChart>, - project: impl Into<String>, - board: impl Into<String>, - name: impl Into<String>, - team: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardChartReferenceList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardChartReferenceList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/charts", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardChartReferenceList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::BoardChartReferenceList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardChart> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardChart = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) board: String, - pub(crate) name: 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()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/charts/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board, - &this.name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardChart>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BoardChart>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardChart> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardChart = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::BoardChart, - pub(crate) project: String, - pub(crate) board: String, - pub(crate) name: 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()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/charts/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board, - &this.name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardChart>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BoardChart>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardChartReferenceList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardChartReferenceList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/charts", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardChartReferenceList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardChartReferenceList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardChart> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardChart = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) board: String, + pub(crate) name: 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()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/charts/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardChart>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::BoardChart>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardChart> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardChart = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::BoardChart, + pub(crate) project: String, + pub(crate) board: String, + pub(crate) name: 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()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/charts/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardChart>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<models::BoardChart>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod columns { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get columns on a board"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `board`: Name or ID of the specific board"] + #[doc = "* `team`: Team ID or team name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + board: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: List of board columns to update"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `board`: Name or ID of the specific board"] + #[doc = "* `team`: Team ID or team name"] + pub fn update( + &self, + organization: impl Into<String>, + body: Vec<models::BoardColumn>, + project: impl Into<String>, + board: impl Into<String>, + team: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + board: board.into(), + team: team.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get columns on a board"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `board`: Name or ID of the specific board"] - #[doc = "* `team`: Team ID or team name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - board: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: List of board columns to update"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `board`: Name or ID of the specific board"] - #[doc = "* `team`: Team ID or team name"] - pub fn update( - &self, - organization: impl Into<String>, - body: Vec<models::BoardColumn>, - project: impl Into<String>, - board: impl Into<String>, - team: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body, - project: project.into(), - board: board.into(), - team: team.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardColumnList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardColumnList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/columns", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardColumnList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BoardColumnList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardColumnList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardColumnList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::BoardColumn>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/columns", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardColumnList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BoardColumnList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardColumnList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardColumnList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/columns", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardColumnList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardColumnList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardColumnList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardColumnList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::BoardColumn>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/columns", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardColumnList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardColumnList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod rows { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get rows on a board"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `board`: Name or ID of the specific board"] + #[doc = "* `team`: Team ID or team name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + board: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: List of board rows to update"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `board`: Name or ID of the specific board"] + #[doc = "* `team`: Team ID or team name"] + pub fn update( + &self, + organization: impl Into<String>, + body: Vec<models::BoardRow>, + project: impl Into<String>, + board: impl Into<String>, + team: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + board: board.into(), + team: team.into(), + } + } + } + pub mod list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get rows on a board"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `board`: Name or ID of the specific board"] - #[doc = "* `team`: Team ID or team name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - board: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: List of board rows to update"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `board`: Name or ID of the specific board"] - #[doc = "* `team`: Team ID or team name"] - pub fn update( - &self, - organization: impl Into<String>, - body: Vec<models::BoardRow>, - project: impl Into<String>, - board: impl Into<String>, - team: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body, - project: project.into(), - board: board.into(), - team: team.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardRowList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardRowList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/rows", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardRowList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BoardRowList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::BoardRowList> { - let bytes = self.0.into_body().collect().await?; - let body: models::BoardRowList = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::BoardRow>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/rows", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.board - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::BoardRowList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::BoardRowList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardRowList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardRowList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/rows", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardRowList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardRowList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::BoardRowList> { + let bytes = self.0.into_body().collect().await?; + let body: models::BoardRowList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::BoardRow>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/rows", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.board + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::BoardRowList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::BoardRowList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod boardparents { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + child_backlog_context_category_ref_name: impl Into<String>, + workitem_ids: impl Into<String>, + team: impl Into<String>, + ) -> 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 list { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - child_backlog_context_category_ref_name: impl Into<String>, - workitem_ids: impl Into<String>, - team: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ParentChildWiMapList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ParentChildWiMapList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/boardparents", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - 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::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ParentChildWiMapList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::ParentChildWiMapList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ParentChildWiMapList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ParentChildWiMapList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/boardparents", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + 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::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ParentChildWiMapList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ParentChildWiMapList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod workitemsorder { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Reorder Sprint Backlog/Taskboard Work Items"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + #[doc = "* `iteration_id`: The id of the iteration"] + pub fn reorder_iteration_work_items( + &self, + organization: impl Into<String>, + body: impl Into<models::ReorderOperation>, + project: impl Into<String>, + team: impl Into<String>, + iteration_id: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn reorder_backlog_work_items( + &self, + organization: impl Into<String>, + body: impl Into<models::ReorderOperation>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 reorder_iteration_work_items { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Reorder Sprint Backlog/Taskboard Work Items"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - #[doc = "* `iteration_id`: The id of the iteration"] - pub fn reorder_iteration_work_items( - &self, - organization: impl Into<String>, - body: impl Into<models::ReorderOperation>, - project: impl Into<String>, - team: impl Into<String>, - iteration_id: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn reorder_backlog_work_items( - &self, - organization: impl Into<String>, - body: impl Into<models::ReorderOperation>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 reorder_iteration_work_items { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReorderResultList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReorderResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ReorderOperation, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) iteration_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/iterations/{}/workitemsorder", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.iteration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReorderResultList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ReorderResultList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod reorder_backlog_work_items { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::ReorderResultList> { - let bytes = self.0.into_body().collect().await?; - let body: models::ReorderResultList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::ReorderOperation, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/workitemsorder", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::ReorderResultList>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::ReorderResultList>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReorderResultList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReorderResultList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ReorderOperation, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) iteration_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/iterations/{}/workitemsorder", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReorderResultList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReorderResultList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod reorder_backlog_work_items { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::ReorderResultList> { + let bytes = self.0.into_body().collect().await?; + let body: models::ReorderResultList = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::ReorderOperation, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/workitemsorder", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::ReorderResultList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::ReorderResultList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod taskboard_columns { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn update( + &self, + organization: impl Into<String>, + body: Vec<models::UpdateTaskboardColumn>, + project: impl Into<String>, + team: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + team: team.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - team: team.into(), - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn update( - &self, - organization: impl Into<String>, - body: Vec<models::UpdateTaskboardColumn>, - project: impl Into<String>, - team: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body, - project: project.into(), - team: team.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskboardColumns> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskboardColumns = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/taskboardcolumns", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskboardColumns>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskboardColumns>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TaskboardColumns> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskboardColumns = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::UpdateTaskboardColumn>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/taskboardcolumns", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskboardColumns>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TaskboardColumns>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskboardColumns> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskboardColumns = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/taskboardcolumns", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskboardColumns>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskboardColumns>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskboardColumns> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskboardColumns = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::UpdateTaskboardColumn>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/taskboardcolumns", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskboardColumns>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TaskboardColumns>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod taskboard_work_items { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + iteration_id: impl Into<String>, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + iteration_id: iteration_id.into(), + } + } + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::UpdateTaskboardWorkItemColumn>, + project: impl Into<String>, + team: impl Into<String>, + iteration_id: impl Into<String>, + 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - iteration_id: impl Into<String>, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - team: team.into(), - iteration_id: iteration_id.into(), - } - } - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::UpdateTaskboardWorkItemColumn>, - project: impl Into<String>, - team: impl Into<String>, - iteration_id: impl Into<String>, - 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TaskboardWorkItemColumnList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TaskboardWorkItemColumnList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) iteration_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/taskboardworkitems/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.iteration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TaskboardWorkItemColumnList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TaskboardWorkItemColumnList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::UpdateTaskboardWorkItemColumn, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) iteration_id: String, - pub(crate) work_item_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/taskboardworkitems/{}/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.iteration_id, - &this.work_item_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TaskboardWorkItemColumnList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TaskboardWorkItemColumnList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) iteration_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/taskboardworkitems/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TaskboardWorkItemColumnList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::TaskboardWorkItemColumnList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::UpdateTaskboardWorkItemColumn, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) iteration_id: String, + pub(crate) work_item_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/taskboardworkitems/{}/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.iteration_id, + &this.work_item_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } } + } } pub mod teamsettings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a team's settings"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: TeamSettings changes"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TeamSettingsPatch>, + project: impl Into<String>, + team: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a team's settings"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: TeamSettings changes"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TeamSettingsPatch>, - project: impl Into<String>, - team: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - team: team.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamSetting> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSetting = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamSetting>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TeamSetting>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamSetting> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSetting = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TeamSettingsPatch, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamSetting>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TeamSetting>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamSetting> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamSetting = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamSetting>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamSetting>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamSetting> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamSetting = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TeamSettingsPatch, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamSetting>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamSetting>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod iterations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a team's iterations using timeframe filter"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn list( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Iteration to add"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn post_team_iteration( + &self, + organization: impl Into<String>, + body: impl Into<models::TeamSettingsIteration>, + project: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `id`: ID of the iteration"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `id`: ID of the iteration"] + #[doc = "* `team`: Team ID or team name"] + pub fn delete( + &self, + organization: impl Into<String>, + project: impl Into<String>, + id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `iteration_id`: ID of the iteration"] + #[doc = "* `team`: Team ID or team name"] + pub fn get_iteration_work_items( + &self, + organization: impl Into<String>, + project: impl Into<String>, + iteration_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 list { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a team's iterations using timeframe filter"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn list( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Iteration to add"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn post_team_iteration( - &self, - organization: impl Into<String>, - body: impl Into<models::TeamSettingsIteration>, - project: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `id`: ID of the iteration"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `id`: ID of the iteration"] - #[doc = "* `team`: Team ID or team name"] - pub fn delete( - &self, - organization: impl Into<String>, - project: impl Into<String>, - id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `iteration_id`: ID of the iteration"] - #[doc = "* `team`: Team ID or team name"] - pub fn get_iteration_work_items( - &self, - organization: impl Into<String>, - project: impl Into<String>, - iteration_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamSettingsIterationList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSettingsIterationList = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) project: String, - pub(crate) team: String, - pub(crate) timeframe: Option<String>, - } - 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<String>) -> Self { - self.timeframe = Some(timeframe.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - if let Some(timeframe) = &this.timeframe { - req.url_mut() - .query_pairs_mut() - .append_pair("$timeframe", timeframe); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamSettingsIterationList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TeamSettingsIterationList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod post_team_iteration { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamSettingsIteration> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSettingsIteration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TeamSettingsIteration, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamSettingsIteration>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TeamSettingsIteration>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamSettingsIteration> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSettingsIteration = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamSettingsIteration>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TeamSettingsIteration>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<()>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let _rsp = self.send().await?; - Ok(()) - }) - } - } - } - pub mod get_iteration_work_items { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::IterationWorkItems> { - let bytes = self.0.into_body().collect().await?; - let body: models::IterationWorkItems = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/workitems", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.iteration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::IterationWorkItems>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::IterationWorkItems>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamSettingsIterationList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamSettingsIterationList = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) project: String, + pub(crate) team: String, + pub(crate) timeframe: Option<String>, + } + 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<String>) -> Self { + self.timeframe = Some(timeframe.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + if let Some(timeframe) = &this.timeframe { + req + .url_mut() + .query_pairs_mut() + .append_pair("$timeframe", timeframe); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamSettingsIterationList>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamSettingsIterationList>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod post_team_iteration { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamSettingsIteration> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamSettingsIteration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TeamSettingsIteration, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamSettingsIteration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamSettingsIteration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamSettingsIteration> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamSettingsIteration = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamSettingsIteration>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamSettingsIteration>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<()>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<()>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let _rsp = self.send().await?; + Ok(()) + }) + } + } + } + pub mod get_iteration_work_items { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::IterationWorkItems> { + let bytes = self.0.into_body().collect().await?; + let body: models::IterationWorkItems = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/workitems", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::IterationWorkItems>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::IterationWorkItems>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod capacities { + use 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `iteration_id`: ID of the iteration"] + #[doc = "* `team`: Team ID or team name"] + pub fn get_capacities_with_identity_ref_and_totals( + &self, + organization: impl Into<String>, + project: impl Into<String>, + iteration_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Team capacity to replace"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `iteration_id`: ID of the iteration"] + #[doc = "* `team`: Team ID or team name"] + pub fn replace_capacities_with_identity_ref( + &self, + organization: impl Into<String>, + body: Vec<models::TeamMemberCapacityIdentityRef>, + project: impl Into<String>, + iteration_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `iteration_id`: ID of the iteration"] + #[doc = "* `team_member_id`: ID of the team member"] + #[doc = "* `team`: Team ID or team name"] + pub fn get_capacity_with_identity_ref( + &self, + organization: impl Into<String>, + project: impl Into<String>, + iteration_id: impl Into<String>, + team_member_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Updated capacity"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `iteration_id`: ID of the iteration"] + #[doc = "* `team_member_id`: ID of the team member"] + #[doc = "* `team`: Team ID or team name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::CapacityPatch>, + project: impl Into<String>, + iteration_id: impl Into<String>, + team_member_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 get_capacities_with_identity_ref_and_totals { use 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `iteration_id`: ID of the iteration"] - #[doc = "* `team`: Team ID or team name"] - pub fn get_capacities_with_identity_ref_and_totals( - &self, - organization: impl Into<String>, - project: impl Into<String>, - iteration_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Team capacity to replace"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `iteration_id`: ID of the iteration"] - #[doc = "* `team`: Team ID or team name"] - pub fn replace_capacities_with_identity_ref( - &self, - organization: impl Into<String>, - body: Vec<models::TeamMemberCapacityIdentityRef>, - project: impl Into<String>, - iteration_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `iteration_id`: ID of the iteration"] - #[doc = "* `team_member_id`: ID of the team member"] - #[doc = "* `team`: Team ID or team name"] - pub fn get_capacity_with_identity_ref( - &self, - organization: impl Into<String>, - project: impl Into<String>, - iteration_id: impl Into<String>, - team_member_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Updated capacity"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `iteration_id`: ID of the iteration"] - #[doc = "* `team_member_id`: ID of the team member"] - #[doc = "* `team`: Team ID or team name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::CapacityPatch>, - project: impl Into<String>, - iteration_id: impl Into<String>, - team_member_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 get_capacities_with_identity_ref_and_totals { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamCapacity> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamCapacity = serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.iteration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamCapacity>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TeamCapacity>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod replace_capacities_with_identity_ref { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TeamMemberCapacityIdentityRefList> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamMemberCapacityIdentityRefList = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: Vec<models::TeamMemberCapacityIdentityRef>, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.iteration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamMemberCapacityIdentityRefList>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TeamMemberCapacityIdentityRefList>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_capacity_with_identity_ref { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TeamMemberCapacityIdentityRef> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamMemberCapacityIdentityRef = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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 { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.iteration_id, - &this.team_member_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamMemberCapacityIdentityRef>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TeamMemberCapacityIdentityRef>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body( - self, - ) -> azure_core::Result<models::TeamMemberCapacityIdentityRef> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamMemberCapacityIdentityRef = serde_json::from_slice(&bytes) - .map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::CapacityPatch, - pub(crate) project: String, - pub(crate) iteration_id: String, - pub(crate) team_member_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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities/{}", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.iteration_id, - &this.team_member_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamMemberCapacityIdentityRef>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TeamMemberCapacityIdentityRef>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamCapacity> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamCapacity = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamCapacity>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamCapacity>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod replace_capacities_with_identity_ref { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body( + self, + ) -> azure_core::Result<models::TeamMemberCapacityIdentityRefList> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamMemberCapacityIdentityRefList = serde_json::from_slice(&bytes) + .map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: Vec<models::TeamMemberCapacityIdentityRef>, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamMemberCapacityIdentityRefList>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::TeamMemberCapacityIdentityRefList>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_capacity_with_identity_ref { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamMemberCapacityIdentityRef> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamMemberCapacityIdentityRef = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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 { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.iteration_id, + &this.team_member_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamMemberCapacityIdentityRef>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::TeamMemberCapacityIdentityRef>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamMemberCapacityIdentityRef> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamMemberCapacityIdentityRef = + serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::CapacityPatch, + pub(crate) project: String, + pub(crate) iteration_id: String, + pub(crate) team_member_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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities/{}", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.iteration_id, + &this.team_member_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamMemberCapacityIdentityRef>; + type IntoFuture = futures::future::BoxFuture< + 'static, + azure_core::Result<models::TeamMemberCapacityIdentityRef>, + >; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod teamdaysoff { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get team's days off for an iteration"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `iteration_id`: ID of the iteration"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + iteration_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `body`: Team's days off patch containing a list of start and end dates"] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `iteration_id`: ID of the iteration"] + #[doc = "* `team`: Team ID or team name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TeamSettingsDaysOffPatch>, + project: impl Into<String>, + iteration_id: impl Into<String>, + team: impl Into<String>, + ) -> 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 get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get team's days off for an iteration"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `iteration_id`: ID of the iteration"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - iteration_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `body`: Team's days off patch containing a list of start and end dates"] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `iteration_id`: ID of the iteration"] - #[doc = "* `team`: Team ID or team name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TeamSettingsDaysOffPatch>, - project: impl Into<String>, - iteration_id: impl Into<String>, - team: impl Into<String>, - ) -> 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 get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamSettingsDaysOff> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSettingsDaysOff = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/teamdaysoff", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.iteration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamSettingsDaysOff>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TeamSettingsDaysOff>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamSettingsDaysOff> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamSettingsDaysOff = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TeamSettingsDaysOffPatch, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/teamdaysoff", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team, - &this.iteration_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamSettingsDaysOff>; - type IntoFuture = futures::future::BoxFuture< - 'static, - azure_core::Result<models::TeamSettingsDaysOff>, - >; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamSettingsDaysOff> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamSettingsDaysOff = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/teamdaysoff", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamSettingsDaysOff>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamSettingsDaysOff>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamSettingsDaysOff> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamSettingsDaysOff = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TeamSettingsDaysOffPatch, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/teamdaysoff", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team, + &this.iteration_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamSettingsDaysOff>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamSettingsDaysOff>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } } pub mod teamfieldvalues { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a collection of team field values"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn get( + &self, + organization: impl Into<String>, + project: impl Into<String>, + team: impl Into<String>, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Update team field values"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `organization`: The name of the Azure DevOps organization."] + #[doc = "* `project`: Project ID or project name"] + #[doc = "* `team`: Team ID or team name"] + pub fn update( + &self, + organization: impl Into<String>, + body: impl Into<models::TeamFieldValuesPatch>, + project: impl Into<String>, + team: impl Into<String>, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + } + pub mod get { use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a collection of team field values"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn get( - &self, - organization: impl Into<String>, - project: impl Into<String>, - team: impl Into<String>, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - project: project.into(), - team: team.into(), - } - } - #[doc = "Update team field values"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `organization`: The name of the Azure DevOps organization."] - #[doc = "* `project`: Project ID or project name"] - #[doc = "* `team`: Team ID or team name"] - pub fn update( - &self, - organization: impl Into<String>, - body: impl Into<models::TeamFieldValuesPatch>, - project: impl Into<String>, - team: impl Into<String>, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - organization: organization.into(), - body: body.into(), - project: project.into(), - team: team.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamFieldValues> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamFieldValues = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/teamfieldvalues", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamFieldValues>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TeamFieldValues>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result<models::TeamFieldValues> { - let bytes = self.0.into_body().collect().await?; - let body: models::TeamFieldValues = - serde_json::from_slice(&bytes).map_err(|e| { - azure_core::error::Error::full( - azure_core::error::ErrorKind::DataConversion, - e, - format!( - "Failed to deserialize response:\n{}", - String::from_utf8_lossy(&bytes) - ), - ) - })?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From<Response> for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef<azure_core::Response> for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) organization: String, - pub(crate) body: models::TeamFieldValuesPatch, - 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."] - #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/teamfieldvalues", - this.client.endpoint(), - &this.organization, - &this.project, - &this.team - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes) - .await? - { - req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); - } - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "7.1-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result<models::TeamFieldValues>; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result<models::TeamFieldValues>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamFieldValues> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamFieldValues = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/teamfieldvalues", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamFieldValues>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamFieldValues>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result<models::TeamFieldValues> { + let bytes = self.0.into_body().collect().await?; + let body: models::TeamFieldValues = serde_json::from_slice(&bytes).map_err(|e| { + azure_core::error::Error::full( + azure_core::error::ErrorKind::DataConversion, + e, + format!( + "Failed to deserialize response:\n{}", + String::from_utf8_lossy(&bytes) + ), + ) + })?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From<Response> for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef<azure_core::Response> for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) organization: String, + pub(crate) body: models::TeamFieldValuesPatch, + 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."] + #[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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/teamfieldvalues", + this.client.endpoint(), + &this.organization, + &this.project, + &this.team + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes) + .await? + { + req.insert_header(azure_core::headers::AUTHORIZATION, auth_header); + } + req + .url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "6.1-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result<models::TeamFieldValues>; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result<models::TeamFieldValues>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } + } } diff --git a/azure_devops_rust_api/src/work/models.rs b/azure_devops_rust_api/src/work/models.rs index b557faa5..8c3257e4 100644 --- a/azure_devops_rust_api/src/work/models.rs +++ b/azure_devops_rust_api/src/work/models.rs @@ -8,2855 +8,2843 @@ use std::str::FromStr; #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Activity { - #[serde( - rename = "capacityPerDay", - default, - skip_serializing_if = "Option::is_none" - )] - pub capacity_per_day: Option<f32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde( + rename = "capacityPerDay", + default, + skip_serializing_if = "Option::is_none" + )] + pub capacity_per_day: Option<f32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl Activity { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BacklogColumn { - #[doc = "Reference to a field in a work item"] - #[serde( - rename = "columnFieldReference", - default, - skip_serializing_if = "Option::is_none" - )] - pub column_field_reference: Option<WorkItemFieldReference>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub width: Option<i32>, + #[doc = "Reference to a field in a work item"] + #[serde( + rename = "columnFieldReference", + default, + skip_serializing_if = "Option::is_none" + )] + pub column_field_reference: Option<WorkItemFieldReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub width: Option<i32>, } impl BacklogColumn { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BacklogConfiguration { - #[doc = ""] - #[serde( - rename = "backlogFields", - default, - skip_serializing_if = "Option::is_none" - )] - pub backlog_fields: Option<BacklogFields>, - #[doc = "Bugs behavior"] - #[serde( - rename = "bugsBehavior", - default, - skip_serializing_if = "Option::is_none" - )] - pub bugs_behavior: Option<backlog_configuration::BugsBehavior>, - #[doc = "Hidden Backlog"] - #[serde( - rename = "hiddenBacklogs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub hidden_backlogs: Vec<String>, - #[doc = "Is BugsBehavior Configured in the process"] - #[serde( - rename = "isBugsBehaviorConfigured", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_bugs_behavior_configured: Option<bool>, - #[doc = "Portfolio backlog descriptors"] - #[serde( - rename = "portfolioBacklogs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub portfolio_backlogs: Vec<BacklogLevelConfiguration>, - #[doc = ""] - #[serde( - rename = "requirementBacklog", - default, - skip_serializing_if = "Option::is_none" - )] - pub requirement_backlog: Option<BacklogLevelConfiguration>, - #[doc = ""] - #[serde( - rename = "taskBacklog", - default, - skip_serializing_if = "Option::is_none" - )] - pub task_backlog: Option<BacklogLevelConfiguration>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Mapped states for work item types"] - #[serde( - rename = "workItemTypeMappedStates", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_type_mapped_states: Vec<WorkItemTypeStateInfo>, + #[doc = ""] + #[serde( + rename = "backlogFields", + default, + skip_serializing_if = "Option::is_none" + )] + pub backlog_fields: Option<BacklogFields>, + #[doc = "Bugs behavior"] + #[serde( + rename = "bugsBehavior", + default, + skip_serializing_if = "Option::is_none" + )] + pub bugs_behavior: Option<backlog_configuration::BugsBehavior>, + #[doc = "Hidden Backlog"] + #[serde( + rename = "hiddenBacklogs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub hidden_backlogs: Vec<String>, + #[doc = "Is BugsBehavior Configured in the process"] + #[serde( + rename = "isBugsBehaviorConfigured", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_bugs_behavior_configured: Option<bool>, + #[doc = "Portfolio backlog descriptors"] + #[serde( + rename = "portfolioBacklogs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub portfolio_backlogs: Vec<BacklogLevelConfiguration>, + #[doc = ""] + #[serde( + rename = "requirementBacklog", + default, + skip_serializing_if = "Option::is_none" + )] + pub requirement_backlog: Option<BacklogLevelConfiguration>, + #[doc = ""] + #[serde( + rename = "taskBacklog", + default, + skip_serializing_if = "Option::is_none" + )] + pub task_backlog: Option<BacklogLevelConfiguration>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Mapped states for work item types"] + #[serde( + rename = "workItemTypeMappedStates", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_type_mapped_states: Vec<WorkItemTypeStateInfo>, } impl BacklogConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod backlog_configuration { - use super::*; - #[doc = "Bugs behavior"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum BugsBehavior { - #[serde(rename = "off")] - Off, - #[serde(rename = "asRequirements")] - AsRequirements, - #[serde(rename = "asTasks")] - AsTasks, - } + use super::*; + #[doc = "Bugs behavior"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum BugsBehavior { + #[serde(rename = "off")] + Off, + #[serde(rename = "asRequirements")] + AsRequirements, + #[serde(rename = "asTasks")] + AsTasks, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BacklogFields { - #[doc = "Field Type (e.g. Order, Activity) to Field Reference Name map"] - #[serde( - rename = "typeFields", - default, - skip_serializing_if = "Option::is_none" - )] - pub type_fields: Option<serde_json::Value>, + #[doc = "Field Type (e.g. Order, Activity) to Field Reference Name map"] + #[serde( + rename = "typeFields", + default, + skip_serializing_if = "Option::is_none" + )] + pub type_fields: Option<serde_json::Value>, } impl BacklogFields { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contract representing a backlog level"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BacklogLevel { - #[doc = "Reference name of the corresponding WIT category"] - #[serde( - rename = "categoryReferenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub category_reference_name: Option<String>, - #[doc = "Plural name for the backlog level"] - #[serde( - rename = "pluralName", - default, - skip_serializing_if = "Option::is_none" - )] - pub plural_name: Option<String>, - #[doc = "Collection of work item states that are included in the plan. The server will filter to only these work item types."] - #[serde( - rename = "workItemStates", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_states: Vec<String>, - #[doc = "Collection of valid workitem type names for the given backlog level"] - #[serde( - rename = "workItemTypes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_types: Vec<String>, + #[doc = "Reference name of the corresponding WIT category"] + #[serde( + rename = "categoryReferenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub category_reference_name: Option<String>, + #[doc = "Plural name for the backlog level"] + #[serde( + rename = "pluralName", + default, + skip_serializing_if = "Option::is_none" + )] + pub plural_name: Option<String>, + #[doc = "Collection of work item states that are included in the plan. The server will filter to only these work item types."] + #[serde( + rename = "workItemStates", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_states: Vec<String>, + #[doc = "Collection of valid workitem type names for the given backlog level"] + #[serde( + rename = "workItemTypes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_types: Vec<String>, } impl BacklogLevel { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BacklogLevelConfiguration { - #[doc = "List of fields to include in Add Panel"] - #[serde( - rename = "addPanelFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub add_panel_fields: Vec<WorkItemFieldReference>, - #[doc = "Color for the backlog level"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "Default list of columns for the backlog"] - #[serde( - rename = "columnFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub column_fields: Vec<BacklogColumn>, - #[doc = "Reference to a work item type."] - #[serde( - rename = "defaultWorkItemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_work_item_type: Option<WorkItemTypeReference>, - #[doc = "Backlog Id (for Legacy Backlog Level from process config it can be categoryref name)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Indicates whether the backlog level is hidden"] - #[serde(rename = "isHidden", default, skip_serializing_if = "Option::is_none")] - pub is_hidden: Option<bool>, - #[doc = "Backlog Name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Backlog Rank (Taskbacklog is 0)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option<i32>, - #[doc = "The type of this backlog level"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<backlog_level_configuration::Type>, - #[doc = "Max number of work items to show in the given backlog"] - #[serde( - rename = "workItemCountLimit", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_count_limit: Option<i32>, - #[doc = "Work Item types participating in this backlog as known by the project/Process, can be overridden by team settings for bugs"] - #[serde( - rename = "workItemTypes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_types: Vec<WorkItemTypeReference>, + #[doc = "List of fields to include in Add Panel"] + #[serde( + rename = "addPanelFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub add_panel_fields: Vec<WorkItemFieldReference>, + #[doc = "Color for the backlog level"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "Default list of columns for the backlog"] + #[serde( + rename = "columnFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub column_fields: Vec<BacklogColumn>, + #[doc = "Reference to a work item type."] + #[serde( + rename = "defaultWorkItemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_work_item_type: Option<WorkItemTypeReference>, + #[doc = "Backlog Id (for Legacy Backlog Level from process config it can be categoryref name)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Indicates whether the backlog level is hidden"] + #[serde(rename = "isHidden", default, skip_serializing_if = "Option::is_none")] + pub is_hidden: Option<bool>, + #[doc = "Backlog Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Backlog Rank (Taskbacklog is 0)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option<i32>, + #[doc = "The type of this backlog level"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<backlog_level_configuration::Type>, + #[doc = "Max number of work items to show in the given backlog"] + #[serde( + rename = "workItemCountLimit", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_count_limit: Option<i32>, + #[doc = "Work Item types participating in this backlog as known by the project/Process, can be overridden by team settings for bugs"] + #[serde( + rename = "workItemTypes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_types: Vec<WorkItemTypeReference>, } impl BacklogLevelConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod backlog_level_configuration { - use super::*; - #[doc = "The type of this backlog level"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "portfolio")] - Portfolio, - #[serde(rename = "requirement")] - Requirement, - #[serde(rename = "task")] - Task, - } + use super::*; + #[doc = "The type of this backlog level"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "portfolio")] + Portfolio, + #[serde(rename = "requirement")] + Requirement, + #[serde(rename = "task")] + Task, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BacklogLevelConfigurationList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BacklogLevelConfiguration>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BacklogLevelConfiguration>, } impl BacklogLevelConfigurationList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents work items in a backlog level"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BacklogLevelWorkItems { - #[doc = "A list of work items within a backlog level"] - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<WorkItemLink>, + #[doc = "A list of work items within a backlog level"] + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<WorkItemLink>, } impl BacklogLevelWorkItems { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Board { - #[serde(flatten)] - pub board_reference: BoardReference, - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde( - rename = "allowedMappings", - default, - skip_serializing_if = "Option::is_none" - )] - pub allowed_mappings: Option<serde_json::Value>, - #[serde(rename = "canEdit", default, skip_serializing_if = "Option::is_none")] - pub can_edit: Option<bool>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub columns: Vec<BoardColumn>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fields: Option<BoardFields>, - #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] - pub is_valid: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub rows: Vec<BoardRow>, + #[serde(flatten)] + pub board_reference: BoardReference, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde( + rename = "allowedMappings", + default, + skip_serializing_if = "Option::is_none" + )] + pub allowed_mappings: Option<serde_json::Value>, + #[serde(rename = "canEdit", default, skip_serializing_if = "Option::is_none")] + pub can_edit: Option<bool>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub columns: Vec<BoardColumn>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fields: Option<BoardFields>, + #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] + pub is_valid: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub rows: Vec<BoardRow>, } impl Board { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a board badge."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardBadge { - #[doc = "The ID of the board represented by this badge."] - #[serde(rename = "boardId", default, skip_serializing_if = "Option::is_none")] - pub board_id: Option<String>, - #[doc = "A link to the SVG resource."] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, + #[doc = "The ID of the board represented by this badge."] + #[serde(rename = "boardId", default, skip_serializing_if = "Option::is_none")] + pub board_id: Option<String>, + #[doc = "A link to the SVG resource."] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, } impl BoardBadge { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardCardRuleSettings { - #[doc = "The class to represent a collection of REST reference links."] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<ReferenceLinks>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rules: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The class to represent a collection of REST reference links."] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<ReferenceLinks>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rules: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl BoardCardRuleSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardCardSettings { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cards: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cards: Option<serde_json::Value>, } impl BoardCardSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardChart { - #[serde(flatten)] - pub board_chart_reference: BoardChartReference, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The settings for the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option<serde_json::Value>, + #[serde(flatten)] + pub board_chart_reference: BoardChartReference, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The settings for the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub settings: Option<serde_json::Value>, } impl BoardChart { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardChartReference { - #[doc = "Name of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Full http link to the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Full http link to the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl BoardChartReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardChartReferenceList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BoardChartReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BoardChartReference>, } impl BoardChartReferenceList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardColumn { - #[serde( - rename = "columnType", - default, - skip_serializing_if = "Option::is_none" - )] - pub column_type: Option<board_column::ColumnType>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(rename = "isSplit", default, skip_serializing_if = "Option::is_none")] - pub is_split: Option<bool>, - #[serde(rename = "itemLimit", default, skip_serializing_if = "Option::is_none")] - pub item_limit: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[serde( - rename = "stateMappings", - default, - skip_serializing_if = "Option::is_none" - )] - pub state_mappings: Option<serde_json::Value>, + #[serde( + rename = "columnType", + default, + skip_serializing_if = "Option::is_none" + )] + pub column_type: Option<board_column::ColumnType>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(rename = "isSplit", default, skip_serializing_if = "Option::is_none")] + pub is_split: Option<bool>, + #[serde(rename = "itemLimit", default, skip_serializing_if = "Option::is_none")] + pub item_limit: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[serde( + rename = "stateMappings", + default, + skip_serializing_if = "Option::is_none" + )] + pub state_mappings: Option<serde_json::Value>, } impl BoardColumn { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod board_column { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ColumnType { - #[serde(rename = "incoming")] - Incoming, - #[serde(rename = "inProgress")] - InProgress, - #[serde(rename = "outgoing")] - Outgoing, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ColumnType { + #[serde(rename = "incoming")] + Incoming, + #[serde(rename = "inProgress")] + InProgress, + #[serde(rename = "outgoing")] + Outgoing, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardColumnList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BoardColumn>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BoardColumn>, } impl BoardColumnList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardFields { - #[doc = "An abstracted reference to a field"] - #[serde( - rename = "columnField", - default, - skip_serializing_if = "Option::is_none" - )] - pub column_field: Option<FieldReference>, - #[doc = "An abstracted reference to a field"] - #[serde(rename = "doneField", default, skip_serializing_if = "Option::is_none")] - pub done_field: Option<FieldReference>, - #[doc = "An abstracted reference to a field"] - #[serde(rename = "rowField", default, skip_serializing_if = "Option::is_none")] - pub row_field: Option<FieldReference>, + #[doc = "An abstracted reference to a field"] + #[serde( + rename = "columnField", + default, + skip_serializing_if = "Option::is_none" + )] + pub column_field: Option<FieldReference>, + #[doc = "An abstracted reference to a field"] + #[serde(rename = "doneField", default, skip_serializing_if = "Option::is_none")] + pub done_field: Option<FieldReference>, + #[doc = "An abstracted reference to a field"] + #[serde(rename = "rowField", default, skip_serializing_if = "Option::is_none")] + pub row_field: Option<FieldReference>, } impl BoardFields { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardReference { - #[doc = "Id of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Full http link to the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Id of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Full http link to the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl BoardReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardReferenceList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BoardReference>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BoardReference>, } impl BoardReferenceList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardRow { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl BoardRow { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardRowList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BoardRow>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BoardRow>, } impl BoardRowList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardSuggestedValue { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl BoardSuggestedValue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardSuggestedValueList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<BoardSuggestedValue>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<BoardSuggestedValue>, } impl BoardSuggestedValueList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BoardUserSettings { - #[serde( - rename = "autoRefreshState", - default, - skip_serializing_if = "Option::is_none" - )] - pub auto_refresh_state: Option<bool>, + #[serde( + rename = "autoRefreshState", + default, + skip_serializing_if = "Option::is_none" + )] + pub auto_refresh_state: Option<bool>, } impl BoardUserSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CapacityContractBase { - #[serde(flatten)] - pub team_settings_data_contract_base: TeamSettingsDataContractBase, - #[doc = "Collection of capacities associated with the team member"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub activities: Vec<Activity>, - #[doc = "The days off associated with the team member"] - #[serde( - rename = "daysOff", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub days_off: Vec<DateRange>, + #[serde(flatten)] + pub team_settings_data_contract_base: TeamSettingsDataContractBase, + #[doc = "Collection of capacities associated with the team member"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub activities: Vec<Activity>, + #[doc = "The days off associated with the team member"] + #[serde( + rename = "daysOff", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub days_off: Vec<DateRange>, } impl CapacityContractBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Expected data from PATCH"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CapacityPatch { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub activities: Vec<Activity>, - #[serde( - rename = "daysOff", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub days_off: Vec<DateRange>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub activities: Vec<Activity>, + #[serde( + rename = "daysOff", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub days_off: Vec<DateRange>, } impl CapacityPatch { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Card settings, such as fields and rules"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CardFieldSettings { - #[doc = "A collection of field information of additional fields on cards. The index in the collection signifies the order of the field among the additional fields. Currently unused. Should be used with User Story 691539: Card setting: additional fields"] - #[serde( - rename = "additionalFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub additional_fields: Vec<FieldInfo>, - #[doc = "Display format for the assigned to field"] - #[serde( - rename = "assignedToDisplayFormat", - default, - skip_serializing_if = "Option::is_none" - )] - pub assigned_to_display_format: Option<card_field_settings::AssignedToDisplayFormat>, - #[doc = "A collection of field information of rendered core fields on cards."] - #[serde( - rename = "coreFields", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub core_fields: Vec<FieldInfo>, - #[doc = "Flag indicating whether to show assigned to field on cards. When true, AssignedToDisplayFormat will determine how the field will be displayed"] - #[serde( - rename = "showAssignedTo", - default, - skip_serializing_if = "Option::is_none" - )] - pub show_assigned_to: Option<bool>, - #[doc = "Flag indicating whether to show child rollup on cards"] - #[serde( - rename = "showChildRollup", - default, - skip_serializing_if = "Option::is_none" - )] - pub show_child_rollup: Option<bool>, - #[doc = "Flag indicating whether to show empty fields on cards"] - #[serde( - rename = "showEmptyFields", - default, - skip_serializing_if = "Option::is_none" - )] - pub show_empty_fields: Option<bool>, - #[doc = "Flag indicating whether to show ID on cards"] - #[serde(rename = "showId", default, skip_serializing_if = "Option::is_none")] - pub show_id: Option<bool>, - #[doc = "Flag indicating whether to show parent field on cards"] - #[serde( - rename = "showParent", - default, - skip_serializing_if = "Option::is_none" - )] - pub show_parent: Option<bool>, - #[doc = "Flag indicating whether to show state field on cards"] - #[serde(rename = "showState", default, skip_serializing_if = "Option::is_none")] - pub show_state: Option<bool>, - #[doc = "Flag indicating whether to show tags on cards"] - #[serde(rename = "showTags", default, skip_serializing_if = "Option::is_none")] - pub show_tags: Option<bool>, + #[doc = "A collection of field information of additional fields on cards. The index in the collection signifies the order of the field among the additional fields. Currently unused. Should be used with User Story 691539: Card setting: additional fields"] + #[serde( + rename = "additionalFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub additional_fields: Vec<FieldInfo>, + #[doc = "Display format for the assigned to field"] + #[serde( + rename = "assignedToDisplayFormat", + default, + skip_serializing_if = "Option::is_none" + )] + pub assigned_to_display_format: Option<card_field_settings::AssignedToDisplayFormat>, + #[doc = "A collection of field information of rendered core fields on cards."] + #[serde( + rename = "coreFields", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub core_fields: Vec<FieldInfo>, + #[doc = "Flag indicating whether to show assigned to field on cards. When true, AssignedToDisplayFormat will determine how the field will be displayed"] + #[serde( + rename = "showAssignedTo", + default, + skip_serializing_if = "Option::is_none" + )] + pub show_assigned_to: Option<bool>, + #[doc = "Flag indicating whether to show child rollup on cards"] + #[serde( + rename = "showChildRollup", + default, + skip_serializing_if = "Option::is_none" + )] + pub show_child_rollup: Option<bool>, + #[doc = "Flag indicating whether to show empty fields on cards"] + #[serde( + rename = "showEmptyFields", + default, + skip_serializing_if = "Option::is_none" + )] + pub show_empty_fields: Option<bool>, + #[doc = "Flag indicating whether to show ID on cards"] + #[serde(rename = "showId", default, skip_serializing_if = "Option::is_none")] + pub show_id: Option<bool>, + #[doc = "Flag indicating whether to show show parent field on cards"] + #[serde( + rename = "showParent", + default, + skip_serializing_if = "Option::is_none" + )] + pub show_parent: Option<bool>, + #[doc = "Flag indicating whether to show state field on cards"] + #[serde(rename = "showState", default, skip_serializing_if = "Option::is_none")] + pub show_state: Option<bool>, + #[doc = "Flag indicating whether to show tags on cards"] + #[serde(rename = "showTags", default, skip_serializing_if = "Option::is_none")] + pub show_tags: Option<bool>, } impl CardFieldSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod card_field_settings { - use super::*; - #[doc = "Display format for the assigned to field"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum AssignedToDisplayFormat { - #[serde(rename = "avatarOnly")] - AvatarOnly, - #[serde(rename = "fullName")] - FullName, - #[serde(rename = "avatarAndFullName")] - AvatarAndFullName, - } + use super::*; + #[doc = "Display format for the assigned to field"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum AssignedToDisplayFormat { + #[serde(rename = "avatarOnly")] + AvatarOnly, + #[serde(rename = "fullName")] + FullName, + #[serde(rename = "avatarAndFullName")] + AvatarAndFullName, + } } #[doc = "Card settings, such as fields and rules"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CardSettings { - #[doc = "Card settings, such as fields and rules"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fields: Option<CardFieldSettings>, + #[doc = "Card settings, such as fields and rules"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fields: Option<CardFieldSettings>, } impl CardSettings { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Details about a given backlog category"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CategoryConfiguration { - #[doc = "Name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Category Reference Name"] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "Work item types for the backlog category"] - #[serde( - rename = "workItemTypes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_types: Vec<WorkItemTypeReference>, + #[doc = "Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Category Reference Name"] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "Work item types for the backlog category"] + #[serde( + rename = "workItemTypes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_types: Vec<WorkItemTypeReference>, } impl CategoryConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CreatePlan { - #[doc = "Description of the plan"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Name of the plan to create."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Plan properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Type of plan to create."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<create_plan::Type>, + #[doc = "Description of the plan"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Name of the plan to create."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Plan properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Type of plan to create."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<create_plan::Type>, } impl CreatePlan { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod create_plan { - use super::*; - #[doc = "Type of plan to create."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "deliveryTimelineView")] - DeliveryTimelineView, - } + use super::*; + #[doc = "Type of plan to create."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "deliveryTimelineView")] + DeliveryTimelineView, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DateRange { - #[doc = "End of the date range."] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub end: Option<time::OffsetDateTime>, - #[doc = "Start of the date range."] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start: Option<time::OffsetDateTime>, + #[doc = "End of the date range."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub end: Option<time::OffsetDateTime>, + #[doc = "Start of the date range."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start: Option<time::OffsetDateTime>, } impl DateRange { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data contract for Data of Delivery View"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeliveryViewData { - #[serde(flatten)] - pub plan_view_data: PlanViewData, - #[doc = "Work item child id to parent id map"] - #[serde( - rename = "childIdToParentIdMap", - default, - skip_serializing_if = "Option::is_none" - )] - pub child_id_to_parent_id_map: Option<serde_json::Value>, - #[doc = ""] - #[serde( - rename = "criteriaStatus", - default, - skip_serializing_if = "Option::is_none" - )] - pub criteria_status: Option<TimelineCriteriaStatus>, - #[doc = "The end date of the delivery view data"] - #[serde( - rename = "endDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub end_date: Option<time::OffsetDateTime>, - #[doc = "Max number of teams that can be configured for a delivery plan"] - #[serde( - rename = "maxExpandedTeams", - default, - skip_serializing_if = "Option::is_none" - )] - pub max_expanded_teams: Option<i32>, - #[doc = "Mapping between parent id, title and all the child work item ids"] - #[serde( - rename = "parentItemMaps", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub parent_item_maps: Vec<ParentChildWiMap>, - #[doc = "The start date for the delivery view data"] - #[serde( - rename = "startDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_date: Option<time::OffsetDateTime>, - #[doc = "All the team data"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub teams: Vec<TimelineTeamData>, - #[doc = "List of all work item ids that have a dependency but not a violation"] - #[serde( - rename = "workItemDependencies", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_dependencies: Vec<i32>, - #[doc = "List of all work item ids that have a violation"] - #[serde( - rename = "workItemViolations", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_violations: Vec<i32>, + #[serde(flatten)] + pub plan_view_data: PlanViewData, + #[doc = "Work item child id to parent id map"] + #[serde( + rename = "childIdToParentIdMap", + default, + skip_serializing_if = "Option::is_none" + )] + pub child_id_to_parent_id_map: Option<serde_json::Value>, + #[doc = ""] + #[serde( + rename = "criteriaStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub criteria_status: Option<TimelineCriteriaStatus>, + #[doc = "The end date of the delivery view data"] + #[serde( + rename = "endDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub end_date: Option<time::OffsetDateTime>, + #[doc = "Max number of teams that can be configured for a delivery plan"] + #[serde( + rename = "maxExpandedTeams", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_expanded_teams: Option<i32>, + #[doc = "Mapping between parent id, title and all the child work item ids"] + #[serde( + rename = "parentItemMaps", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub parent_item_maps: Vec<ParentChildWiMap>, + #[doc = "The start date for the delivery view data"] + #[serde( + rename = "startDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_date: Option<time::OffsetDateTime>, + #[doc = "All the team data"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub teams: Vec<TimelineTeamData>, + #[doc = "List of all work item ids that have a dependency but not a violation"] + #[serde( + rename = "workItemDependencies", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_dependencies: Vec<i32>, + #[doc = "List of all work item ids that have a violation"] + #[serde( + rename = "workItemViolations", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_violations: Vec<i32>, } impl DeliveryViewData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Collection of properties, specific to the DeliveryTimelineView"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeliveryViewPropertyCollection { - #[doc = "Card settings, such as fields and rules"] - #[serde( - rename = "cardSettings", - default, - skip_serializing_if = "Option::is_none" - )] - pub card_settings: Option<CardSettings>, - #[doc = "Field criteria"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub criteria: Vec<FilterClause>, - #[doc = "Markers. Will be missing/null if there are no markers."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub markers: Vec<Marker>, - #[doc = "Card style settings"] - #[serde( - rename = "styleSettings", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub style_settings: Vec<Rule>, - #[doc = "tag style settings"] - #[serde( - rename = "tagStyleSettings", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub tag_style_settings: Vec<Rule>, - #[doc = "Team backlog mappings"] - #[serde( - rename = "teamBacklogMappings", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub team_backlog_mappings: Vec<TeamBacklogMapping>, + #[doc = "Card settings, such as fields and rules"] + #[serde( + rename = "cardSettings", + default, + skip_serializing_if = "Option::is_none" + )] + pub card_settings: Option<CardSettings>, + #[doc = "Field criteria"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub criteria: Vec<FilterClause>, + #[doc = "Markers. Will be missing/null if there are no markers."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub markers: Vec<Marker>, + #[doc = "Card style settings"] + #[serde( + rename = "styleSettings", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub style_settings: Vec<Rule>, + #[doc = "tag style settings"] + #[serde( + rename = "tagStyleSettings", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub tag_style_settings: Vec<Rule>, + #[doc = "Team backlog mappings"] + #[serde( + rename = "teamBacklogMappings", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub team_backlog_mappings: Vec<TeamBacklogMapping>, } impl DeliveryViewPropertyCollection { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Object bag storing the set of permissions relevant to this plan"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FieldInfo { - #[doc = "The additional field display name"] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "The additional field type"] - #[serde(rename = "fieldType", default, skip_serializing_if = "Option::is_none")] - pub field_type: Option<field_info::FieldType>, - #[doc = "Indicates if the field definition is for an identity field."] - #[serde( - rename = "isIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_identity: Option<bool>, - #[doc = "The additional field reference name"] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, + #[doc = "The additional field display name"] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "The additional field type"] + #[serde(rename = "fieldType", default, skip_serializing_if = "Option::is_none")] + pub field_type: Option<field_info::FieldType>, + #[doc = "Indicates if the field definition is for an identity field."] + #[serde( + rename = "isIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_identity: Option<bool>, + #[doc = "The additional field reference name"] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, } impl FieldInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod field_info { - use super::*; - #[doc = "The additional field type"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum FieldType { - #[serde(rename = "string")] - String, - #[serde(rename = "plainText")] - PlainText, - #[serde(rename = "integer")] - Integer, - #[serde(rename = "dateTime")] - DateTime, - #[serde(rename = "treePath")] - TreePath, - #[serde(rename = "boolean")] - Boolean, - #[serde(rename = "double")] - Double, - } + use super::*; + #[doc = "The additional field type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum FieldType { + #[serde(rename = "string")] + String, + #[serde(rename = "plainText")] + PlainText, + #[serde(rename = "integer")] + Integer, + #[serde(rename = "dateTime")] + DateTime, + #[serde(rename = "treePath")] + TreePath, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "double")] + Double, + } } #[doc = "An abstracted reference to a field"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FieldReference { - #[doc = "fieldRefName for the field"] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "Full http link to more information about the field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "fieldRefName for the field"] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "Full http link to more information about the field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl FieldReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FieldSetting {} impl FieldSetting { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FilterClause { - #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] - pub field_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub index: Option<i32>, - #[serde( - rename = "logicalOperator", - default, - skip_serializing_if = "Option::is_none" - )] - pub logical_operator: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operator: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(rename = "fieldName", default, skip_serializing_if = "Option::is_none")] + pub field_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub index: Option<i32>, + #[serde( + rename = "logicalOperator", + default, + skip_serializing_if = "Option::is_none" + )] + pub logical_operator: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl FilterClause { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct FilterGroup { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub level: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option<i32>, } impl FilterGroup { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphSubjectBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub descriptor: Option<String>, - #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[doc = "This url is the full route to the source resource of this graph subject."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub descriptor: Option<String>, + #[doc = "This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider."] + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[doc = "This url is the full route to the source resource of this graph subject."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl GraphSubjectBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ITaskboardColumnMapping { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[serde( - rename = "workItemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[serde( + rename = "workItemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type: Option<String>, } impl ITaskboardColumnMapping { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct IdentityRef { - #[serde(flatten)] - pub graph_subject_base: GraphSubjectBase, - #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] - #[serde( - rename = "directoryAlias", - default, - skip_serializing_if = "Option::is_none" - )] - pub directory_alias: Option<String>, - pub id: String, - #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] - #[serde( - rename = "isAadIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_aad_identity: Option<bool>, - #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] - #[serde( - rename = "isContainer", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_container: Option<bool>, - #[serde( - rename = "isDeletedInOrigin", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_deleted_in_origin: Option<bool>, - #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] - #[serde( - rename = "profileUrl", - default, - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option<String>, - #[doc = "Deprecated - use Domain+PrincipalName instead"] - #[serde(rename = "uniqueName")] - pub unique_name: String, + #[serde(flatten)] + pub graph_subject_base: GraphSubjectBase, + #[doc = "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary"] + #[serde( + rename = "directoryAlias", + default, + skip_serializing_if = "Option::is_none" + )] + pub directory_alias: Option<String>, + pub id: String, + #[doc = "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary"] + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[doc = "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inactive: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)"] + #[serde( + rename = "isAadIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_aad_identity: Option<bool>, + #[doc = "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)"] + #[serde( + rename = "isContainer", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_container: Option<bool>, + #[serde( + rename = "isDeletedInOrigin", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_deleted_in_origin: Option<bool>, + #[doc = "Deprecated - not in use in most preexisting implementations of ToIdentityRef"] + #[serde( + rename = "profileUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option<String>, + #[doc = "Deprecated - use Domain+PrincipalName instead"] + #[serde(rename = "uniqueName")] + pub unique_name: String, } impl IdentityRef { - pub fn new(id: String, unique_name: String) -> Self { - Self { - graph_subject_base: GraphSubjectBase::default(), - directory_alias: None, - id, - image_url: None, - inactive: None, - is_aad_identity: None, - is_container: None, - is_deleted_in_origin: None, - profile_url: None, - unique_name, - } - } + pub fn new(id: String, unique_name: String) -> Self { + Self { + graph_subject_base: GraphSubjectBase::default(), + directory_alias: None, + id, + image_url: None, + inactive: None, + is_aad_identity: None, + is_container: None, + is_deleted_in_origin: None, + profile_url: None, + unique_name, + } + } } #[doc = "Capacity and teams for all teams in an iteration"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IterationCapacity { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub teams: Vec<TeamCapacityTotals>, - #[serde( - rename = "totalIterationCapacityPerDay", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_iteration_capacity_per_day: Option<f64>, - #[serde( - rename = "totalIterationDaysOff", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_iteration_days_off: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub teams: Vec<TeamCapacityTotals>, + #[serde( + rename = "totalIterationCapacityPerDay", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_iteration_capacity_per_day: Option<f64>, + #[serde( + rename = "totalIterationDaysOff", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_iteration_days_off: Option<i32>, } impl IterationCapacity { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents work items in an iteration backlog"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IterationWorkItems { - #[serde(flatten)] - pub team_settings_data_contract_base: TeamSettingsDataContractBase, - #[doc = "Work item relations"] - #[serde( - rename = "workItemRelations", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_relations: Vec<WorkItemLink>, + #[serde(flatten)] + pub team_settings_data_contract_base: TeamSettingsDataContractBase, + #[doc = "Work item relations"] + #[serde( + rename = "workItemRelations", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_relations: Vec<WorkItemLink>, } impl IterationWorkItems { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Link description."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Link { - #[doc = "Collection of link attributes."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attributes: Option<serde_json::Value>, - #[doc = "Relation type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rel: Option<String>, - #[doc = "Link url."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Collection of link attributes."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attributes: Option<serde_json::Value>, + #[doc = "Relation type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rel: Option<String>, + #[doc = "Link url."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Link { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Client serialization contract for Delivery Timeline Markers."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Marker { - #[doc = "Color associated with the marker."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub color: Option<String>, - #[doc = "Where the marker should be displayed on the timeline."] - #[serde( - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub date: Option<time::OffsetDateTime>, - #[doc = "Label/title for the marker."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub label: Option<String>, + #[doc = "Color associated with the marker."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub color: Option<String>, + #[doc = "Where the marker should be displayed on the timeline."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub date: Option<time::OffsetDateTime>, + #[doc = "Label/title for the marker."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option<String>, } impl Marker { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Member { - #[serde( - rename = "displayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub display_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] - pub image_url: Option<String>, - #[serde( - rename = "uniqueName", - default, - skip_serializing_if = "Option::is_none" - )] - pub unique_name: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde( + rename = "displayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub display_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(rename = "imageUrl", default, skip_serializing_if = "Option::is_none")] + pub image_url: Option<String>, + #[serde( + rename = "uniqueName", + default, + skip_serializing_if = "Option::is_none" + )] + pub unique_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl Member { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ParentChildWiMap { - #[serde( - rename = "childWorkItemIds", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub child_work_item_ids: Vec<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option<String>, - #[serde( - rename = "workItemTypeName", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type_name: Option<String>, + #[serde( + rename = "childWorkItemIds", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub child_work_item_ids: Vec<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option<String>, + #[serde( + rename = "workItemTypeName", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type_name: Option<String>, } impl ParentChildWiMap { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ParentChildWiMapList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ParentChildWiMap>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ParentChildWiMap>, } impl ParentChildWiMapList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data contract for the plan definition"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Plan { - #[doc = ""] - #[serde( - rename = "createdByIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub created_by_identity: Option<IdentityRef>, - #[doc = "Date when the plan was created"] - #[serde( - rename = "createdDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub created_date: Option<time::OffsetDateTime>, - #[doc = "Description of the plan"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Id of the plan"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Date when the plan was last accessed. Default is null."] - #[serde( - rename = "lastAccessed", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub last_accessed: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde( - rename = "modifiedByIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub modified_by_identity: Option<IdentityRef>, - #[doc = "Date when the plan was last modified. Default to CreatedDate when the plan is first created."] - #[serde( - rename = "modifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_date: Option<time::OffsetDateTime>, - #[doc = "Name of the plan"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The PlanPropertyCollection instance associated with the plan. These are dependent on the type of the plan. For example, DeliveryTimelineView, it would be of type DeliveryViewPropertyCollection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Revision of the plan. Used to safeguard users from overwriting each other's changes."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "Type of the plan"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<plan::Type>, - #[doc = "The resource url to locate the plan via rest api"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Bit flag indicating set of permissions a user has to the plan."] - #[serde( - rename = "userPermissions", - default, - skip_serializing_if = "Option::is_none" - )] - pub user_permissions: Option<plan::UserPermissions>, + #[doc = ""] + #[serde( + rename = "createdByIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub created_by_identity: Option<IdentityRef>, + #[doc = "Date when the plan was created"] + #[serde( + rename = "createdDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub created_date: Option<time::OffsetDateTime>, + #[doc = "Description of the plan"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Id of the plan"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = ""] + #[serde( + rename = "modifiedByIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub modified_by_identity: Option<IdentityRef>, + #[doc = "Date when the plan was last modified. Default to CreatedDate when the plan is first created."] + #[serde( + rename = "modifiedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_date: Option<time::OffsetDateTime>, + #[doc = "Name of the plan"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The PlanPropertyCollection instance associated with the plan. These are dependent on the type of the plan. For example, DeliveryTimelineView, it would be of type DeliveryViewPropertyCollection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Revision of the plan. Used to safeguard users from overwriting each other's changes."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "Type of the plan"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<plan::Type>, + #[doc = "The resource url to locate the plan via rest api"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Bit flag indicating set of permissions a user has to the plan."] + #[serde( + rename = "userPermissions", + default, + skip_serializing_if = "Option::is_none" + )] + pub user_permissions: Option<plan::UserPermissions>, } impl Plan { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod plan { - use super::*; - #[doc = "Type of the plan"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "deliveryTimelineView")] - DeliveryTimelineView, - } - #[doc = "Bit flag indicating set of permissions a user has to the plan."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum UserPermissions { - #[serde(rename = "none")] - None, - #[serde(rename = "view")] - View, - #[serde(rename = "edit")] - Edit, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "manage")] - Manage, - #[serde(rename = "allPermissions")] - AllPermissions, - } + use super::*; + #[doc = "Type of the plan"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "deliveryTimelineView")] + DeliveryTimelineView, + } + #[doc = "Bit flag indicating set of permissions a user has to the plan."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum UserPermissions { + #[serde(rename = "none")] + None, + #[serde(rename = "view")] + View, + #[serde(rename = "edit")] + Edit, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "manage")] + Manage, + #[serde(rename = "allPermissions")] + AllPermissions, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PlanList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<Plan>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<Plan>, } impl PlanList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Metadata about a plan definition that is stored in favorites service"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PlanMetadata { - #[doc = ""] - #[serde( - rename = "createdByIdentity", - default, - skip_serializing_if = "Option::is_none" - )] - pub created_by_identity: Option<IdentityRef>, - #[doc = "Description of plan"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Last modified date of the plan"] - #[serde( - rename = "modifiedDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub modified_date: Option<time::OffsetDateTime>, - #[doc = "Bit flag indicating set of permissions a user has to the plan."] - #[serde( - rename = "userPermissions", - default, - skip_serializing_if = "Option::is_none" - )] - pub user_permissions: Option<plan_metadata::UserPermissions>, + #[doc = ""] + #[serde( + rename = "createdByIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub created_by_identity: Option<IdentityRef>, + #[doc = "Description of plan"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Last modified date of the plan"] + #[serde( + rename = "modifiedDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub modified_date: Option<time::OffsetDateTime>, + #[doc = "Bit flag indicating set of permissions a user has to the plan."] + #[serde( + rename = "userPermissions", + default, + skip_serializing_if = "Option::is_none" + )] + pub user_permissions: Option<plan_metadata::UserPermissions>, } impl PlanMetadata { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod plan_metadata { - use super::*; - #[doc = "Bit flag indicating set of permissions a user has to the plan."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum UserPermissions { - #[serde(rename = "none")] - None, - #[serde(rename = "view")] - View, - #[serde(rename = "edit")] - Edit, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "manage")] - Manage, - #[serde(rename = "allPermissions")] - AllPermissions, - } + use super::*; + #[doc = "Bit flag indicating set of permissions a user has to the plan."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum UserPermissions { + #[serde(rename = "none")] + None, + #[serde(rename = "view")] + View, + #[serde(rename = "edit")] + Edit, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "manage")] + Manage, + #[serde(rename = "allPermissions")] + AllPermissions, + } } #[doc = "Base class for plan view data contracts. Anything common goes here."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PlanViewData { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, } impl PlanViewData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a single pre-defined query."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PredefinedQuery { - #[doc = "Whether or not the query returned the complete set of data or if the data was truncated."] - #[serde(rename = "hasMore", default, skip_serializing_if = "Option::is_none")] - pub has_more: Option<bool>, - #[doc = "Id of the query"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Localized name of the query"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The results of the query. This will be a set of WorkItem objects with only the 'id' set. The client is responsible for paging in the data as needed."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub results: Vec<WorkItem>, - #[doc = "REST API Url to use to retrieve results for this query"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, - #[doc = "Url to use to display a page in the browser with the results of this query"] - #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] - pub web_url: Option<String>, + #[doc = "Whether or not the query returned the complete set of data or if the data was truncated."] + #[serde(rename = "hasMore", default, skip_serializing_if = "Option::is_none")] + pub has_more: Option<bool>, + #[doc = "Id of the query"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Localized name of the query"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The results of the query. This will be a set of WorkItem objects with only the 'id' set. The client is responsible for paging in the data as needed."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub results: Vec<WorkItem>, + #[doc = "REST API Url to use to retrieve results for this query"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, + #[doc = "Url to use to display a page in the browser with the results of this query"] + #[serde(rename = "webUrl", default, skip_serializing_if = "Option::is_none")] + pub web_url: Option<String>, } impl PredefinedQuery { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Process Configurations for the project"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProcessConfiguration { - #[doc = "Details about a given backlog category"] - #[serde( - rename = "bugWorkItems", - default, - skip_serializing_if = "Option::is_none" - )] - pub bug_work_items: Option<CategoryConfiguration>, - #[doc = "Details about portfolio backlogs"] - #[serde( - rename = "portfolioBacklogs", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub portfolio_backlogs: Vec<CategoryConfiguration>, - #[doc = "Details about a given backlog category"] - #[serde( - rename = "requirementBacklog", - default, - skip_serializing_if = "Option::is_none" - )] - pub requirement_backlog: Option<CategoryConfiguration>, - #[doc = "Details about a given backlog category"] - #[serde( - rename = "taskBacklog", - default, - skip_serializing_if = "Option::is_none" - )] - pub task_backlog: Option<CategoryConfiguration>, - #[doc = "Type fields for the process configuration"] - #[serde( - rename = "typeFields", - default, - skip_serializing_if = "Option::is_none" - )] - pub type_fields: Option<serde_json::Value>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Details about a given backlog category"] + #[serde( + rename = "bugWorkItems", + default, + skip_serializing_if = "Option::is_none" + )] + pub bug_work_items: Option<CategoryConfiguration>, + #[doc = "Details about portfolio backlogs"] + #[serde( + rename = "portfolioBacklogs", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub portfolio_backlogs: Vec<CategoryConfiguration>, + #[doc = "Details about a given backlog category"] + #[serde( + rename = "requirementBacklog", + default, + skip_serializing_if = "Option::is_none" + )] + pub requirement_backlog: Option<CategoryConfiguration>, + #[doc = "Details about a given backlog category"] + #[serde( + rename = "taskBacklog", + default, + skip_serializing_if = "Option::is_none" + )] + pub task_backlog: Option<CategoryConfiguration>, + #[doc = "Type fields for the process configuration"] + #[serde( + rename = "typeFields", + default, + skip_serializing_if = "Option::is_none" + )] + pub type_fields: Option<serde_json::Value>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl ProcessConfiguration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The class to represent a collection of REST reference links."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReferenceLinks { - #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[doc = "The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl ReferenceLinks { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reorder request for one or more work items."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReorderOperation { - #[doc = "IDs of the work items to be reordered. Must be valid WorkItem Ids."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub ids: Vec<i32>, - #[doc = "IterationPath for reorder operation. This is only used when we reorder from the Iteration Backlog"] - #[serde( - rename = "iterationPath", - default, - skip_serializing_if = "Option::is_none" - )] - pub iteration_path: Option<String>, - #[doc = "ID of the work item that should be after the reordered items. Can use 0 to specify the end of the list."] - #[serde(rename = "nextId", default, skip_serializing_if = "Option::is_none")] - pub next_id: Option<i32>, - #[doc = "Parent ID for all of the work items involved in this operation. Can use 0 to indicate the items don't have a parent."] - #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option<i32>, - #[doc = "ID of the work item that should be before the reordered items. Can use 0 to specify the beginning of the list."] - #[serde( - rename = "previousId", - default, - skip_serializing_if = "Option::is_none" - )] - pub previous_id: Option<i32>, + #[doc = "IDs of the work items to be reordered. Must be valid WorkItem Ids."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub ids: Vec<i32>, + #[doc = "IterationPath for reorder operation. This is only used when we reorder from the Iteration Backlog"] + #[serde( + rename = "iterationPath", + default, + skip_serializing_if = "Option::is_none" + )] + pub iteration_path: Option<String>, + #[doc = "ID of the work item that should be after the reordered items. Can use 0 to specify the end of the list."] + #[serde(rename = "nextId", default, skip_serializing_if = "Option::is_none")] + pub next_id: Option<i32>, + #[doc = "Parent ID for all of the work items involved in this operation. Can use 0 to indicate the items don't have a parent."] + #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option<i32>, + #[doc = "ID of the work item that should be before the reordered items. Can use 0 to specify the beginning of the list."] + #[serde( + rename = "previousId", + default, + skip_serializing_if = "Option::is_none" + )] + pub previous_id: Option<i32>, } impl ReorderOperation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a reorder result for a work item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReorderResult { - #[doc = "The ID of the work item that was reordered."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "The updated order value of the work item that was reordered."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<f64>, + #[doc = "The ID of the work item that was reordered."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "The updated order value of the work item that was reordered."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<f64>, } impl ReorderResult { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReorderResultList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<ReorderResult>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<ReorderResult>, } impl ReorderResultList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Rule { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub clauses: Vec<FilterClause>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option<String>, - #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_enabled: Option<String>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub settings: Option<Attribute>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub clauses: Vec<FilterClause>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option<String>, + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub settings: Option<Attribute>, } impl Rule { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the taskbord column"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskboardColumn { - #[doc = "Column ID"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Work item type states mapped to this column to support auto state update when column is updated."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mappings: Vec<ITaskboardColumnMapping>, - #[doc = "Column name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Column position relative to other columns in the same board"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, + #[doc = "Column ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Work item type states mapped to this column to support auto state update when column is updated."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mappings: Vec<ITaskboardColumnMapping>, + #[doc = "Column name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Column position relative to other columns in the same board"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, } impl TaskboardColumn { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the state to column mapping per work item type This allows auto state update when the column changes"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskboardColumnMapping { - #[doc = "State of the work item type mapped to the column"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "Work Item Type name who's state is mapped to the column"] - #[serde( - rename = "workItemType", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type: Option<String>, + #[doc = "State of the work item type mapped to the column"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "Work Item Type name who's state is mapped to the column"] + #[serde( + rename = "workItemType", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type: Option<String>, } impl TaskboardColumnMapping { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskboardColumns { - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub columns: Vec<TaskboardColumn>, - #[doc = "Are the columns cutomized for this team"] - #[serde( - rename = "isCustomized", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_customized: Option<bool>, - #[doc = "Specifies if the referenced WIT and State is valid"] - #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] - pub is_valid: Option<bool>, - #[doc = "Details of validation failure if the state to column mapping is invalid"] - #[serde( - rename = "validationMesssage", - default, - skip_serializing_if = "Option::is_none" - )] - pub validation_messsage: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub columns: Vec<TaskboardColumn>, + #[doc = "Are the columns cutomized for this team"] + #[serde( + rename = "isCustomized", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_customized: Option<bool>, + #[doc = "Specifies if the referenced WIT and State is valid"] + #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] + pub is_valid: Option<bool>, + #[doc = "Details of validation failure if the state to column mapping is invalid"] + #[serde( + rename = "validationMesssage", + default, + skip_serializing_if = "Option::is_none" + )] + pub validation_messsage: Option<String>, } impl TaskboardColumns { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Column value of a work item in the taskboard"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskboardWorkItemColumn { - #[doc = "Work item column value in the taskboard"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub column: Option<String>, - #[doc = "Work item column id in the taskboard"] - #[serde(rename = "columnId", default, skip_serializing_if = "Option::is_none")] - pub column_id: Option<String>, - #[doc = "Work Item state value"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option<String>, - #[doc = "Work item id"] - #[serde( - rename = "workItemId", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_id: Option<i32>, + #[doc = "Work item column value in the taskboard"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub column: Option<String>, + #[doc = "Work item column id in the taskboard"] + #[serde(rename = "columnId", default, skip_serializing_if = "Option::is_none")] + pub column_id: Option<String>, + #[doc = "Work Item state value"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option<String>, + #[doc = "Work item id"] + #[serde( + rename = "workItemId", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_id: Option<i32>, } impl TaskboardWorkItemColumn { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TaskboardWorkItemColumnList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TaskboardWorkItemColumn>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TaskboardWorkItemColumn>, } impl TaskboardWorkItemColumnList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Mapping of teams to the corresponding work item category"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamBacklogMapping { - #[serde( - rename = "categoryReferenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub category_reference_name: Option<String>, - #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] - pub team_id: Option<String>, + #[serde( + rename = "categoryReferenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub category_reference_name: Option<String>, + #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] + pub team_id: Option<String>, } impl TeamBacklogMapping { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents team member capacity with totals aggregated"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamCapacity { - #[serde( - rename = "teamMembers", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub team_members: Vec<TeamMemberCapacityIdentityRef>, - #[serde( - rename = "totalCapacityPerDay", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_capacity_per_day: Option<f64>, - #[serde( - rename = "totalDaysOff", - default, - skip_serializing_if = "Option::is_none" - )] - pub total_days_off: Option<i32>, + #[serde( + rename = "teamMembers", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub team_members: Vec<TeamMemberCapacityIdentityRef>, + #[serde( + rename = "totalCapacityPerDay", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_capacity_per_day: Option<f64>, + #[serde( + rename = "totalDaysOff", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_days_off: Option<i32>, } impl TeamCapacity { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Team information with total capacity and days off"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamCapacityTotals { - #[serde( - rename = "teamCapacityPerDay", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_capacity_per_day: Option<f64>, - #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] - pub team_id: Option<String>, - #[serde( - rename = "teamTotalDaysOff", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_total_days_off: Option<i32>, + #[serde( + rename = "teamCapacityPerDay", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_capacity_per_day: Option<f64>, + #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] + pub team_id: Option<String>, + #[serde( + rename = "teamTotalDaysOff", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_total_days_off: Option<i32>, } impl TeamCapacityTotals { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "The Team Context for an operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamContext { - #[doc = "The team project Id or name. Ignored if ProjectId is set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub project: Option<String>, - #[doc = "The Team Project ID. Required if Project is not set."] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "The Team Id or name. Ignored if TeamId is set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub team: Option<String>, - #[doc = "The Team Id"] - #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] - pub team_id: Option<String>, + #[doc = "The team project Id or name. Ignored if ProjectId is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub project: Option<String>, + #[doc = "The Team Project ID. Required if Project is not set."] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "The Team Id or name. Ignored if TeamId is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub team: Option<String>, + #[doc = "The Team Id"] + #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] + pub team_id: Option<String>, } impl TeamContext { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a single TeamFieldValue"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamFieldValue { - #[serde( - rename = "includeChildren", - default, - skip_serializing_if = "Option::is_none" - )] - pub include_children: Option<bool>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde( + rename = "includeChildren", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_children: Option<bool>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl TeamFieldValue { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Essentially a collection of team field values"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamFieldValues { - #[serde(flatten)] - pub team_settings_data_contract_base: TeamSettingsDataContractBase, - #[doc = "The default team field value"] - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<String>, - #[doc = "An abstracted reference to a field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub field: Option<FieldReference>, - #[doc = "Collection of all valid team field values"] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<TeamFieldValue>, + #[serde(flatten)] + pub team_settings_data_contract_base: TeamSettingsDataContractBase, + #[doc = "The default team field value"] + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<String>, + #[doc = "An abstracted reference to a field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub field: Option<FieldReference>, + #[doc = "Collection of all valid team field values"] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<TeamFieldValue>, } impl TeamFieldValues { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Expected data from PATCH"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamFieldValuesPatch { - #[serde( - rename = "defaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_value: Option<String>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub values: Vec<TeamFieldValue>, + #[serde( + rename = "defaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_value: Option<String>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub values: Vec<TeamFieldValue>, } impl TeamFieldValuesPatch { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamIterationAttributes { - #[doc = "Finish date of the iteration. Date-only, correct unadjusted at midnight in UTC."] - #[serde( - rename = "finishDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_date: Option<time::OffsetDateTime>, - #[doc = "Start date of the iteration. Date-only, correct unadjusted at midnight in UTC."] - #[serde( - rename = "startDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_date: Option<time::OffsetDateTime>, - #[doc = "Time frame of the iteration, such as past, current or future."] - #[serde(rename = "timeFrame", default, skip_serializing_if = "Option::is_none")] - pub time_frame: Option<team_iteration_attributes::TimeFrame>, + #[doc = "Finish date of the iteration. Date-only, correct unadjusted at midnight in UTC."] + #[serde( + rename = "finishDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_date: Option<time::OffsetDateTime>, + #[doc = "Start date of the iteration. Date-only, correct unadjusted at midnight in UTC."] + #[serde( + rename = "startDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_date: Option<time::OffsetDateTime>, + #[doc = "Time frame of the iteration, such as past, current or future."] + #[serde(rename = "timeFrame", default, skip_serializing_if = "Option::is_none")] + pub time_frame: Option<team_iteration_attributes::TimeFrame>, } impl TeamIterationAttributes { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod team_iteration_attributes { - use super::*; - #[doc = "Time frame of the iteration, such as past, current or future."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum TimeFrame { - #[serde(rename = "past")] - Past, - #[serde(rename = "current")] - Current, - #[serde(rename = "future")] - Future, - } + use super::*; + #[doc = "Time frame of the iteration, such as past, current or future."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum TimeFrame { + #[serde(rename = "past")] + Past, + #[serde(rename = "current")] + Current, + #[serde(rename = "future")] + Future, + } } #[doc = "Represents capacity for a specific team member"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamMemberCapacity { - #[serde(flatten)] - pub capacity_contract_base: CapacityContractBase, - #[doc = ""] - #[serde( - rename = "teamMember", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_member: Option<Member>, + #[serde(flatten)] + pub capacity_contract_base: CapacityContractBase, + #[doc = ""] + #[serde( + rename = "teamMember", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_member: Option<Member>, } impl TeamMemberCapacity { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents capacity for a specific team member"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamMemberCapacityIdentityRef { - #[serde(flatten)] - pub capacity_contract_base: CapacityContractBase, - #[doc = ""] - #[serde( - rename = "teamMember", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_member: Option<IdentityRef>, + #[serde(flatten)] + pub capacity_contract_base: CapacityContractBase, + #[doc = ""] + #[serde( + rename = "teamMember", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_member: Option<IdentityRef>, } impl TeamMemberCapacityIdentityRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamMemberCapacityIdentityRefList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TeamMemberCapacityIdentityRef>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TeamMemberCapacityIdentityRef>, } impl TeamMemberCapacityIdentityRefList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data contract for TeamSettings"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamSetting { - #[serde(flatten)] - pub team_settings_data_contract_base: TeamSettingsDataContractBase, - #[doc = "Represents a shallow ref for a single iteration."] - #[serde( - rename = "backlogIteration", - default, - skip_serializing_if = "Option::is_none" - )] - pub backlog_iteration: Option<TeamSettingsIteration>, - #[doc = "Information about categories that are visible on the backlog."] - #[serde( - rename = "backlogVisibilities", - default, - skip_serializing_if = "Option::is_none" - )] - pub backlog_visibilities: Option<serde_json::Value>, - #[doc = "BugsBehavior (Off, AsTasks, AsRequirements, ...)"] - #[serde( - rename = "bugsBehavior", - default, - skip_serializing_if = "Option::is_none" - )] - pub bugs_behavior: Option<team_setting::BugsBehavior>, - #[doc = "Represents a shallow ref for a single iteration."] - #[serde( - rename = "defaultIteration", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_iteration: Option<TeamSettingsIteration>, - #[doc = "Default Iteration macro (if any)"] - #[serde( - rename = "defaultIterationMacro", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_iteration_macro: Option<String>, - #[doc = "Days that the team is working"] - #[serde( - rename = "workingDays", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub working_days: Vec<serde_json::Value>, + #[serde(flatten)] + pub team_settings_data_contract_base: TeamSettingsDataContractBase, + #[doc = "Represents a shallow ref for a single iteration."] + #[serde( + rename = "backlogIteration", + default, + skip_serializing_if = "Option::is_none" + )] + pub backlog_iteration: Option<TeamSettingsIteration>, + #[doc = "Information about categories that are visible on the backlog."] + #[serde( + rename = "backlogVisibilities", + default, + skip_serializing_if = "Option::is_none" + )] + pub backlog_visibilities: Option<serde_json::Value>, + #[doc = "BugsBehavior (Off, AsTasks, AsRequirements, ...)"] + #[serde( + rename = "bugsBehavior", + default, + skip_serializing_if = "Option::is_none" + )] + pub bugs_behavior: Option<team_setting::BugsBehavior>, + #[doc = "Represents a shallow ref for a single iteration."] + #[serde( + rename = "defaultIteration", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_iteration: Option<TeamSettingsIteration>, + #[doc = "Default Iteration macro (if any)"] + #[serde( + rename = "defaultIterationMacro", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_iteration_macro: Option<String>, + #[doc = "Days that the team is working"] + #[serde( + rename = "workingDays", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub working_days: Vec<serde_json::Value>, } impl TeamSetting { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod team_setting { - use super::*; - #[doc = "BugsBehavior (Off, AsTasks, AsRequirements, ...)"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum BugsBehavior { - #[serde(rename = "off")] - Off, - #[serde(rename = "asRequirements")] - AsRequirements, - #[serde(rename = "asTasks")] - AsTasks, - } + use super::*; + #[doc = "BugsBehavior (Off, AsTasks, AsRequirements, ...)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum BugsBehavior { + #[serde(rename = "off")] + Off, + #[serde(rename = "asRequirements")] + AsRequirements, + #[serde(rename = "asTasks")] + AsTasks, + } } #[doc = "Base class for TeamSettings data contracts. Anything common goes here."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamSettingsDataContractBase { - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, - #[doc = "Full http link to the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, + #[doc = "Full http link to the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl TeamSettingsDataContractBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamSettingsDaysOff { - #[serde(flatten)] - pub team_settings_data_contract_base: TeamSettingsDataContractBase, - #[serde( - rename = "daysOff", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub days_off: Vec<DateRange>, + #[serde(flatten)] + pub team_settings_data_contract_base: TeamSettingsDataContractBase, + #[serde( + rename = "daysOff", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub days_off: Vec<DateRange>, } impl TeamSettingsDaysOff { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamSettingsDaysOffPatch { - #[serde( - rename = "daysOff", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub days_off: Vec<DateRange>, + #[serde( + rename = "daysOff", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub days_off: Vec<DateRange>, } impl TeamSettingsDaysOffPatch { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents a shallow ref for a single iteration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamSettingsIteration { - #[serde(flatten)] - pub team_settings_data_contract_base: TeamSettingsDataContractBase, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attributes: Option<TeamIterationAttributes>, - #[doc = "Id of the iteration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Name of the iteration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Relative path of the iteration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, + #[serde(flatten)] + pub team_settings_data_contract_base: TeamSettingsDataContractBase, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attributes: Option<TeamIterationAttributes>, + #[doc = "Id of the iteration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Name of the iteration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Relative path of the iteration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, } impl TeamSettingsIteration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamSettingsIterationList { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub value: Vec<TeamSettingsIteration>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub value: Vec<TeamSettingsIteration>, } impl TeamSettingsIterationList { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Data contract for what we expect to receive when PATCH"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TeamSettingsPatch { - #[serde( - rename = "backlogIteration", - default, - skip_serializing_if = "Option::is_none" - )] - pub backlog_iteration: Option<String>, - #[serde( - rename = "backlogVisibilities", - default, - skip_serializing_if = "Option::is_none" - )] - pub backlog_visibilities: Option<serde_json::Value>, - #[serde( - rename = "bugsBehavior", - default, - skip_serializing_if = "Option::is_none" - )] - pub bugs_behavior: Option<team_settings_patch::BugsBehavior>, - #[serde( - rename = "defaultIteration", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_iteration: Option<String>, - #[serde( - rename = "defaultIterationMacro", - default, - skip_serializing_if = "Option::is_none" - )] - pub default_iteration_macro: Option<String>, - #[serde( - rename = "workingDays", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub working_days: Vec<serde_json::Value>, + #[serde( + rename = "backlogIteration", + default, + skip_serializing_if = "Option::is_none" + )] + pub backlog_iteration: Option<String>, + #[serde( + rename = "backlogVisibilities", + default, + skip_serializing_if = "Option::is_none" + )] + pub backlog_visibilities: Option<serde_json::Value>, + #[serde( + rename = "bugsBehavior", + default, + skip_serializing_if = "Option::is_none" + )] + pub bugs_behavior: Option<team_settings_patch::BugsBehavior>, + #[serde( + rename = "defaultIteration", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_iteration: Option<String>, + #[serde( + rename = "defaultIterationMacro", + default, + skip_serializing_if = "Option::is_none" + )] + pub default_iteration_macro: Option<String>, + #[serde( + rename = "workingDays", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub working_days: Vec<serde_json::Value>, } impl TeamSettingsPatch { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod team_settings_patch { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum BugsBehavior { - #[serde(rename = "off")] - Off, - #[serde(rename = "asRequirements")] - AsRequirements, - #[serde(rename = "asTasks")] - AsTasks, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum BugsBehavior { + #[serde(rename = "off")] + Off, + #[serde(rename = "asRequirements")] + AsRequirements, + #[serde(rename = "asTasks")] + AsTasks, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineCriteriaStatus { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<timeline_criteria_status::Type>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<timeline_criteria_status::Type>, } impl TimelineCriteriaStatus { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod timeline_criteria_status { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "ok")] - Ok, - #[serde(rename = "invalidFilterClause")] - InvalidFilterClause, - #[serde(rename = "unknown")] - Unknown, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "ok")] + Ok, + #[serde(rename = "invalidFilterClause")] + InvalidFilterClause, + #[serde(rename = "unknown")] + Unknown, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineIterationStatus { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<timeline_iteration_status::Type>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<timeline_iteration_status::Type>, } impl TimelineIterationStatus { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod timeline_iteration_status { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "ok")] - Ok, - #[serde(rename = "isOverlapping")] - IsOverlapping, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "ok")] + Ok, + #[serde(rename = "isOverlapping")] + IsOverlapping, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineTeamData { - #[doc = "Contract representing a backlog level"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub backlog: Option<BacklogLevel>, - #[doc = "The field reference names of the work item data"] - #[serde( - rename = "fieldReferenceNames", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub field_reference_names: Vec<String>, - #[doc = "The id of the team"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Was iteration and work item data retrieved for this team. <remarks> Teams with IsExpanded false have not had their iteration, work item, and field related data queried and will never contain this data. If true then these items are queried and, if there are items in the queried range, there will be data. </remarks>"] - #[serde( - rename = "isExpanded", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_expanded: Option<bool>, - #[doc = "The iteration data, including the work items, in the queried date range."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub iterations: Vec<TimelineTeamIteration>, - #[doc = "The name of the team"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The order by field name of this team"] - #[serde( - rename = "orderByField", - default, - skip_serializing_if = "Option::is_none" - )] - pub order_by_field: Option<String>, - #[doc = "The field reference names of the partially paged work items, such as ID, WorkItemType"] - #[serde( - rename = "partiallyPagedFieldReferenceNames", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub partially_paged_field_reference_names: Vec<String>, - #[serde( - rename = "partiallyPagedWorkItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub partially_paged_work_items: Vec<Vec<serde_json::Value>>, - #[doc = "The project id the team belongs team"] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option<String>, - #[doc = "Work item types for which we will collect roll up data on the client side"] - #[serde( - rename = "rollupWorkItemTypes", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub rollup_work_item_types: Vec<String>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<TimelineTeamStatus>, - #[doc = "The team field default value"] - #[serde( - rename = "teamFieldDefaultValue", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_field_default_value: Option<String>, - #[doc = "The team field name of this team"] - #[serde( - rename = "teamFieldName", - default, - skip_serializing_if = "Option::is_none" - )] - pub team_field_name: Option<String>, - #[doc = "The team field values"] - #[serde( - rename = "teamFieldValues", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub team_field_values: Vec<TeamFieldValue>, - #[doc = "Work items associated with the team that are not under any of the team's iterations"] - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<Vec<serde_json::Value>>, - #[doc = "Colors for the work item types."] - #[serde( - rename = "workItemTypeColors", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_item_type_colors: Vec<WorkItemColor>, + #[doc = "Contract representing a backlog level"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub backlog: Option<BacklogLevel>, + #[doc = "The field reference names of the work item data"] + #[serde( + rename = "fieldReferenceNames", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub field_reference_names: Vec<String>, + #[doc = "The id of the team"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Was iteration and work item data retrieved for this team. <remarks> Teams with IsExpanded false have not had their iteration, work item, and field related data queried and will never contain this data. If true then these items are queried and, if there are items in the queried range, there will be data. </remarks>"] + #[serde( + rename = "isExpanded", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_expanded: Option<bool>, + #[doc = "The iteration data, including the work items, in the queried date range."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub iterations: Vec<TimelineTeamIteration>, + #[doc = "The name of the team"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The order by field name of this team"] + #[serde( + rename = "orderByField", + default, + skip_serializing_if = "Option::is_none" + )] + pub order_by_field: Option<String>, + #[doc = "The field reference names of the partially paged work items, such as ID, WorkItemType"] + #[serde( + rename = "partiallyPagedFieldReferenceNames", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub partially_paged_field_reference_names: Vec<String>, + #[serde( + rename = "partiallyPagedWorkItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub partially_paged_work_items: Vec<Vec<serde_json::Value>>, + #[doc = "The project id the team belongs team"] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option<String>, + #[doc = "Work item types for which we will collect roll up data on the client side"] + #[serde( + rename = "rollupWorkItemTypes", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub rollup_work_item_types: Vec<String>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<TimelineTeamStatus>, + #[doc = "The team field default value"] + #[serde( + rename = "teamFieldDefaultValue", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_field_default_value: Option<String>, + #[doc = "The team field name of this team"] + #[serde( + rename = "teamFieldName", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_field_name: Option<String>, + #[doc = "The team field values"] + #[serde( + rename = "teamFieldValues", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub team_field_values: Vec<TeamFieldValue>, + #[doc = "Work items associated with the team that are not under any of the team's iterations"] + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<Vec<serde_json::Value>>, + #[doc = "Colors for the work item types."] + #[serde( + rename = "workItemTypeColors", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_item_type_colors: Vec<WorkItemColor>, } impl TimelineTeamData { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineTeamIteration { - #[doc = "The iteration CSS Node Id"] - #[serde(rename = "cssNodeId", default, skip_serializing_if = "Option::is_none")] - pub css_node_id: Option<String>, - #[doc = "The end date of the iteration"] - #[serde( - rename = "finishDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub finish_date: Option<time::OffsetDateTime>, - #[doc = "The iteration name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "All the partially paged workitems in this iteration."] - #[serde( - rename = "partiallyPagedWorkItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub partially_paged_work_items: Vec<Vec<serde_json::Value>>, - #[doc = "The iteration path"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option<String>, - #[doc = "The start date of the iteration"] - #[serde( - rename = "startDate", - default, - skip_serializing_if = "Option::is_none", - with = "crate::date_time::rfc3339::option" - )] - pub start_date: Option<time::OffsetDateTime>, - #[doc = ""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option<TimelineIterationStatus>, - #[doc = "The work items that have been paged in this iteration"] - #[serde( - rename = "workItems", - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub work_items: Vec<Vec<serde_json::Value>>, + #[doc = "The iteration CSS Node Id"] + #[serde(rename = "cssNodeId", default, skip_serializing_if = "Option::is_none")] + pub css_node_id: Option<String>, + #[doc = "The end date of the iteration"] + #[serde( + rename = "finishDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub finish_date: Option<time::OffsetDateTime>, + #[doc = "The iteration name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "All the partially paged workitems in this iteration."] + #[serde( + rename = "partiallyPagedWorkItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub partially_paged_work_items: Vec<Vec<serde_json::Value>>, + #[doc = "The iteration path"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option<String>, + #[doc = "The start date of the iteration"] + #[serde( + rename = "startDate", + default, + skip_serializing_if = "Option::is_none", + with = "crate::date_time::rfc3339::option" + )] + pub start_date: Option<time::OffsetDateTime>, + #[doc = ""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option<TimelineIterationStatus>, + #[doc = "The work items that have been paged in this iteration"] + #[serde( + rename = "workItems", + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub work_items: Vec<Vec<serde_json::Value>>, } impl TimelineTeamIteration { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TimelineTeamStatus { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option<String>, - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<timeline_team_status::Type>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option<String>, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<timeline_team_status::Type>, } impl TimelineTeamStatus { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod timeline_team_status { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "ok")] - Ok, - #[serde(rename = "doesntExistOrAccessDenied")] - DoesntExistOrAccessDenied, - #[serde(rename = "maxTeamsExceeded")] - MaxTeamsExceeded, - #[serde(rename = "maxTeamFieldsExceeded")] - MaxTeamFieldsExceeded, - #[serde(rename = "backlogInError")] - BacklogInError, - #[serde(rename = "missingTeamFieldValue")] - MissingTeamFieldValue, - #[serde(rename = "noIterationsExist")] - NoIterationsExist, - } + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "ok")] + Ok, + #[serde(rename = "doesntExistOrAccessDenied")] + DoesntExistOrAccessDenied, + #[serde(rename = "maxTeamsExceeded")] + MaxTeamsExceeded, + #[serde(rename = "maxTeamFieldsExceeded")] + MaxTeamFieldsExceeded, + #[serde(rename = "backlogInError")] + BacklogInError, + #[serde(rename = "missingTeamFieldValue")] + MissingTeamFieldValue, + #[serde(rename = "noIterationsExist")] + NoIterationsExist, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdatePlan { - #[doc = "Description of the plan"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option<String>, - #[doc = "Name of the plan to create."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Plan properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option<serde_json::Value>, - #[doc = "Revision of the plan that was updated - the value used here should match the one the server gave the client in the Plan."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub revision: Option<i32>, - #[doc = "Type of the plan"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option<update_plan::Type>, + #[doc = "Description of the plan"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option<String>, + #[doc = "Name of the plan to create."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Plan properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option<serde_json::Value>, + #[doc = "Revision of the plan that was updated - the value used here should match the one the server gave the client in the Plan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub revision: Option<i32>, + #[doc = "Type of the plan"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option<update_plan::Type>, } impl UpdatePlan { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } pub mod update_plan { - use super::*; - #[doc = "Type of the plan"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - #[serde(rename = "deliveryTimelineView")] - DeliveryTimelineView, - } + use super::*; + #[doc = "Type of the plan"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "deliveryTimelineView")] + DeliveryTimelineView, + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateTaskboardColumn { - #[doc = "Column ID, keep it null for new column"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<String>, - #[doc = "Work item type states mapped to this column to support auto state update when column is updated."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub mappings: Vec<TaskboardColumnMapping>, - #[doc = "Column name is required"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "Column position relative to other columns in the same board"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub order: Option<i32>, + #[doc = "Column ID, keep it null for new column"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<String>, + #[doc = "Work item type states mapped to this column to support auto state update when column is updated."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub mappings: Vec<TaskboardColumnMapping>, + #[doc = "Column name is required"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "Column position relative to other columns in the same board"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option<i32>, } impl UpdateTaskboardColumn { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UpdateTaskboardWorkItemColumn { - #[serde(rename = "newColumn", default, skip_serializing_if = "Option::is_none")] - pub new_column: Option<String>, + #[serde(rename = "newColumn", default, skip_serializing_if = "Option::is_none")] + pub new_column: Option<String>, } impl UpdateTaskboardWorkItemColumn { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } -#[doc = "This class is used to serialize collections as a single JSON object on the wire."] +#[doc = "This class is used to serialized collections as a single JSON object on the wire, to avoid serializing JSON arrays directly to the client, which can be a security hole"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapper { - #[serde(flatten)] - pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, - #[doc = "The serialized item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option<String>, + #[serde(flatten)] + pub vss_json_collection_wrapper_base: VssJsonCollectionWrapperBase, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option<String>, } impl VssJsonCollectionWrapper { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct VssJsonCollectionWrapperBase { - #[doc = "The number of serialized items."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option<i32>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option<i32>, } impl VssJsonCollectionWrapperBase { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Describes a work item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItem { - #[serde(flatten)] - pub work_item_tracking_resource: WorkItemTrackingResource, - #[doc = "Represents the reference to a specific version of a comment on a Work Item."] - #[serde( - rename = "commentVersionRef", - default, - skip_serializing_if = "Option::is_none" - )] - pub comment_version_ref: Option<WorkItemCommentVersionRef>, - #[doc = "Map of field and values for the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fields: Option<serde_json::Value>, - #[doc = "The work item ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "Relations of the work item."] - #[serde( - default, - skip_serializing_if = "Vec::is_empty", - deserialize_with = "crate::serde::deserialize_null_default" - )] - pub relations: Vec<WorkItemRelation>, - #[doc = "Revision number of the work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rev: Option<i32>, + #[serde(flatten)] + pub work_item_tracking_resource: WorkItemTrackingResource, + #[doc = "Represents the reference to a specific version of a comment on a Work Item."] + #[serde( + rename = "commentVersionRef", + default, + skip_serializing_if = "Option::is_none" + )] + pub comment_version_ref: Option<WorkItemCommentVersionRef>, + #[doc = "Map of field and values for the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fields: Option<serde_json::Value>, + #[doc = "The work item ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "Relations of the work item."] + #[serde( + default, + skip_serializing_if = "Vec::is_empty", + deserialize_with = "crate::serde::deserialize_null_default" + )] + pub relations: Vec<WorkItemRelation>, + #[doc = "Revision number of the work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rev: Option<i32>, } impl WorkItem { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Work item color and icon."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemColor { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub icon: Option<String>, - #[serde( - rename = "primaryColor", - default, - skip_serializing_if = "Option::is_none" - )] - pub primary_color: Option<String>, - #[serde( - rename = "workItemTypeName", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type_name: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icon: Option<String>, + #[serde( + rename = "primaryColor", + default, + skip_serializing_if = "Option::is_none" + )] + pub primary_color: Option<String>, + #[serde( + rename = "workItemTypeName", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type_name: Option<String>, } impl WorkItemColor { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Represents the reference to a specific version of a comment on a Work Item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemCommentVersionRef { - #[serde(flatten)] - pub work_item_tracking_resource_reference: WorkItemTrackingResourceReference, - #[doc = "The id assigned to the comment."] - #[serde(rename = "commentId", default, skip_serializing_if = "Option::is_none")] - pub comment_id: Option<i32>, - #[doc = "\\[Internal\\] The work item revision where this comment was originally added."] - #[serde( - rename = "createdInRevision", - default, - skip_serializing_if = "Option::is_none" - )] - pub created_in_revision: Option<i32>, - #[doc = "\\[Internal\\] Specifies whether comment was deleted."] - #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] - pub is_deleted: Option<bool>, - #[doc = "\\[Internal\\] The text of the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option<String>, - #[doc = "The version number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option<i32>, + #[serde(flatten)] + pub work_item_tracking_resource_reference: WorkItemTrackingResourceReference, + #[doc = "The id assigned to the comment."] + #[serde(rename = "commentId", default, skip_serializing_if = "Option::is_none")] + pub comment_id: Option<i32>, + #[doc = "\\[Internal\\] The work item revision where this comment was originally added."] + #[serde( + rename = "createdInRevision", + default, + skip_serializing_if = "Option::is_none" + )] + pub created_in_revision: Option<i32>, + #[doc = "\\[Internal\\] Specifies whether comment was deleted."] + #[serde(rename = "isDeleted", default, skip_serializing_if = "Option::is_none")] + pub is_deleted: Option<bool>, + #[doc = "\\[Internal\\] The text of the comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option<String>, + #[doc = "The version number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<i32>, } impl WorkItemCommentVersionRef { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to a field in a work item"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemFieldReference { - #[doc = "The friendly name of the field."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, - #[doc = "The reference name of the field."] - #[serde( - rename = "referenceName", - default, - skip_serializing_if = "Option::is_none" - )] - pub reference_name: Option<String>, - #[doc = "The REST URL of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "The friendly name of the field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + #[doc = "The reference name of the field."] + #[serde( + rename = "referenceName", + default, + skip_serializing_if = "Option::is_none" + )] + pub reference_name: Option<String>, + #[doc = "The REST URL of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemFieldReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "A link between two work items."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemLink { - #[doc = "The type of link."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rel: Option<String>, - #[doc = "Contains reference to a work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option<WorkItemReference>, - #[doc = "Contains reference to a work item."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option<WorkItemReference>, + #[doc = "The type of link."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rel: Option<String>, + #[doc = "Contains reference to a work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option<WorkItemReference>, + #[doc = "Contains reference to a work item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option<WorkItemReference>, } impl WorkItemLink { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Contains reference to a work item."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemReference { - #[doc = "Work item ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option<i32>, - #[doc = "REST API URL of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[doc = "Work item ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option<i32>, + #[doc = "REST API URL of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemRelation { - #[serde(flatten)] - pub link: Link, + #[serde(flatten)] + pub link: Link, } impl WorkItemRelation { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Base class for WIT REST resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTrackingResource { - #[serde(flatten)] - pub work_item_tracking_resource_reference: WorkItemTrackingResourceReference, - #[doc = "Links"] - #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] - pub links: Option<serde_json::Value>, + #[serde(flatten)] + pub work_item_tracking_resource_reference: WorkItemTrackingResourceReference, + #[doc = "Links"] + #[serde(rename = "_links", default, skip_serializing_if = "Option::is_none")] + pub links: Option<serde_json::Value>, } impl WorkItemTrackingResource { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Base class for work item tracking resource references."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTrackingResourceReference { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option<String>, } impl WorkItemTrackingResourceReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = "Reference to a work item type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeReference { - #[serde(flatten)] - pub work_item_tracking_resource_reference: WorkItemTrackingResourceReference, - #[doc = "Name of the work item type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option<String>, + #[serde(flatten)] + pub work_item_tracking_resource_reference: WorkItemTrackingResourceReference, + #[doc = "Name of the work item type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option<String>, } impl WorkItemTypeReference { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct WorkItemTypeStateInfo { - #[doc = "State name to state category map"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub states: Option<serde_json::Value>, - #[doc = "Work Item type name"] - #[serde( - rename = "workItemTypeName", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_item_type_name: Option<String>, + #[doc = "State name to state category map"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub states: Option<serde_json::Value>, + #[doc = "Work Item type name"] + #[serde( + rename = "workItemTypeName", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_item_type_name: Option<String>, } impl WorkItemTypeStateInfo { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } #[doc = ""] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Attribute {} impl Attribute { - pub fn new() -> Self { - Self::default() - } + pub fn new() -> Self { + Self::default() + } } From 3f3aa94ec2c2f8bdec0d2bd28dcefc169c36e68e Mon Sep 17 00:00:00 2001 From: Aryslan Yakshibaev <Aryslan.Yakshibaev@kaspersky.com> Date: Fri, 22 Sep 2023 11:47:46 +0300 Subject: [PATCH 2/3] remove submodule --- vsts-rest-api-specs | 1 - 1 file changed, 1 deletion(-) delete mode 160000 vsts-rest-api-specs diff --git a/vsts-rest-api-specs b/vsts-rest-api-specs deleted file mode 160000 index 13fc259c..00000000 --- a/vsts-rest-api-specs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 13fc259c8c2cd3e99a2d8ab0c1d61948b9f1cde8 From d615f014786966deb3fa9d6fbca5613675603816 Mon Sep 17 00:00:00 2001 From: Aryslan Yakshibaev <Aryslan.Yakshibaev@kaspersky.com> Date: Mon, 9 Oct 2023 14:41:05 +0300 Subject: [PATCH 3/3] Add completion_options --- azure_devops_rust_api/src/git/models.rs | 7 + vsts-api-patcher/src/main.rs | 3341 +++++++++++------------ 2 files changed, 1666 insertions(+), 1682 deletions(-) diff --git a/azure_devops_rust_api/src/git/models.rs b/azure_devops_rust_api/src/git/models.rs index 20bc1019..9fe9ef2b 100644 --- a/azure_devops_rust_api/src/git/models.rs +++ b/azure_devops_rust_api/src/git/models.rs @@ -3951,6 +3951,13 @@ pub struct GitPullRequestUpdateOptions { skip_serializing_if = "Option::is_none" )] pub auto_complete_set_by: Option<IdentityRef>, + #[doc = "Preferences about how the pull request should be completed."] + #[serde( + rename = "completionOptions", + default, + skip_serializing_if = "Option::is_none" + )] + pub completion_options: Option<GitPullRequestCompletionOptions>, } impl GitPullRequestUpdateOptions { pub fn new() -> Self { diff --git a/vsts-api-patcher/src/main.rs b/vsts-api-patcher/src/main.rs index d515da9c..bbe93db7 100644 --- a/vsts-api-patcher/src/main.rs +++ b/vsts-api-patcher/src/main.rs @@ -15,690 +15,688 @@ const JSON_INDENT: u16 = 2; // List of documentation patches. // Any matches of the first string are replaced with the second. const DOC_PATCHES: &[(&str, &str)] = &[ - ("file name of item returned.", "File name of item returned."), - ("definitionId", "definition_id"), - ("[optional] True", "(optional) Set to true"), - ("$format", "format"), - ("fileName", "filename"), - ("True to", "Set to true to"), - ("getTopPackageVersions", "get_top_package_versions"), - ("includeAllVersions", "include_all_versions"), - ("detailsToInclude", "details_to_include"), - ("continuationToken", "continuation token"), - ("dislayed", "displayed"), - ( - "Numbe of attachments reference", - "Number of attachment references", - ), - ( - "Number of attachments reference to return", - "Number of attachment references to return", - ), - ( - "directory path of attachments to get", - "Directory path of attachments to get", - ), - ( - "file name prefix to filter the list of attachment", - "Filename prefix to filter the list of attachments", - ), - ( - "Number of test points to skip..", - "Number of test points to skip.", - ), - ("[Internal]", r"\[Internal\]"), - ("[optional]", r"\[optional\]"), - ("[Obsolete]", r"\[Obsolete\]"), - ("[DEPRECATED]", r"\[DEPRECATED\]"), - ("[Readonly]", r"\[Readonly\]"), - ("[DataMember]", r"\[DataMember\]"), - ("[n]", r"\[n\]"), - ( - r#"<![CDATA[ @, ~, ;, {, }, \, +, =, <, >, |, /, \\, ?, :, &, $, *, \", #, [, ] ]]>"#, - r#"<!\[CDATA\[ @, ~, ;, {, }, \\, +, =, <, >, |, /, \\\\, ?, :, &, $, *, \", #, \[, \] \]\]>"#, - ), - ( - "[Provided for legacy reasons]", - r"\[Provided for legacy reasons\]", - ), + ("file name of item returned.", "File name of item returned."), + ("definitionId", "definition_id"), + ("[optional] True", "(optional) Set to true"), + ("$format", "format"), + ("fileName", "filename"), + ("True to", "Set to true to"), + ("getTopPackageVersions", "get_top_package_versions"), + ("includeAllVersions", "include_all_versions"), + ("detailsToInclude", "details_to_include"), + ("continuationToken", "continuation token"), + ("dislayed", "displayed"), + ( + "Numbe of attachments reference", + "Number of attachment references", + ), + ( + "Number of attachments reference to return", + "Number of attachment references to return", + ), + ( + "directory path of attachments to get", + "Directory path of attachments to get", + ), + ( + "file name prefix to filter the list of attachment", + "Filename prefix to filter the list of attachments", + ), + ( + "Number of test points to skip..", + "Number of test points to skip.", + ), + ("[Internal]", r"\[Internal\]"), + ("[optional]", r"\[optional\]"), + ("[Obsolete]", r"\[Obsolete\]"), + ("[DEPRECATED]", r"\[DEPRECATED\]"), + ("[Readonly]", r"\[Readonly\]"), + ("[DataMember]", r"\[DataMember\]"), + ("[n]", r"\[n\]"), + ( + r#"<![CDATA[ @, ~, ;, {, }, \, +, =, <, >, |, /, \\, ?, :, &, $, *, \", #, [, ] ]]>"#, + r#"<!\[CDATA\[ @, ~, ;, {, }, \\, +, =, <, >, |, /, \\\\, ?, :, &, $, *, \", #, \[, \] \]\]>"#, + ), + ( + "[Provided for legacy reasons]", + r"\[Provided for legacy reasons\]", + ), ]; const SPEC_DESCRIPTIONS: &[(&str, &str)] = &[ - ("git.json", "Git repositories"), - ("workItemTracking.json", "Work item tracking"), + ("git.json", "Git repositories"), + ("workItemTracking.json", "Work item tracking"), ]; struct Patcher { - spec_path: PathBuf, - new_definitions: BTreeMap<String, JsonValue>, + spec_path: PathBuf, + new_definitions: BTreeMap<String, JsonValue>, } // Return true if the specified `entry` appears to be a an OpenAPI specification filename fn is_spec(entry: &DirEntry) -> bool { - let path = entry.path().to_string_lossy().to_string(); - path.ends_with(".json") && !path.contains("httpExamples") + let path = entry.path().to_string_lossy().to_string(); + path.ends_with(".json") && !path.contains("httpExamples") } // Performs preprocessing of spec text immediately after loading fn preprocess_spec(spec_path: &Path, data: String) -> String { - if spec_path.ends_with("workItemTracking.json") { - // Fix up formatting of `$filter` query parameter - codegen fails with the $ prefix in the template. - data.replace( - "/{organization}/{project}/_apis/wit/queries?$filter={$filter}", - "/{organization}/{project}/_apis/wit/queries?$filter={filter}", - ) - } else { - data - } + if spec_path.ends_with("workItemTracking.json") { + // Fix up formatting of `$filter` query parameter - codegen fails with the $ prefix in the template. + data.replace( + "/{organization}/{project}/_apis/wit/queries?$filter={$filter}", + "/{organization}/{project}/_apis/wit/queries?$filter={filter}", + ) + } else { + data + } } fn main() -> Result<()> { - let path = Path::new(ORIGINAL_VSTS_SPECS_DIR).join("specification"); - let spec_paths: Vec<PathBuf> = WalkDir::new(path) - .into_iter() - .filter_map(|e| e.ok()) - .filter(is_spec) - .map(|dir_entry| dir_entry.path().to_path_buf()) - .collect(); - - println!("{:#?}", spec_paths); - - for spec_path in &spec_paths { - let bytes = std::fs::read(spec_path)?; - - // Strip BOM (Byte Order Mark) if present. - // https://en.wikipedia.org/wiki/Byte_order_mark - // Spoiler alert: It is present in vsts-rest-api-specs. - let bytes = match bytes[..] { - [0xEF, 0xBB, 0xBF, ..] => &bytes[3..], - _ => &bytes, - }; - - let data = - std::str::from_utf8(bytes).context(format!("File is not valid UTF8: {spec_path:?}"))?; - - let data = preprocess_spec(spec_path, data.to_string()); - - let mut json = json::parse(&data)?; - let mut patcher = Patcher::new(spec_path); - patcher.run(&mut json); - - let new_spec_name = &spec_path - .to_string_lossy() - .replace("/vsts-rest-api-specs/", "/vsts-rest-api-specs.patched/"); - - let new_spec_path = Path::new(&new_spec_name); - let new_spec_dir = new_spec_path.parent().unwrap(); - std::fs::create_dir_all(new_spec_dir) - .context(format!("Failed to create {}", new_spec_dir.display()))?; - - let json_data = json::stringify_pretty(json, JSON_INDENT); - let mut f = File::create(new_spec_path)?; - f.write_all(format!("{json_data}\n").as_bytes())?; - println!("{spec_path:#?} -> {new_spec_path:#?}"); - } - - Ok(()) + let path = Path::new(ORIGINAL_VSTS_SPECS_DIR).join("specification"); + let spec_paths: Vec<PathBuf> = WalkDir::new(path) + .into_iter() + .filter_map(|e| e.ok()) + .filter(is_spec) + .map(|dir_entry| dir_entry.path().to_path_buf()) + .collect(); + + println!("{:#?}", spec_paths); + + for spec_path in &spec_paths { + let bytes = std::fs::read(spec_path)?; + + // Strip BOM (Byte Order Mark) if present. + // https://en.wikipedia.org/wiki/Byte_order_mark + // Spoiler alert: It is present in vsts-rest-api-specs. + let bytes = match bytes[..] { + [0xEF, 0xBB, 0xBF, ..] => &bytes[3..], + _ => &bytes, + }; + + let data = + std::str::from_utf8(bytes).context(format!("File is not valid UTF8: {spec_path:?}"))?; + + let data = preprocess_spec(spec_path, data.to_string()); + + let mut json = json::parse(&data)?; + let mut patcher = Patcher::new(spec_path); + patcher.run(&mut json); + + let new_spec_name = &spec_path + .to_string_lossy() + .replace("/vsts-rest-api-specs/", "/vsts-rest-api-specs.patched/"); + + let new_spec_path = Path::new(&new_spec_name); + let new_spec_dir = new_spec_path.parent().unwrap(); + std::fs::create_dir_all(new_spec_dir) + .context(format!("Failed to create {}", new_spec_dir.display()))?; + + let json_data = json::stringify_pretty(json, JSON_INDENT); + let mut f = File::create(new_spec_path)?; + f.write_all(format!("{json_data}\n").as_bytes())?; + println!("{spec_path:#?} -> {new_spec_path:#?}"); + } + + Ok(()) } type PatcherFn = fn(&mut Patcher, &[&str], &JsonValue) -> Option<JsonValue>; impl Patcher { - const PATCH_FNS: &'static [PatcherFn] = &[ - Patcher::patch_spec_descriptions, - Patcher::patch_json_reference_links, - Patcher::patch_teamproject_visibility_enum, - Patcher::patch_array_array_schema, - Patcher::patch_response_schema, - Patcher::patch_git_reference_links, - Patcher::patch_pipelines_reference_links, - Patcher::patch_build_reference_links, - Patcher::patch_pipelines_pipeline_configuration, - Patcher::patch_pipeline, - Patcher::patch_docs, - Patcher::patch_git_commit_change_counts, - Patcher::patch_git_change, - Patcher::patch_git_policy_configuration, - Patcher::patch_git_pull_request_create, - Patcher::patch_git_pull_request_update, - Patcher::patch_ims_identity_base, - Patcher::patch_input_validation_min_max, - Patcher::patch_probation_retries_type, - Patcher::patch_operation_status_in_releases, - Patcher::patch_extension_flags, - Patcher::patch_wit_create_update_item, - Patcher::patch_wit_identity_reference, - Patcher::patch_wiki_pages_update, - Patcher::patch_jobjects, - Patcher::patch_identity_descriptors, - Patcher::patch_security, - // This must be done after the other patches - Patcher::patch_definition_required_fields, - ]; - - fn new(spec_path: &Path) -> Patcher { - Patcher { - spec_path: spec_path.into(), - new_definitions: BTreeMap::new(), - } + const PATCH_FNS: &'static [PatcherFn] = &[ + Patcher::patch_spec_descriptions, + Patcher::patch_json_reference_links, + Patcher::patch_teamproject_visibility_enum, + Patcher::patch_array_array_schema, + Patcher::patch_response_schema, + Patcher::patch_git_reference_links, + Patcher::patch_pipelines_reference_links, + Patcher::patch_build_reference_links, + Patcher::patch_pipelines_pipeline_configuration, + Patcher::patch_pipeline, + Patcher::patch_docs, + Patcher::patch_git_commit_change_counts, + Patcher::patch_git_change, + Patcher::patch_git_policy_configuration, + Patcher::patch_git_pull_request_create, + Patcher::patch_git_pull_request_update, + Patcher::patch_ims_identity_base, + Patcher::patch_input_validation_min_max, + Patcher::patch_probation_retries_type, + Patcher::patch_operation_status_in_releases, + Patcher::patch_extension_flags, + Patcher::patch_wit_create_update_item, + Patcher::patch_wit_identity_reference, + Patcher::patch_wiki_pages_update, + Patcher::patch_jobjects, + Patcher::patch_identity_descriptors, + Patcher::patch_security, + // This must be done after the other patches + Patcher::patch_definition_required_fields, + ]; + + fn new(spec_path: &Path) -> Patcher { + Patcher { + spec_path: spec_path.into(), + new_definitions: BTreeMap::new(), } - - fn patch_json_reference_links(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { - match key { - ["definitions", schema_name, "properties", "_links"] => { - if *value != json::object! { "$ref": "#/definitions/ReferenceLinks" } { - println!("Replace _links definition for {}", schema_name); - Some(json::object! { - "description": "Links", - "type": "object", - }) - } else { - println!("Skip replacing _links definition for {}", schema_name); - None - } - } - _ => None, + } + + fn patch_json_reference_links(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { + match key { + ["definitions", schema_name, "properties", "_links"] => { + if *value != json::object! { "$ref": "#/definitions/ReferenceLinks" } { + println!("Replace _links definition for {}", schema_name); + Some(json::object! { + "description": "Links", + "type": "object", + }) + } else { + println!("Skip replacing _links definition for {}", schema_name); + None } + } + _ => None, } - - fn add_link_definition(&mut self) { - // Add `Link` definition - self.new_definitions.insert( - "Link".to_string(), - json::object! { - "description": "Link URL", - "type": "object", - "required": [ "href" ], - "properties": { - "href": { - "type": "string" - } + } + + fn add_link_definition(&mut self) { + // Add `Link` definition + self.new_definitions.insert( + "Link".to_string(), + json::object! { + "description": "Link URL", + "type": "object", + "required": [ "href" ], + "properties": { + "href": { + "type": "string" + } + } + }, + ); + } + + fn patch_pipeline(&mut self, key: &[&str], _value: &JsonValue) -> Option<JsonValue> { + // Only applies to pipelines specs + if !self.spec_path.ends_with("pipelines.json") { + return None; + } + match key { + ["definitions", "Pipeline"] => { + println!("Replace Pipeline definition"); + Some(json::object! { + "description": "Definition of a pipeline.", + "type": "object", + "properties": { + "_links": { + "$ref": "#/definitions/ReferenceLinks" + }, + "configuration": { + "$ref": "#/definitions/PipelineConfiguration" + }, + "url": { + "description": "URL of the pipeline", + "type": "string" + }, + "folder": { + "description": "Pipeline folder", + "type": "string" + }, + "id": { + "description": "Pipeline ID", + "type": "integer", + "format": "int32" + }, + "name": { + "description": "Pipeline name", + "type": "string" + }, + "revision": { + "description": "Revision number", + "type": "integer", + "format": "int32" } }, - ); + "required": [ + "_links", + "url", + "folder", + "id", + "name", + "revision" + ] + }) + } + _ => None, } - - fn patch_pipeline(&mut self, key: &[&str], _value: &JsonValue) -> Option<JsonValue> { - // Only applies to pipelines specs - if !self.spec_path.ends_with("pipelines.json") { - return None; + } + + fn patch_spec_descriptions(&mut self, key: &[&str], _value: &JsonValue) -> Option<JsonValue> { + for (filename, desc) in SPEC_DESCRIPTIONS { + if !self.spec_path.ends_with(filename) { + continue; + } + + #[allow(clippy::single_match)] + match key { + ["info", "description"] => { + println!("Patching spec description: {}: {}", filename, desc); + return Some(JsonValue::from(*desc)); } - match key { - ["definitions", "Pipeline"] => { - println!("Replace Pipeline definition"); - Some(json::object! { - "description": "Definition of a pipeline.", - "type": "object", - "properties": { - "_links": { - "$ref": "#/definitions/ReferenceLinks" - }, - "configuration": { - "$ref": "#/definitions/PipelineConfiguration" - }, - "url": { - "description": "URL of the pipeline", - "type": "string" + _ => (), + } + } + None + } + + fn patch_ims_identity_base(&mut self, key: &[&str], _value: &JsonValue) -> Option<JsonValue> { + // Only applies to ims (identities.json) specs + if !self.spec_path.ends_with("identities.json") { + return None; + } + match key { + ["definitions", "IdentityBase", "properties", "descriptor"] => { + println!("Patching ims IdentityBase descriptor"); + Some(json::object! { + "description": "Identity descriptor", + "type": "string" + }) + } + _ => None, + } + } + + fn patch_pipelines_pipeline_configuration( + &mut self, + key: &[&str], + _value: &JsonValue, + ) -> Option<JsonValue> { + // Only applies to pipelines specs + if !self.spec_path.ends_with("pipelines.json") { + return None; + } + match key { + ["definitions", "PipelineConfiguration", "properties"] => { + println!("Modify PipelineConfiguration definition"); + Some(json::object! { + "type": { + "enum": [ + "unknown", + "yaml", + "designerJson", + "justInTime", + "designerHyphenJson" + ], + "x-ms-enum": { + "name": "ConfigurationType", + "values": [ + { + "value": "unknown", + "description": "Unknown type." }, - "folder": { - "description": "Pipeline folder", - "type": "string" + { + "value": "yaml", + "description": "YAML." }, - "id": { - "description": "Pipeline ID", - "type": "integer", - "format": "int32" + { + "value": "designerJson", + "description": "Designer JSON." }, - "name": { - "description": "Pipeline name", - "type": "string" + { + "value": "justInTime", + "description": "Just-in-time." }, - "revision": { - "description": "Revision number", - "type": "integer", - "format": "int32" + { + "value": "designerHyphenJson", + "description": "Designer-JSON." } - }, - "required": [ - "_links", - "url", - "folder", - "id", - "name", - "revision" ] - }) - } - _ => None, - } - } - - fn patch_spec_descriptions(&mut self, key: &[&str], _value: &JsonValue) -> Option<JsonValue> { - for (filename, desc) in SPEC_DESCRIPTIONS { - if !self.spec_path.ends_with(filename) { - continue; - } - - #[allow(clippy::single_match)] - match key { - ["info", "description"] => { - println!("Patching spec description: {}: {}", filename, desc); - return Some(JsonValue::from(*desc)); } - _ => (), - } - } - None - } - - fn patch_ims_identity_base(&mut self, key: &[&str], _value: &JsonValue) -> Option<JsonValue> { - // Only applies to ims (identities.json) specs - if !self.spec_path.ends_with("identities.json") { - return None; - } - match key { - ["definitions", "IdentityBase", "properties", "descriptor"] => { - println!("Patching ims IdentityBase descriptor"); - Some(json::object! { - "description": "Identity descriptor", - "type": "string" - }) - } - _ => None, - } - } - - fn patch_pipelines_pipeline_configuration( - &mut self, - key: &[&str], - _value: &JsonValue, - ) -> Option<JsonValue> { - // Only applies to pipelines specs - if !self.spec_path.ends_with("pipelines.json") { - return None; - } - match key { - ["definitions", "PipelineConfiguration", "properties"] => { - println!("Modify PipelineConfiguration definition"); - Some(json::object! { - "type": { - "enum": [ - "unknown", - "yaml", - "designerJson", - "justInTime", - "designerHyphenJson" - ], - "x-ms-enum": { - "name": "ConfigurationType", - "values": [ - { - "value": "unknown", - "description": "Unknown type." - }, - { - "value": "yaml", - "description": "YAML." - }, - { - "value": "designerJson", - "description": "Designer JSON." - }, - { - "value": "justInTime", - "description": "Just-in-time." - }, - { - "value": "designerHyphenJson", - "description": "Designer-JSON." - } - ] - } - }, - "path": { + }, + "path": { + "type": "string" + }, + "repository": { + "type": "object", + "properties": { + "id": { "type": "string" }, - "repository": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string" - } - }, + "type": { + "type": "string" } - }) + }, } - _ => None, - } + }) + } + _ => None, } - - fn patch_operation_status_in_releases( - &mut self, - key: &[&str], - _value: &JsonValue, - ) -> Option<JsonValue> { - // Only applies to release specs - if !self.spec_path.ends_with("release.json") { - return None; - } - match key { - ["definitions", "Deployment", "properties", "operationStatus"] => { - Some(self.patched_operation_status("Gets operation status of deployment.")) - } - ["definitions", "DeploymentQueryParameters", "properties", "operationStatus"] => { - Some(self.patched_operation_status( - "Query deployment based on deployment operation status.", - )) - } - ["definitions", "DeploymentAttempt", "properties", "operationStatus"] => { - Some(self.patched_operation_status("Deployment operation status.")) - } - - _ => None, - } + } + + fn patch_operation_status_in_releases( + &mut self, + key: &[&str], + _value: &JsonValue, + ) -> Option<JsonValue> { + // Only applies to release specs + if !self.spec_path.ends_with("release.json") { + return None; } - - fn patched_operation_status(&self, description: &str) -> JsonValue { - json::object! { - "description": description, - "enum": [ - "Undefined", - "Queued", - "Scheduled", - "Pending", - "Approved", - "Rejected", - "Deferred", - "QueuedForAgent", - "PhaseInProgress", - "PhaseSucceeded", - "PhasePartiallySucceeded", - "PhaseFailed", - "Canceled", - "PhaseCanceled", - "ManualInterventionPending", - "QueuedForPipeline", - "Cancelling", - "EvaluatingGates", - "GateFailed", - "All" - ], - "x-ms-enum": { - "name": "DeploymentOperationStatus", - "values": [ - { - "value": "Undefined", - "description": "The deployment operation status is undefined." - }, - { - "value": "Queued", - "description": "The deployment operation status is queued." - }, - { - "value": "Scheduled", - "description": "The deployment operation status is scheduled." - }, - { - "value": "Pending", - "description": "The deployment operation status is pending." - }, - { - "value": "Approved", - "description": "The deployment operation status is approved." - }, - { - "value": "Rejected", - "description": "The deployment operation status is rejected." - }, - { - "value": "Deferred", - "description": "The deployment operation status is deferred." - }, - { - "value": "QueuedForAgent", - "description": "The deployment operation status is queued for agent." - }, - { - "value": "PhaseInProgress", - "description": "The deployment operation status is phase in progress." - }, - { - "value": "PhaseSucceeded", - "description": "The deployment operation status is phase succeeded." - }, - { - "value": "PhasePartiallySucceeded", - "description": "The deployment operation status is phase partially succeeded." - }, - { - "value": "PhaseFailed", - "description": "The deployment operation status is phase failed." - }, - { - "value": "Canceled", - "description": "The deployment operation status is canceled." - }, - { - "value": "PhaseCanceled", - "description": "The deployment operation status is phase canceled." - }, - { - "value": "ManualInterventionPending", - "description": "The deployment operation status is manualintervention pending." - }, - { - "value": "QueuedForPipeline", - "description": "The deployment operation status is queued for pipeline." - }, - { - "value": "Cancelling", - "description": "The deployment operation status is cancelling." - }, - { - "value": "EvaluatingGates", - "description": "The deployment operation status is EvaluatingGates." - }, - { - "value": "GateFailed", - "description": "The deployment operation status is GateFailed." - }, - { - "value": "All", - "description": "The deployment operation status is all." - } - ] + match key { + ["definitions", "Deployment", "properties", "operationStatus"] => { + Some(self.patched_operation_status("Gets operation status of deployment.")) + } + ["definitions", "DeploymentQueryParameters", "properties", "operationStatus"] => Some( + self.patched_operation_status("Query deployment based on deployment operation status."), + ), + ["definitions", "DeploymentAttempt", "properties", "operationStatus"] => { + Some(self.patched_operation_status("Deployment operation status.")) + } + + _ => None, + } + } + + fn patched_operation_status(&self, description: &str) -> JsonValue { + json::object! { + "description": description, + "enum": [ + "Undefined", + "Queued", + "Scheduled", + "Pending", + "Approved", + "Rejected", + "Deferred", + "QueuedForAgent", + "PhaseInProgress", + "PhaseSucceeded", + "PhasePartiallySucceeded", + "PhaseFailed", + "Canceled", + "PhaseCanceled", + "ManualInterventionPending", + "QueuedForPipeline", + "Cancelling", + "EvaluatingGates", + "GateFailed", + "All" + ], + "x-ms-enum": { + "name": "DeploymentOperationStatus", + "values": [ + { + "value": "Undefined", + "description": "The deployment operation status is undefined." + }, + { + "value": "Queued", + "description": "The deployment operation status is queued." + }, + { + "value": "Scheduled", + "description": "The deployment operation status is scheduled." + }, + { + "value": "Pending", + "description": "The deployment operation status is pending." + }, + { + "value": "Approved", + "description": "The deployment operation status is approved." + }, + { + "value": "Rejected", + "description": "The deployment operation status is rejected." + }, + { + "value": "Deferred", + "description": "The deployment operation status is deferred." + }, + { + "value": "QueuedForAgent", + "description": "The deployment operation status is queued for agent." + }, + { + "value": "PhaseInProgress", + "description": "The deployment operation status is phase in progress." + }, + { + "value": "PhaseSucceeded", + "description": "The deployment operation status is phase succeeded." + }, + { + "value": "PhasePartiallySucceeded", + "description": "The deployment operation status is phase partially succeeded." + }, + { + "value": "PhaseFailed", + "description": "The deployment operation status is phase failed." + }, + { + "value": "Canceled", + "description": "The deployment operation status is canceled." + }, + { + "value": "PhaseCanceled", + "description": "The deployment operation status is phase canceled." + }, + { + "value": "ManualInterventionPending", + "description": "The deployment operation status is manualintervention pending." + }, + { + "value": "QueuedForPipeline", + "description": "The deployment operation status is queued for pipeline." + }, + { + "value": "Cancelling", + "description": "The deployment operation status is cancelling." + }, + { + "value": "EvaluatingGates", + "description": "The deployment operation status is EvaluatingGates." + }, + { + "value": "GateFailed", + "description": "The deployment operation status is GateFailed." + }, + { + "value": "All", + "description": "The deployment operation status is all." } - } + ] + } } - - fn patch_pipelines_reference_links( - &mut self, - key: &[&str], - _value: &JsonValue, - ) -> Option<JsonValue> { - // Only applies to pipelines specs - if !self.spec_path.ends_with("pipelines.json") { - return None; - } - match key { - ["definitions", "ReferenceLinks", "properties"] => { - println!("Replace pipelines ReferenceLinks definition"); - self.add_link_definition(); - - // Add all links that we are aware of. - Some(json::object! { - "self": { - "$ref": "#/definitions/Link" - }, - "web": { - "$ref": "#/definitions/Link" - } - }) - } - _ => None, - } + } + + fn patch_pipelines_reference_links( + &mut self, + key: &[&str], + _value: &JsonValue, + ) -> Option<JsonValue> { + // Only applies to pipelines specs + if !self.spec_path.ends_with("pipelines.json") { + return None; } - - fn patch_git_commit_change_counts( - &mut self, - key: &[&str], - _value: &JsonValue, - ) -> Option<JsonValue> { - // Only applies to git specs - if !self.spec_path.ends_with("git.json") { - return None; - } - match key { - ["definitions", "GitCommitChanges" | "GitCommitRef", "properties", "changeCounts"] => { - println!("Replace git GitCommitChanges/GitCommitRef changeCounts definition"); - - Some(json::object! { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "int32" - } - }) - } - _ => None, - } + match key { + ["definitions", "ReferenceLinks", "properties"] => { + println!("Replace pipelines ReferenceLinks definition"); + self.add_link_definition(); + + // Add all links that we are aware of. + Some(json::object! { + "self": { + "$ref": "#/definitions/Link" + }, + "web": { + "$ref": "#/definitions/Link" + } + }) + } + _ => None, } - - fn patch_git_change(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { - // Only applies to git specs - if !self.spec_path.ends_with("git.json") { - return None; - } - match key { - ["definitions", "GitChange", "properties"] => { - println!("Remove unused git GitChange properties"); - // Remove properties that never seem to be used - let mut value = value.clone(); - value.remove("changeId"); - value.remove("newContentTemplate"); - value.remove("originalPath"); - Some(value) - } - ["definitions", "Change", "properties"] => { - println!("Remove unused git Change properties"); - // Remove properties that never seem to be used - let mut value = value.clone(); - value.remove("newContent"); - value.remove("sourceServerItem"); - value.remove("url"); - Some(value) - } - ["definitions", "Change", "properties", "item"] => { - println!("Replace git Change item definition"); - - Some(json::object! { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "int32" - } - }) - } - _ => None, - } + } + + fn patch_git_commit_change_counts( + &mut self, + key: &[&str], + _value: &JsonValue, + ) -> Option<JsonValue> { + // Only applies to git specs + if !self.spec_path.ends_with("git.json") { + return None; } - - // The git `PolicyConfiguration` proerties.settings field is specified as: - // "settings": { - // "description": "The policy configuration settings.", - // "type": "string", - // "format": "JObject" - // } - // - // Replace this with: - // "settings": { - // "description": "The policy configuration settings.", - // "type": "object" - // } - fn patch_git_policy_configuration( - &mut self, - key: &[&str], - _value: &JsonValue, - ) -> Option<JsonValue> { - // Only applies to git specs - if !self.spec_path.ends_with("git.json") { - return None; - } - match key { - ["definitions", "PolicyConfiguration", "properties", "settings"] => { - println!("Fix PolicyConfiguration settings"); - Some(json::object! { - "description": "The policy configuration settings.", - "type": "object", - }) + match key { + ["definitions", "GitCommitChanges" | "GitCommitRef", "properties", "changeCounts"] => { + println!("Replace git GitCommitChanges/GitCommitRef changeCounts definition"); + + Some(json::object! { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int32" } - _ => None, - } + }) + } + _ => None, } + } - fn patch_git_reference_links(&mut self, key: &[&str], _value: &JsonValue) -> Option<JsonValue> { - // Only applies to git specs - if !self.spec_path.ends_with("git.json") { - return None; - } - match key { - ["definitions", "ReferenceLinks", "properties"] => { - println!("Replace git ReferenceLinks definition"); - self.add_link_definition(); - - // Add all links that we are aware of. - Some(json::object! { - "commits": { - "$ref": "#/definitions/Link" - }, - "items": { - "$ref": "#/definitions/Link" - }, - "project": { - "$ref": "#/definitions/Link" - }, - "pullRequests": { - "$ref": "#/definitions/Link" - }, - "pushes": { - "$ref": "#/definitions/Link" - }, - "refs": { - "$ref": "#/definitions/Link" - }, - "self": { - "$ref": "#/definitions/Link" - }, - "ssh": { - "$ref": "#/definitions/Link" - }, - "web": { - "$ref": "#/definitions/Link" - } - }) + fn patch_git_change(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { + // Only applies to git specs + if !self.spec_path.ends_with("git.json") { + return None; + } + match key { + ["definitions", "GitChange", "properties"] => { + println!("Remove unused git GitChange properties"); + // Remove properties that never seem to be used + let mut value = value.clone(); + value.remove("changeId"); + value.remove("newContentTemplate"); + value.remove("originalPath"); + Some(value) + } + ["definitions", "Change", "properties"] => { + println!("Remove unused git Change properties"); + // Remove properties that never seem to be used + let mut value = value.clone(); + value.remove("newContent"); + value.remove("sourceServerItem"); + value.remove("url"); + Some(value) + } + ["definitions", "Change", "properties", "item"] => { + println!("Replace git Change item definition"); + + Some(json::object! { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int32" } - _ => None, - } + }) + } + _ => None, + } + } + + // The git `PolicyConfiguration` proerties.settings field is specified as: + // "settings": { + // "description": "The policy configuration settings.", + // "type": "string", + // "format": "JObject" + // } + // + // Replace this with: + // "settings": { + // "description": "The policy configuration settings.", + // "type": "object" + // } + fn patch_git_policy_configuration( + &mut self, + key: &[&str], + _value: &JsonValue, + ) -> Option<JsonValue> { + // Only applies to git specs + if !self.spec_path.ends_with("git.json") { + return None; } + match key { + ["definitions", "PolicyConfiguration", "properties", "settings"] => { + println!("Fix PolicyConfiguration settings"); + Some(json::object! { + "description": "The policy configuration settings.", + "type": "object", + }) + } + _ => None, + } + } - fn patch_git_pull_request_create( - &mut self, - key: &[&str], - _value: &JsonValue, - ) -> Option<JsonValue> { - // Only applies to git specs - if !self.spec_path.ends_with("git.json") { - return None; - } - println!("PR: {:?}", key); - match key { - ["paths", "/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests", "post", "parameters"] => - { - println!("Replace git create Pull Request parameters"); - self.new_definitions.insert( + fn patch_git_reference_links(&mut self, key: &[&str], _value: &JsonValue) -> Option<JsonValue> { + // Only applies to git specs + if !self.spec_path.ends_with("git.json") { + return None; + } + match key { + ["definitions", "ReferenceLinks", "properties"] => { + println!("Replace git ReferenceLinks definition"); + self.add_link_definition(); + + // Add all links that we are aware of. + Some(json::object! { + "commits": { + "$ref": "#/definitions/Link" + }, + "items": { + "$ref": "#/definitions/Link" + }, + "project": { + "$ref": "#/definitions/Link" + }, + "pullRequests": { + "$ref": "#/definitions/Link" + }, + "pushes": { + "$ref": "#/definitions/Link" + }, + "refs": { + "$ref": "#/definitions/Link" + }, + "self": { + "$ref": "#/definitions/Link" + }, + "ssh": { + "$ref": "#/definitions/Link" + }, + "web": { + "$ref": "#/definitions/Link" + } + }) + } + _ => None, + } + } + + fn patch_git_pull_request_create( + &mut self, + key: &[&str], + _value: &JsonValue, + ) -> Option<JsonValue> { + // Only applies to git specs + if !self.spec_path.ends_with("git.json") { + return None; + } + println!("PR: {:?}", key); + match key { + ["paths", "/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests", "post", "parameters"] => + { + println!("Replace git create Pull Request parameters"); + self.new_definitions.insert( "GitPullRequestCreateOptions".to_string(), json::object! { "description": "Pull Request create options", @@ -758,95 +756,95 @@ impl Patcher { } ); - self.new_definitions.insert( - "IdentityId".to_string(), - json::object! { - "description": "Identity id", - "type": "object", - "required": [ "id" ], - "properties": { - "id": { - "description": "The user identity", - "type": "string" - } - } - }, - ); - - Some(json::array![ - { - "in": "path", - "name": "organization", - "description": "The name of the Azure DevOps organization.", - "required": true, - "type": "string" - }, - { - "in": "path", - "name": "repositoryId", - "description": "The repository ID of the pull request's target branch.", - "required": true, - "type": "string" - }, - { - "in": "path", - "name": "project", - "description": "Project ID or project name", - "required": true, - "x-ms-required": false, - "type": "string" - }, - { - "in": "body", - "name": "createOptions", - "description": "The pull request to create.", - "required": true, - "schema": { - "$ref": "#/definitions/GitPullRequestCreateOptions" - } - }, - { - "in": "query", - "name": "supportsIterations", - "description": "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.", - "required": false, - "type": "boolean" - }, - { - "$ref": "#/parameters/api-Version-preview.1" + self.new_definitions.insert( + "IdentityId".to_string(), + json::object! { + "description": "Identity id", + "type": "object", + "required": [ "id" ], + "properties": { + "id": { + "description": "The user identity", + "type": "string" } - ]) + } + }, + ); + + Some(json::array![ + { + "in": "path", + "name": "organization", + "description": "The name of the Azure DevOps organization.", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "repositoryId", + "description": "The repository ID of the pull request's target branch.", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "project", + "description": "Project ID or project name", + "required": true, + "x-ms-required": false, + "type": "string" + }, + { + "in": "body", + "name": "createOptions", + "description": "The pull request to create.", + "required": true, + "schema": { + "$ref": "#/definitions/GitPullRequestCreateOptions" + } + }, + { + "in": "query", + "name": "supportsIterations", + "description": "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.", + "required": false, + "type": "boolean" + }, + { + "$ref": "#/parameters/api-Version-preview.1" } - // The spec says that the response code is 200, but the server actually returns 201 - ["paths", "/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests", "post", "responses"] => { - Some(json::object! { - "201": { - "description": "successful operation", - "schema": { - "$ref": "#/definitions/GitPullRequest" - } - } - }) + ]) + } + // The spec says that the response code is 200, but the server actually returns 201 + ["paths", "/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests", "post", "responses"] => { + Some(json::object! { + "201": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/GitPullRequest" + } } - _ => None, - } + }) + } + _ => None, } - - fn patch_git_pull_request_update( - &mut self, - key: &[&str], - _value: &JsonValue, - ) -> Option<JsonValue> { - // Only applies to git specs - if !self.spec_path.ends_with("git.json") { - return None; - } - println!("PR: {:?}", key); - match key { - ["paths", "/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests/{pullRequestId}", "patch", "parameters"] => - { - println!("Replace git update Pull Request parameters"); - self.new_definitions.insert( + } + + fn patch_git_pull_request_update( + &mut self, + key: &[&str], + _value: &JsonValue, + ) -> Option<JsonValue> { + // Only applies to git specs + if !self.spec_path.ends_with("git.json") { + return None; + } + println!("PR: {:?}", key); + match key { + ["paths", "/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests/{pullRequestId}", "patch", "parameters"] => + { + println!("Replace git update Pull Request parameters"); + self.new_definitions.insert( "GitPullRequestUpdateOptions".to_string(), json::object! { "description": "Pull Request update options", @@ -878,219 +876,215 @@ impl Patcher { "autoCompleteSetBy": { "description": "If set, auto-complete is enabled for this pull request and this is the identity that enabled it.", "$ref": "#/definitions/IdentityRef" + }, + "completionOptions": { + "description": "Options which affect how the pull request will be merged when it is completed.", + "$ref": "#/definitions/GitPullRequestCompletionOptions" } } }, ); - self.new_definitions.insert( - "PullRequestStatus".to_string(), - json::object! { - "description": "Pull request status", - "enum": [ - "notSet", - "active", - "abandoned", - "completed", - ], - "x-ms-enum": { - "name": "PullRequestStatus", - "values": [ - { - "value": "notSet", - "description": "Status not set. Default state." - }, - { - "value": "active", - "description": "Pull request is active." - }, - { - "value": "abandoned", - "description": "Pull request is abandoned." - }, - { - "value": "completed", - "description": "Pull request is completed." - } - ] + self.new_definitions.insert( + "PullRequestStatus".to_string(), + json::object! { + "description": "Pull request status", + "enum": [ + "notSet", + "active", + "abandoned", + "completed", + ], + "x-ms-enum": { + "name": "PullRequestStatus", + "values": [ + { + "value": "notSet", + "description": "Status not set. Default state." + }, + { + "value": "active", + "description": "Pull request is active." + }, + { + "value": "abandoned", + "description": "Pull request is abandoned." + }, + { + "value": "completed", + "description": "Pull request is completed." + } + ] - }, - }, - ); + }, + }, + ); - Some(json::array![ - { - "in": "path", - "name": "organization", - "description": "The name of the Azure DevOps organization.", - "required": true, - "type": "string" - }, - { - "in": "path", - "name": "repositoryId", - "description": "The repository ID of the pull request's target branch.", - "required": true, - "type": "string" - }, - { - "in": "path", - "name": "project", - "description": "Project ID or project name", - "required": true, - "x-ms-required": false, - "type": "string" - }, - { - "in": "path", - "name": "pullRequestId", - "description": "The ID of the pull request to retrieve.", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "in": "query", - "name": "includeCommits", - "description": "If true, the pull request will be returned with the associated commits.", - "required": false, - "type": "boolean" - }, - { - "in": "body", - "name": "updateOptions", - "description": "The pull request content to update.", - "required": true, - "schema": { - "$ref": "#/definitions/GitPullRequestUpdateOptions" - } - }, - { - "in": "query", - "name": "includeWorkItemRefs", - "description": "If true, the pull request will be returned with the associated work item references.", - "required": false, - "type": "boolean" - }, - { - "$ref": "#/parameters/api-Version-preview.1" - } - ]) + Some(json::array![ + { + "in": "path", + "name": "organization", + "description": "The name of the Azure DevOps organization.", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "repositoryId", + "description": "The repository ID of the pull request's target branch.", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "project", + "description": "Project ID or project name", + "required": true, + "x-ms-required": false, + "type": "string" + }, + { + "in": "path", + "name": "pullRequestId", + "description": "The ID of the pull request to retrieve.", + "required": true, + "type": "integer", + "format": "int32" + }, + { + "in": "query", + "name": "includeCommits", + "description": "If true, the pull request will be returned with the associated commits.", + "required": false, + "type": "boolean" + }, + { + "in": "body", + "name": "updateOptions", + "description": "The pull request content to update.", + "required": true, + "schema": { + "$ref": "#/definitions/GitPullRequestUpdateOptions" + } + }, + { + "in": "query", + "name": "includeWorkItemRefs", + "description": "If true, the pull request will be returned with the associated work item references.", + "required": false, + "type": "boolean" + }, + { + "$ref": "#/parameters/api-Version-preview.1" } - _ => None, - } + ]) + } + _ => None, } + } - fn patch_build_reference_links( - &mut self, - key: &[&str], - _value: &JsonValue, - ) -> Option<JsonValue> { - // Only applies to build specs - if !self.spec_path.ends_with("build.json") { - return None; - } - match key { - ["definitions", "ReferenceLinks", "properties"] => { - println!("Replace build ReferenceLinks definition"); - self.add_link_definition(); - - // Add all links that we are aware of. - Some(json::object! { - "badge": { - "$ref": "#/definitions/Link" - }, - "self": { - "$ref": "#/definitions/Link" - }, - "sourceVersionDisplayUri": { - "$ref": "#/definitions/Link" - }, - "timeline": { - "$ref": "#/definitions/Link" - }, - "web": { - "$ref": "#/definitions/Link" - }, - }) - } - _ => None, - } + fn patch_build_reference_links(&mut self, key: &[&str], _value: &JsonValue) -> Option<JsonValue> { + // Only applies to build specs + if !self.spec_path.ends_with("build.json") { + return None; } - - fn patch_input_validation_min_max( - &mut self, - key: &[&str], - value: &JsonValue, - ) -> Option<JsonValue> { - // Only applies to hooks specs - if !self.spec_path.ends_with("serviceHooks.json") { - return None; - } - match key { - ["definitions", "InputValidation", "properties", "minValue" | "maxValue"] => { - let mut value = value.clone(); - value["type"] = JsonValue::from("number"); - value["format"] = JsonValue::from("float"); - Some(value) - } - _ => None, - } + match key { + ["definitions", "ReferenceLinks", "properties"] => { + println!("Replace build ReferenceLinks definition"); + self.add_link_definition(); + + // Add all links that we are aware of. + Some(json::object! { + "badge": { + "$ref": "#/definitions/Link" + }, + "self": { + "$ref": "#/definitions/Link" + }, + "sourceVersionDisplayUri": { + "$ref": "#/definitions/Link" + }, + "timeline": { + "$ref": "#/definitions/Link" + }, + "web": { + "$ref": "#/definitions/Link" + }, + }) + } + _ => None, } - - // extensionManagement declares several `flags` properties as enums, but the values - // returned by the server are a comma-separated list of values, e.g. "builtIn, multiVersion, trusted" - // This is not easy to handle with serde, so we patch these definitions to be strings. - fn patch_extension_flags(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { - // Only applies to extensionManagement specs - if !self.spec_path.ends_with("extensionManagement.json") { - return None; - } - match key { - ["definitions", _, "properties", "flags"] => { - println!("Replace extensionManagement flags definition"); - Some(json::object! { - "description": value["description"].as_str().unwrap_or("").to_string(), - "type": "string", - }) - } - _ => None, - } + } + + fn patch_input_validation_min_max( + &mut self, + key: &[&str], + value: &JsonValue, + ) -> Option<JsonValue> { + // Only applies to hooks specs + if !self.spec_path.ends_with("serviceHooks.json") { + return None; } - - fn patch_probation_retries_type( - &mut self, - key: &[&str], - value: &JsonValue, - ) -> Option<JsonValue> { - // Only applies to hooks specs - if !self.spec_path.ends_with("serviceHooks.json") { - return None; - } - match key { - ["definitions", "Subscription", "properties", "probationRetries"] => { - let mut value = value.clone(); - value["type"] = JsonValue::from("integer"); - value["format"] = JsonValue::from("int32"); - Some(value) - } - _ => None, - } + match key { + ["definitions", "InputValidation", "properties", "minValue" | "maxValue"] => { + let mut value = value.clone(); + value["type"] = JsonValue::from("number"); + value["format"] = JsonValue::from("float"); + Some(value) + } + _ => None, + } + } + + // extensionManagement declares several `flags` properties as enums, but the values + // returned by the server are a comma-separated list of values, e.g. "builtIn, multiVersion, trusted" + // This is not easy to handle with serde, so we patch these definitions to be strings. + fn patch_extension_flags(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { + // Only applies to extensionManagement specs + if !self.spec_path.ends_with("extensionManagement.json") { + return None; + } + match key { + ["definitions", _, "properties", "flags"] => { + println!("Replace extensionManagement flags definition"); + Some(json::object! { + "description": value["description"].as_str().unwrap_or("").to_string(), + "type": "string", + }) + } + _ => None, } + } - fn patch_definition_required_fields( - &mut self, - key: &[&str], - value: &JsonValue, - ) -> Option<JsonValue> { - let patches = [ - ( - "serviceEndpoint.json", - "ServiceEndpoint", - // Excluded - // administratorsGroup - // operationStatus - r#"[ + fn patch_probation_retries_type(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { + // Only applies to hooks specs + if !self.spec_path.ends_with("serviceHooks.json") { + return None; + } + match key { + ["definitions", "Subscription", "properties", "probationRetries"] => { + let mut value = value.clone(); + value["type"] = JsonValue::from("integer"); + value["format"] = JsonValue::from("int32"); + Some(value) + } + _ => None, + } + } + + fn patch_definition_required_fields( + &mut self, + key: &[&str], + value: &JsonValue, + ) -> Option<JsonValue> { + let patches = [ + ( + "serviceEndpoint.json", + "ServiceEndpoint", + // Excluded + // administratorsGroup + // operationStatus + r#"[ "authorization", "createdBy", "data", @@ -1103,118 +1097,118 @@ impl Patcher { "type", "url" ]"#, - ), - ( - "serviceEndpoint.json", - "ServiceEndpointProjectReference", - r#"[ + ), + ( + "serviceEndpoint.json", + "ServiceEndpointProjectReference", + r#"[ "description", "name", "projectReference" ]"#, - ), - ( - "serviceEndpoint.json", - "ProjectReference", - r#"[ + ), + ( + "serviceEndpoint.json", + "ProjectReference", + r#"[ "id", "name" ]"#, - ), - // ( - // "serviceEndpoint.json", - // "GraphSubjectBase", - // r#"[ - // "links", - // "descriptor", - // "displayName", - // "url" - // ]"#, - // ), - ( - "serviceEndpoint.json", - "IdentityRef", - r#"[ + ), + // ( + // "serviceEndpoint.json", + // "GraphSubjectBase", + // r#"[ + // "links", + // "descriptor", + // "displayName", + // "url" + // ]"#, + // ), + ( + "serviceEndpoint.json", + "IdentityRef", + r#"[ "id" ]"#, - ), - ( - "pipelines.json", - "PipelineBase", - r#"[ + ), + ( + "pipelines.json", + "PipelineBase", + r#"[ "folder", "id", "name", "revision" ]"#, - ), - ( - "pipelines.json", - "PipelineConfiguration", - r#"[ + ), + ( + "pipelines.json", + "PipelineConfiguration", + r#"[ "type", "path", "repository" ]"#, - ), - ( - "pipelines.json", - "Run", - // Excluded - // - finishedDate - // - result - r#"[ + ), + ( + "pipelines.json", + "Run", + // Excluded + // - finishedDate + // - result + r#"[ "_links", "createdDate", "pipeline", "state", "url" ]"#, - ), - ( - "pipelines.json", - "RunReference", - r#"[ + ), + ( + "pipelines.json", + "RunReference", + r#"[ "id", "name" ]"#, - ), - ( - "git.json", - "GitRepository", - // Excluded - // _links - // defaultBranch - // isDisabled - // remoteUrl - // size - // sshUrl - // webUrl - r#"[ + ), + ( + "git.json", + "GitRepository", + // Excluded + // _links + // defaultBranch + // isDisabled + // remoteUrl + // size + // sshUrl + // webUrl + r#"[ "id", "name", "project", "url" ]"#, - ), - ( - "git.json", - "GitPullRequest", - // Excluded - // _links - // artifactId - // autoCompleteSetBy - // closedBy - // closedDate - // completionOptions - // completionQueueTime - // forkSource - // hasMultipleMergeBases - // mergeFailureMessage - // mergeFailureType - // mergeOptions - // remoteUrl - r#"[ + ), + ( + "git.json", + "GitPullRequest", + // Excluded + // _links + // artifactId + // autoCompleteSetBy + // closedBy + // closedDate + // completionOptions + // completionQueueTime + // forkSource + // hasMultipleMergeBases + // mergeFailureMessage + // mergeFailureType + // mergeOptions + // remoteUrl + r#"[ "createdBy", "creationDate", "isDraft", @@ -1225,806 +1219,789 @@ impl Patcher { "targetRefName", "url" ]"#, - ), - ( - "git.json", - "GitRef", - r#"[ + ), + ( + "git.json", + "GitRef", + r#"[ "name", "objectId" ]"#, - ), - ( - "git.json", - "Change", - r#"[ + ), + ( + "git.json", + "Change", + r#"[ "changeType", "item" ]"#, - ), - ( - "git.json", - "IdentityRef", - r#"[ + ), + ( + "git.json", + "IdentityRef", + r#"[ "id" ]"#, - ), - ( - "git.json", - "GitCommitRef", - r#"[ + ), + ( + "git.json", + "GitCommitRef", + r#"[ "commitId" ]"#, - ), - ( - "git.json", - "WebApiCreateTagRequestData", - r#"[ + ), + ( + "git.json", + "WebApiCreateTagRequestData", + r#"[ "name" ]"#, - ), - ( - "*", - "TeamProjectReference", - // Excluded - // description - // revision - // url - r#"[ + ), + ( + "*", + "TeamProjectReference", + // Excluded + // description + // revision + // url + r#"[ "id", "lastUpdateTime", "name", "state", "visibility" ]"#, - ), - ( - "build.json", - "Build", - // Excluded - // agentSpecification - // buildNumber - // buildNumberRevision - // controller - // deleted - // deletedBy - // deletedDate - // deletedReason - // demands - // finishTime - // lastChangedBy - // lastChangedDate - // logs - // orchestrationPlan - // parameters - // plans - // properties - // quality - // queue - // queueOptions - // queuePosition - // queueTime - // repository - // requestedBy - // requestedFor - // result - // retainedByRelease - // sourceBranch - // sourceVersion - // startTime - // status - // tags - // templateParameters - // triggeredByBuild - // triggerInfo - // _links - // uri - // url - // validationResults - r#"[ + ), + ( + "build.json", + "Build", + // Excluded + // agentSpecification + // buildNumber + // buildNumberRevision + // controller + // deleted + // deletedBy + // deletedDate + // deletedReason + // demands + // finishTime + // lastChangedBy + // lastChangedDate + // logs + // orchestrationPlan + // parameters + // plans + // properties + // quality + // queue + // queueOptions + // queuePosition + // queueTime + // repository + // requestedBy + // requestedFor + // result + // retainedByRelease + // sourceBranch + // sourceVersion + // startTime + // status + // tags + // templateParameters + // triggeredByBuild + // triggerInfo + // _links + // uri + // url + // validationResults + r#"[ "definition", "id", "priority", "project", "reason" ]"#, - ), - ( - "build.json", - "DefinitionReference", - // Excluded - // createdDate - // name - // path - // type - // uri - r#"[ + ), + ( + "build.json", + "DefinitionReference", + // Excluded + // createdDate + // name + // path + // type + // uri + r#"[ "id", "project", "queueStatus", "revision", "url" ]"#, - ), - ( - "build.json", - "BuildLogReference", - r#"[ + ), + ( + "build.json", + "BuildLogReference", + r#"[ "id", "type", "url" ]"#, - ), - ( - "build.json", - "AgentPoolQueue", - // Excluded - // _links - // url - r#"[ + ), + ( + "build.json", + "AgentPoolQueue", + // Excluded + // _links + // url + r#"[ "id", "pool", "name" ]"#, - ), - ( - "build.json", - "TaskAgentPoolReference", - // Excluded - // isHosted - r#"[ + ), + ( + "build.json", + "TaskAgentPoolReference", + // Excluded + // isHosted + r#"[ "id", "name" ]"#, - ), - ( - "build.json", - "TaskOrchestrationPlanReference", - // Excluded - // orchestrationType - r#"[ + ), + ( + "build.json", + "TaskOrchestrationPlanReference", + // Excluded + // orchestrationType + r#"[ "planId" ]"#, - ), - ( - "build.json", - "BuildRepository", - // Excluded - // clean - // checkoutSubmodules - // defaultBranch - // properties - // rootFolder - // name - // url - // type - r#"[ + ), + ( + "build.json", + "BuildRepository", + // Excluded + // clean + // checkoutSubmodules + // defaultBranch + // properties + // rootFolder + // name + // url + // type + r#"[ "id" ]"#, - ), - // ( - // "*", - // "GraphSubjectBase", - // // Excluded - // // _links - // // "descriptor - // // displayName - // // url - // r#"[ - // ]"#, - // ), - ( - "*", - "IdentityRef", - r#"[ + ), + // ( + // "*", + // "GraphSubjectBase", + // // Excluded + // // _links + // // "descriptor + // // displayName + // // url + // r#"[ + // ]"#, + // ), + ( + "*", + "IdentityRef", + r#"[ "id", "uniqueName" ]"#, - ), - ( - "workItemTracking.json", - "Link", - r#"[ + ), + ( + "workItemTracking.json", + "Link", + r#"[ "attributes", "rel", "url" ]"#, - ), - ( - "workItemTracking.json", - "WorkItemTrackingResourceReference", - r#"[ + ), + ( + "workItemTracking.json", + "WorkItemTrackingResourceReference", + r#"[ "url" ]"#, - ), - // ( - // "workItemTracking.json", - // "WorkItemTrackingResource", - // r#"[ - // "_links" - // ]"#, - // ), - ( - "workItemTracking.json", - "WorkItem", - r#"[ + ), + // ( + // "workItemTracking.json", + // "WorkItemTrackingResource", + // r#"[ + // "_links" + // ]"#, + // ), + ( + "workItemTracking.json", + "WorkItem", + r#"[ "id", "fields" ]"#, - ), - ( - "status.json", - "ServiceHealth", - r#"[ + ), + ( + "status.json", + "ServiceHealth", + r#"[ "id" ]"#, - ), - ( - "status.json", - "GeographyWithHealth", - r#"[ + ), + ( + "status.json", + "GeographyWithHealth", + r#"[ "health" ]"#, - ), - ( - "status.json", - "Geography", - r#"[ + ), + ( + "status.json", + "Geography", + r#"[ "id", "name" ]"#, - ), - ( - "status.json", - "Status", - r#"[ + ), + ( + "status.json", + "Status", + r#"[ "status" ]"#, - ), - ( - "status.json", - "StatusSummary", - r#"[ + ), + ( + "status.json", + "StatusSummary", + r#"[ "health", "message" ]"#, - ), - ( - "policy.json", - "PolicyType", - r#"[ + ), + ( + "policy.json", + "PolicyType", + r#"[ "_links", "description" ]"#, - ), - ( - "policy.json", - "PolicyTypeRef", - r#"[ + ), + ( + "policy.json", + "PolicyTypeRef", + r#"[ "displayName", "id", "url" ]"#, - ), - ]; - - match key { - ["definitions", def] => { - for (filename, def_name, required_fields) in patches.iter() { - if (*filename == "*" || self.spec_path.ends_with(filename)) && (def == def_name) - { - println!("Add required values to {} definition", def_name); - let mut value = value.to_owned(); - value["required"] = json::parse(required_fields).unwrap(); - return Some(value); - } - } - None - } - _ => None, - } - } + ), + ]; - // Add missing "organization" and "unchanged" values to the TeamProjectReference `visibility` enum - // - // Before patch: - // enum: [ - // "private", - // "public" - // ] - // - // After patch: - // enum: [ - // "private", - // "public", - // "organization", - // "unchanged" - // ] - fn patch_teamproject_visibility_enum( - &mut self, - key: &[&str], - value: &JsonValue, - ) -> Option<JsonValue> { - match key { - ["definitions", "TeamProjectReference", "properties", "visibility", "enum"] => { - if value.len() == 2 { - println!("Add 'organization' and 'unchanged' to TeamProjectReference visibility enum"); - Some(json::array![ - "private", - "public", - "organization", - "unchanged" - ]) - } else { - None - } - } - _ => None, + match key { + ["definitions", def] => { + for (filename, def_name, required_fields) in patches.iter() { + if (*filename == "*" || self.spec_path.ends_with(filename)) && (def == def_name) { + println!("Add required values to {} definition", def_name); + let mut value = value.to_owned(); + value["required"] = json::parse(required_fields).unwrap(); + return Some(value); + } } + None + } + _ => None, } - - // Replace this invalid array of arrays with no item type declaration: - // "schema": { - // "type": "array", - // "items": { - // "type": "array" - // } - // } - // - // With: - // "schema": { - // "type": "array", - // "items": { - // "type": "string" - // } - // } - fn patch_array_array_schema(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { - match key { - ["paths" | "x-ms-paths", _path, _op, "responses", _rsp_code, "schema"] => { - // memberEntitlementManagement.json has this, which declares an array but omits the items type: - // "responses": { - // "200": { - // "description": "successful operation", - // "schema": { - // "type": "array" - // } - // } - // }, - if (value["type"] == "array") && (value["items"] == JsonValue::Null) { - println!("Replace array[<undefined>] with array[object]"); - Some(json::object! { - "type": "array", - "items": { - "type": "object" - } - }) - } else if (value["items"]["type"] == "array") - && (value["items"]["items"] == JsonValue::Null) - { - println!("Replace array[array] with array[string]"); - Some(json::object! { - "type": "array", - "items": { - "type": "string" - } - }) - } else { - None - } - } - _ => None, + } + + // Add missing "organization" and "unchanged" values to the TeamProjectReference `visibility` enum + // + // Before patch: + // enum: [ + // "private", + // "public" + // ] + // + // After patch: + // enum: [ + // "private", + // "public", + // "organization", + // "unchanged" + // ] + fn patch_teamproject_visibility_enum( + &mut self, + key: &[&str], + value: &JsonValue, + ) -> Option<JsonValue> { + match key { + ["definitions", "TeamProjectReference", "properties", "visibility", "enum"] => { + if value.len() == 2 { + println!("Add 'organization' and 'unchanged' to TeamProjectReference visibility enum"); + Some(json::array![ + "private", + "public", + "organization", + "unchanged" + ]) + } else { + None } + } + _ => None, } - - // The spec defines many return values as arrays of a type, when in fact the API returns - // the array wrapped in an object with `count` and `value` fields (where the value field - // contains the array). - // - // This patch replaces the array definition with the wrapped version, and adds a new - // definition called `<type>List` for the wrapped type. - fn patch_response_schema(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { - match key { - ["paths" | "x-ms-paths", _path, _op, "responses", _rsp_code, "schema"] => { - if value["type"].as_str() == Some("array") { - if let Some(qualified_def) = value["items"]["$ref"].as_str() { - // The definition reference looks like this: `#/definitions/PipelineBase`. - // We want to extract the name segment which is after the last `/`. - let def_name = qualified_def.rsplit('/').next().unwrap(); - let def_list = format!("{def_name}List"); - println!("Convert array of {def_name} to {def_list}"); - - self.new_definitions.insert( - def_list.clone(), - json::object! { - "description": "", - "type": "object", - "properties": { - "count": { - "type": "integer", - "format": "int32" - }, - "value": { - "type": "array", - "items": { - "$ref": qualified_def - } - } - } - }, - ); - - Some(json::object! { - "$ref": format!("#/definitions/{def_list}") - }) - } else { - None - } - } else { - None - } - } - _ => None, + } + + // Replace this invalid array of arrays with no item type declaration: + // "schema": { + // "type": "array", + // "items": { + // "type": "array" + // } + // } + // + // With: + // "schema": { + // "type": "array", + // "items": { + // "type": "string" + // } + // } + fn patch_array_array_schema(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { + match key { + ["paths" | "x-ms-paths", _path, _op, "responses", _rsp_code, "schema"] => { + // memberEntitlementManagement.json has this, which declares an array but omits the items type: + // "responses": { + // "200": { + // "description": "successful operation", + // "schema": { + // "type": "array" + // } + // } + // }, + if (value["type"] == "array") && (value["items"] == JsonValue::Null) { + println!("Replace array[<undefined>] with array[object]"); + Some(json::object! { + "type": "array", + "items": { + "type": "object" + } + }) + } else if (value["items"]["type"] == "array") + && (value["items"]["items"] == JsonValue::Null) + { + println!("Replace array[array] with array[string]"); + Some(json::object! { + "type": "array", + "items": { + "type": "string" + } + }) + } else { + None } + } + _ => None, } - - // Applies all patches from DOC_PATCHES to supplied string. - fn patch_docstring(&self, s: &str) -> String { - let mut patched_s: String = s.to_string(); - for r in DOC_PATCHES { - patched_s = patched_s.replace(r.0, r.1); - } - // Markup URL references - let regex = regex::Regex::new(r"\s(?P<url>(http|https)://[_A-Za-z0-9/]+)").unwrap(); - let patched_s = regex.replace_all(&patched_s, "<${url}>"); - if patched_s != s { - format!("[patched]{}", patched_s); - println!("patch_docstring: {} => {}", s, patched_s); + } + + // The spec defines many return values as arrays of a type, when in fact the API returns + // the array wrapped in an object with `count` and `value` fields (where the value field + // contains the array). + // + // This patch replaces the array definition with the wrapped version, and adds a new + // definition called `<type>List` for the wrapped type. + fn patch_response_schema(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { + match key { + ["paths" | "x-ms-paths", _path, _op, "responses", _rsp_code, "schema"] => { + if value["type"].as_str() == Some("array") { + if let Some(qualified_def) = value["items"]["$ref"].as_str() { + // The definition reference looks like this: `#/definitions/PipelineBase`. + // We want to extract the name segment which is after the last `/`. + let def_name = qualified_def.rsplit('/').next().unwrap(); + let def_list = format!("{def_name}List"); + println!("Convert array of {def_name} to {def_list}"); + + self.new_definitions.insert( + def_list.clone(), + json::object! { + "description": "", + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int32" + }, + "value": { + "type": "array", + "items": { + "$ref": qualified_def + } + } + } + }, + ); + + Some(json::object! { + "$ref": format!("#/definitions/{def_list}") + }) + } else { + None + } + } else { + None } - patched_s.to_string() + } + _ => None, } + } - // Patch documentation - // - // Does simple text replacement on description and summary fields. - fn patch_docs(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { - match key { - [.., "parameters"] => { - // Parameters is an array of `JsonValue`s, each of which may have a `description` field - let mut value = value.clone(); - for param in value.members_mut() { - if let Some(s) = param["description"].as_str() { - param["description"] = self.patch_docstring(s).into() - } - } - Some(value) - } - [.., "description" | "summary"] => { - value.as_str().map(|v| self.patch_docstring(v).into()) - } - _ => None, - } + // Applies all patches from DOC_PATCHES to supplied string. + fn patch_docstring(&self, s: &str) -> String { + let mut patched_s: String = s.to_string(); + for r in DOC_PATCHES { + patched_s = patched_s.replace(r.0, r.1); } - /// Patch the WorkItemTracking schema for creating or updating Work Items - /// - /// Creating or updating a work item can invole multiple operations in one go, e.g creating - /// an item but also assigning a parent/iteration to it. This patch allows a Vector of operations - /// to be supplied in a single API call so that multiple fields can be assigned - fn patch_wit_create_update_item( - &mut self, - key: &[&str], - value: &JsonValue, - ) -> Option<JsonValue> { - if !self.spec_path.ends_with("workItemTracking.json") { - return None; - } - match key { - ["paths", "/{organization}/{project}/_apis/wit/workitems/${type}", "post", "parameters"] => - { - // Parameters is an array of `JsonValue`s, each of which has a `name` field - let mut value = value.clone(); - for param in value.members_mut() { - if let Some(s) = param["name"].as_str() { - // Find the body so we can correct its fields - if s == "body" { - // Remove the schema as we're placing it with an array of items - let _ = param.remove("schema"); - // Add a type field to the parameter - param.insert("type", "array").unwrap(); - // Add an items field referring to a definition - param - .insert( - "items", - json::object! { - "$ref": "#/definitions/JsonPatchOperation" - }, - ) - .unwrap(); - // Update the description to reflect the definition - param["description"] = JsonValue::from( - "A list of operations to perform when creating a Work Item", - ); - } - } - } - Some(value) - } - ["paths", "/{organization}/{project}/_apis/wit/workitems/{id}", "patch", "parameters"] => - { - // Parameters is an array of `JsonValue`s, each of which has a `name` field - let mut value = value.clone(); - for param in value.members_mut() { - if let Some(s) = param["name"].as_str() { - // Find the body so we can correct its fields - if s == "body" { - // Remove the schema as we're placing it with an array of items - let _ = param.remove("schema"); - // Add a type field to the parameter - param.insert("type", "array").unwrap(); - // Add an items field referring to a definition - param - .insert( - "items", - json::object! { - "$ref": "#/definitions/JsonPatchOperation" - }, - ) - .unwrap(); - // Update the description to reflect the definition - param["description"] = JsonValue::from( - "A list of operations to perform when updating a Work Item", - ); - } - } - } - Some(value) - } - _ => None, + // Markup URL references + let regex = regex::Regex::new(r"\s(?P<url>(http|https)://[_A-Za-z0-9/]+)").unwrap(); + let patched_s = regex.replace_all(&patched_s, "<${url}>"); + if patched_s != s { + format!("[patched]{}", patched_s); + println!("patch_docstring: {} => {}", s, patched_s); + } + patched_s.to_string() + } + + // Patch documentation + // + // Does simple text replacement on description and summary fields. + fn patch_docs(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { + match key { + [.., "parameters"] => { + // Parameters is an array of `JsonValue`s, each of which may have a `description` field + let mut value = value.clone(); + for param in value.members_mut() { + if let Some(s) = param["description"].as_str() { + param["description"] = self.patch_docstring(s).into() + } } + Some(value) + } + [.., "description" | "summary"] => value.as_str().map(|v| self.patch_docstring(v).into()), + _ => None, } - - // The definition of IdentityReference has issues because it defines a property called `id` which is also in `IdentityRef` which is included via `allOf`. - // This causes the deserialization to fail as it doesn't know which `id` to use. - // Fix is to replace the definition of `IdentityReference` with the definition of `IdentityRef`. - fn patch_wit_identity_reference( - &mut self, - key: &[&str], - _value: &JsonValue, - ) -> Option<JsonValue> { - if !self.spec_path.ends_with("workItemTracking.json") { - return None; + } + /// Patch the WorkItemTracking schema for creating or updating Work Items + /// + /// Creating or updating a work item can invole multiple operations in one go, e.g creating + /// an item but also assigning a parent/iteration to it. This patch allows a Vector of operations + /// to be supplied in a single API call so that multiple fields can be assigned + fn patch_wit_create_update_item(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { + if !self.spec_path.ends_with("workItemTracking.json") { + return None; + } + match key { + ["paths", "/{organization}/{project}/_apis/wit/workitems/${type}", "post", "parameters"] => { + // Parameters is an array of `JsonValue`s, each of which has a `name` field + let mut value = value.clone(); + for param in value.members_mut() { + if let Some(s) = param["name"].as_str() { + // Find the body so we can correct its fields + if s == "body" { + // Remove the schema as we're placing it with an array of items + let _ = param.remove("schema"); + // Add a type field to the parameter + param.insert("type", "array").unwrap(); + // Add an items field referring to a definition + param + .insert( + "items", + json::object! { + "$ref": "#/definitions/JsonPatchOperation" + }, + ) + .unwrap(); + // Update the description to reflect the definition + param["description"] = + JsonValue::from("A list of operations to perform when creating a Work Item"); + } + } } - - match key { - ["definitions", "IdentityReference"] => { - // Replace with the definition of `IdentifyRef` - Some(json::object!( - "description": "", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/GraphSubjectBase" - } - ], - "properties": { - "directoryAlias": { - "description": "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary", - "type": "string" - }, - "id": { - "type": "string" - }, - "imageUrl": { - "description": "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary", - "type": "string" - }, - "inactive": { - "description": "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary", - "type": "boolean" - }, - "isAadIdentity": { - "description": "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)", - "type": "boolean" - }, - "isContainer": { - "description": "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)", - "type": "boolean" - }, - "isDeletedInOrigin": { - "type": "boolean" - }, - "profileUrl": { - "description": "Deprecated - not in use in most preexisting implementations of ToIdentityRef", - "type": "string" - }, - "uniqueName": { - "description": "Deprecated - use Domain+PrincipalName instead", - "type": "string" - } - } - )) + Some(value) + } + ["paths", "/{organization}/{project}/_apis/wit/workitems/{id}", "patch", "parameters"] => { + // Parameters is an array of `JsonValue`s, each of which has a `name` field + let mut value = value.clone(); + for param in value.members_mut() { + if let Some(s) = param["name"].as_str() { + // Find the body so we can correct its fields + if s == "body" { + // Remove the schema as we're placing it with an array of items + let _ = param.remove("schema"); + // Add a type field to the parameter + param.insert("type", "array").unwrap(); + // Add an items field referring to a definition + param + .insert( + "items", + json::object! { + "$ref": "#/definitions/JsonPatchOperation" + }, + ) + .unwrap(); + // Update the description to reflect the definition + param["description"] = + JsonValue::from("A list of operations to perform when updating a Work Item"); } - _ => None, + } } + Some(value) + } + _ => None, + } + } + + // The definition of IdentityReference has issues because it defines a property called `id` which is also in `IdentityRef` which is included via `allOf`. + // This causes the deserialization to fail as it doesn't know which `id` to use. + // Fix is to replace the definition of `IdentityReference` with the definition of `IdentityRef`. + fn patch_wit_identity_reference( + &mut self, + key: &[&str], + _value: &JsonValue, + ) -> Option<JsonValue> { + if !self.spec_path.ends_with("workItemTracking.json") { + return None; } - /// Patch Wiki Pages - /// - /// To update a Wiki Page an `If-Match` header must be supplied with an `eTag` (page version) - /// value. By default this header is generated with the name `Version`. This replaces the name - /// `Version` with `If-Match`. - fn patch_wiki_pages_update(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { - // Only applies to wiki specs - if !self.spec_path.ends_with("wiki.json") { - return None; - } - match key { - ["paths", "/{organization}/{project}/_apis/wiki/wikis/{wikiIdentifier}/pages", "put", "parameters"] => - { - // Parameters is an array of `JsonValue`s, each of which has a `name` field - let mut value = value.clone(); - for param in value.members_mut() { - if let Some(s) = param["name"].as_str() { - // Only update the field which exactly matches "Version" - if s == "Version" { - println!("Replacing header `Version` with `If-Match`"); - param["name"] = "If-Match".to_string().into(); - } - } + match key { + ["definitions", "IdentityReference"] => { + // Replace with the definition of `IdentifyRef` + Some(json::object!( + "description": "", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/GraphSubjectBase" } - Some(value) - } - ["paths", "/{organization}/{project}/_apis/wiki/wikis/{wikiIdentifier}/pages/{id}", "patch", "parameters"] => - { - // Parameters is an array of `JsonValue`s, each of which has a `name` field - let mut value = value.clone(); - for param in value.members_mut() { - if let Some(s) = param["name"].as_str() { - // Only update the field which exactly matches "Version" - if s == "Version" { - println!("Replacing header `Version` with `If-Match`"); - param["name"] = "If-Match".to_string().into(); - } - } + ], + "properties": { + "directoryAlias": { + "description": "Deprecated - Can be retrieved by querying the Graph user referenced in the \"self\" entry of the IdentityRef \"_links\" dictionary", + "type": "string" + }, + "id": { + "type": "string" + }, + "imageUrl": { + "description": "Deprecated - Available in the \"avatar\" entry of the IdentityRef \"_links\" dictionary", + "type": "string" + }, + "inactive": { + "description": "Deprecated - Can be retrieved by querying the Graph membership state referenced in the \"membershipState\" entry of the GraphUser \"_links\" dictionary", + "type": "boolean" + }, + "isAadIdentity": { + "description": "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)", + "type": "boolean" + }, + "isContainer": { + "description": "Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)", + "type": "boolean" + }, + "isDeletedInOrigin": { + "type": "boolean" + }, + "profileUrl": { + "description": "Deprecated - not in use in most preexisting implementations of ToIdentityRef", + "type": "string" + }, + "uniqueName": { + "description": "Deprecated - use Domain+PrincipalName instead", + "type": "string" } - Some(value) } - _ => None, - } + )) + } + _ => None, } - - /// Patch JObject - /// - /// These are actually arbitrary JSON objects - fn patch_jobjects(&mut self, _key: &[&str], value: &JsonValue) -> Option<JsonValue> { - if let JsonValue::Object(obj) = value { - if let Some("#/definitions/JObject") = obj.get("$ref").and_then(|s| s.as_str()) { - let mut value = value.clone(); - value.remove("$ref"); - if value - .insert("type", JsonValue::String("object".to_string())) - .is_ok() - { - return Some(value); - } + } + + /// Patch Wiki Pages + /// + /// To update a Wiki Page an `If-Match` header must be supplied with an `eTag` (page version) + /// value. By default this header is generated with the name `Version`. This replaces the name + /// `Version` with `If-Match`. + fn patch_wiki_pages_update(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { + // Only applies to wiki specs + if !self.spec_path.ends_with("wiki.json") { + return None; + } + match key { + ["paths", "/{organization}/{project}/_apis/wiki/wikis/{wikiIdentifier}/pages", "put", "parameters"] => + { + // Parameters is an array of `JsonValue`s, each of which has a `name` field + let mut value = value.clone(); + for param in value.members_mut() { + if let Some(s) = param["name"].as_str() { + // Only update the field which exactly matches "Version" + if s == "Version" { + println!("Replacing header `Version` with `If-Match`"); + param["name"] = "If-Match".to_string().into(); } + } } - None - } - - /// Patch IdentityDescriptor - /// - /// These are spec'd as { "identifier": "string", "identityType": "string" } - /// but seem to always be strings in practice/examples. - fn patch_identity_descriptors( - &mut self, - _key: &[&str], - value: &JsonValue, - ) -> Option<JsonValue> { - if let JsonValue::Object(obj) = value { - if let Some("#/definitions/IdentityDescriptor") = - obj.get("$ref").and_then(|s| s.as_str()) - { - let mut value = value.clone(); - value.remove("$ref"); - if value - .insert("type", JsonValue::String("string".to_string())) - .is_ok() - { - return Some(value); - } + Some(value) + } + ["paths", "/{organization}/{project}/_apis/wiki/wikis/{wikiIdentifier}/pages/{id}", "patch", "parameters"] => + { + // Parameters is an array of `JsonValue`s, each of which has a `name` field + let mut value = value.clone(); + for param in value.members_mut() { + if let Some(s) = param["name"].as_str() { + // Only update the field which exactly matches "Version" + if s == "Version" { + println!("Replacing header `Version` with `If-Match`"); + param["name"] = "If-Match".to_string().into(); } + } } - None + Some(value) + } + _ => None, } - - /// Patch Security - /// - /// Correct the expected body parameter of accesscontrollists - fn patch_security(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { - if !self.spec_path.ends_with("security.json") { - return None; + } + + /// Patch JObject + /// + /// These are actually arbitrary JSON objects + fn patch_jobjects(&mut self, _key: &[&str], value: &JsonValue) -> Option<JsonValue> { + if let JsonValue::Object(obj) = value { + if let Some("#/definitions/JObject") = obj.get("$ref").and_then(|s| s.as_str()) { + let mut value = value.clone(); + value.remove("$ref"); + if value + .insert("type", JsonValue::String("object".to_string())) + .is_ok() + { + return Some(value); } - match key { - ["paths", "/{organization}/_apis/accesscontrollists/{securityNamespaceId}", "post", "parameters"] => - { - // Parameters is an array of `JsonValue`s, each of which has a `name` field - let mut value = value.clone(); - for param in value.members_mut() { - if let Some(s) = param["name"].as_str() { - // Only update the body parameter - if s == "body" { - self.new_definitions.insert( - "AccessControlListBody".to_string(), - json::object! { - "type": "object", - "required": [ "value" ], - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/AccessControlList" - } - } - } - }, - ); - - param - .insert( - "schema", - json::object!("$ref": "#/definitions/AccessControlListBody"), - ) - .unwrap(); + } + } + None + } + + /// Patch IdentityDescriptor + /// + /// These are spec'd as { "identifier": "string", "identityType": "string" } + /// but seem to always be strings in practice/examples. + fn patch_identity_descriptors(&mut self, _key: &[&str], value: &JsonValue) -> Option<JsonValue> { + if let JsonValue::Object(obj) = value { + if let Some("#/definitions/IdentityDescriptor") = obj.get("$ref").and_then(|s| s.as_str()) { + let mut value = value.clone(); + value.remove("$ref"); + if value + .insert("type", JsonValue::String("string".to_string())) + .is_ok() + { + return Some(value); + } + } + } + None + } + + /// Patch Security + /// + /// Correct the expected body parameter of accesscontrollists + fn patch_security(&mut self, key: &[&str], value: &JsonValue) -> Option<JsonValue> { + if !self.spec_path.ends_with("security.json") { + return None; + } + match key { + ["paths", "/{organization}/_apis/accesscontrollists/{securityNamespaceId}", "post", "parameters"] => + { + // Parameters is an array of `JsonValue`s, each of which has a `name` field + let mut value = value.clone(); + for param in value.members_mut() { + if let Some(s) = param["name"].as_str() { + // Only update the body parameter + if s == "body" { + self.new_definitions.insert( + "AccessControlListBody".to_string(), + json::object! { + "type": "object", + "required": [ "value" ], + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/AccessControlList" + } } } - } - Some(value) + }, + ); + + param + .insert( + "schema", + json::object!("$ref": "#/definitions/AccessControlListBody"), + ) + .unwrap(); } - _ => None, + } } + Some(value) + } + _ => None, } - - // Main patching function, called for each object key in the object tree. - // The patcher can replace the existing value by returning `Some<JsonValue>`, - // or leave it unmodified by returning `None`. - fn maybe_patch(&mut self, key: &[&str], value: &mut JsonValue) { - //println!("patcher: {:#?}", key); - for patch_fn in Patcher::PATCH_FNS.iter() { - if let Some(patch) = patch_fn(self, key, value) { - *value = patch; - } - } + } + + // Main patching function, called for each object key in the object tree. + // The patcher can replace the existing value by returning `Some<JsonValue>`, + // or leave it unmodified by returning `None`. + fn maybe_patch(&mut self, key: &[&str], value: &mut JsonValue) { + //println!("patcher: {:#?}", key); + for patch_fn in Patcher::PATCH_FNS.iter() { + if let Some(patch) = patch_fn(self, key, value) { + *value = patch; + } } - - // Walk all (key, values) in the object tree, invoking the `patcher` function for each. - fn walker(&mut self, key: &[&str], value: &mut JsonValue) { - self.maybe_patch(key, value); - if let JsonValue::Object(_) = value { - for (k, v) in value.entries_mut() { - let mut new_key = key.to_owned(); - new_key.push(k); - self.walker(&new_key, v); - } - } - if let JsonValue::Array(_) = value { - for (i, v) in value.members_mut().enumerate() { - let mut new_key = key.to_owned(); - let i = i.to_string(); - new_key.push(i.as_str()); - self.walker(&new_key, v); - } - } + } + + // Walk all (key, values) in the object tree, invoking the `patcher` function for each. + fn walker(&mut self, key: &[&str], value: &mut JsonValue) { + self.maybe_patch(key, value); + if let JsonValue::Object(_) = value { + for (k, v) in value.entries_mut() { + let mut new_key = key.to_owned(); + new_key.push(k); + self.walker(&new_key, v); + } } - - // Adds all the accumulated new definitions to the definitions section of the schema - fn add_new_definitions(&mut self, json: &mut JsonValue) { - for (k, v) in mem::take(&mut self.new_definitions) { - json["definitions"][k] = v - } + if let JsonValue::Array(_) = value { + for (i, v) in value.members_mut().enumerate() { + let mut new_key = key.to_owned(); + let i = i.to_string(); + new_key.push(i.as_str()); + self.walker(&new_key, v); + } } + } - fn run(&mut self, json: &mut JsonValue) { - self.walker(&[], json); - self.add_new_definitions(json); + // Adds all the accumulated new definitions to the definitions section of the schema + fn add_new_definitions(&mut self, json: &mut JsonValue) { + for (k, v) in mem::take(&mut self.new_definitions) { + json["definitions"][k] = v } + } + + fn run(&mut self, json: &mut JsonValue) { + self.walker(&[], json); + self.add_new_definitions(json); + } }